Skip to content

Commit

Permalink
Merge branch 'master' into v4.3.0_ITOM_Version
Browse files Browse the repository at this point in the history
Conflicts:
	docs/userDoc/source/12_contributing/git_pre_commit_hooks.rst
  • Loading branch information
ItomBuild committed May 29, 2024
2 parents 86ee7d3 + 0014759 commit 253cd24
Show file tree
Hide file tree
Showing 265 changed files with 52,204 additions and 25,098 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: ^(gtest-1.10.0)/
exclude: ^(gtest-1.12.1)/

ci:
autoupdate_schedule: monthly
Expand Down
11 changes: 8 additions & 3 deletions AddInManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ find_package(OpenCV COMPONENTS core REQUIRED)
add_definitions(-DADDINMGR_DLL -D_ADDINMGR_DLL)

if(BUILD_WITH_PCL)
find_package(PCL 1.5.1 REQUIRED COMPONENTS common)
add_definitions(-DUSEPCL)
endif()
include(Setup_PCL_Itom)
if(WIN32)
find_package(PCL 1.5.1 QUIET REQUIRED COMPONENTS common PATHS ${PCL_CMAKE_DIR} NO_DEFAULT_PATH)
else(WIN32)
find_package(PCL 1.5.1 QUIET REQUIRED COMPONENTS common)
endif(WIN32)
add_definitions(-DUSEPCL -D_USEPCL)
endif(BUILD_WITH_PCL)

include_directories(
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,18 @@ add_subdirectory(plot)
add_subdirectory(itomWidgets)
add_subdirectory(Qitom)
add_subdirectory(iconThemes)

if(BUILD_UNITTEST)
#put this as last, since gtest is globally changing many compiler flags
add_subdirectory(gtest-1.10.0)
if(WIN32 AND ((NOT DEFINED ${gtest_force_shared_crt}) OR (NOT ${gtest_force_shared_crt})))
set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib." FORCE)
message(WARNING "For properly running the unittests, the CMAKE variable gtest_force_shared_crt has been forced to ON.")
endif()

message(WARNING "Start adding gtest ${gtest_force_shared_crt}")

add_subdirectory(gtest-1.12.1)
message(WARNING "End adding gtest ${gtest_force_shared_crt}")
add_subdirectory(itom_unittests)
endif()

Expand Down
3 changes: 2 additions & 1 deletion Qitom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ if(BUILD_WITH_PCL)
else(WIN32)
find_package(PCL 1.5.1 QUIET REQUIRED COMPONENTS common)
endif(WIN32)
add_definitions(-DUSEPCL -D_USEPCL)

# actually we need this only to configure the itom.bat including vtk, otherwise
# eventually pcl-tools plugin will not be loaded
find_package(VTK QUIET)
endif()
endif(BUILD_WITH_PCL)

find_package(VisualLeakDetector QUIET)
find_package(HTMLHelp)
Expand Down
18 changes: 9 additions & 9 deletions common/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,19 +1069,19 @@ template <typename _Tp> struct ItomParamHelper

if (val)
{
int len = static_cast<int>(strlen((const char*)val));
int str_len = static_cast<int>(strlen((const char*)val));

if (((ito::int32)len != param->d->len) || (param->d->data.ptrVal == nullptr))
if (((ito::uint32)str_len != param->d->len) || (param->d->data.ptrVal == nullptr))
{
param->d->data.ptrVal = new char[len + 1];
param->d->data.ptrVal = new char[str_len + 1];
}
else
{
cVal_ = nullptr;
}

std::copy_n((const char*)val, len + 1, (char*)param->d->data.ptrVal);
param->d->len = len;
std::copy_n((const char*)val, str_len + 1, (char*)param->d->data.ptrVal);
param->d->len = str_len;
}
else
{
Expand All @@ -1101,7 +1101,7 @@ template <typename _Tp> struct ItomParamHelper

if ((val) && (len > 0))
{
if ((ito::int32)len != param->d->len)
if ((ito::uint32)len != param->d->len)
{
param->d->data.ptrVal = new char[len];
param->d->len = len;
Expand Down Expand Up @@ -1131,7 +1131,7 @@ template <typename _Tp> struct ItomParamHelper

if ((val) && (len > 0))
{
if ((ito::int32)len != param->d->len)
if ((ito::uint32)len != param->d->len)
{
param->d->data.ptrVal = new int32[len];
param->d->len = len;
Expand Down Expand Up @@ -1161,7 +1161,7 @@ template <typename _Tp> struct ItomParamHelper

if ((val) && (len > 0))
{
if ((ito::int32)len != param->d->len)
if ((ito::uint32)len != param->d->len)
{
param->d->data.ptrVal = new float64[len];
param->d->len = len;
Expand Down Expand Up @@ -1191,7 +1191,7 @@ template <typename _Tp> struct ItomParamHelper

if ((val) && (len > 0))
{
if ((ito::int32)len != param->d->len)
if ((ito::uint32)len != param->d->len)
{
param->d->data.ptrVal = new complex128[len];
param->d->len = len;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ itom.figure.liveImage

.. currentmodule:: itom

.. automethod:: figure.liveImage
.. automethod:: figure.liveImage
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ itom.figure.plot

.. currentmodule:: itom

.. automethod:: figure.plot
.. automethod:: figure.plot
33 changes: 25 additions & 8 deletions docs/userDoc/source/12_contributing/git_pre_commit_hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,36 @@
Git Pre-Commit Hooks
********************

Itom makes use of pre-commit hooks to check for compliance with our coding guidelines.
The pre-commit hooks are run before each commit and your commit can fail accordingly.
Itom makes use of `pre-commit <https://pre-commit.com/>`_ hooks for
identifying simple issues such as missing semicolons, trailing whitespace or misspellings
before submission to git. The `pre-commit <https://pre-commit.com/>`_ hooks are run
before each commit and your commit can fail accordingly.

When a new hook is added, It's usually a good idea to run the hooks before new commit is added.
Python offers a framework to run and apply the commit-hooks manually to your code.
After cloning the |itom| repositories (`itomProject <https://github.com/itom-project/itomProject>`_ or
`itom <https://github.com/itom-project/itom>`_, `plugins <https://github.com/itom-project/plugins>`_,
`designerPlugins <https://github.com/itom-project/designerPlugins>`_) hooks must be install e.g. using pip.

.. code-block:: bash
pip install pre_commit
python -m pip install pre_commit
Then, got to the main folder of the respective itom repository (e.g. itomProject, itom, plugins or designerplugins), which includes the ``pre-commit`` configuration
file **.pre-commit-config.yaml** and run.:
Git hooks must be installed into the ``.git`` folder of each repo.

.. code-block:: bash
pre_commit run --all-files
python -m pre_commit install
Pre_commits can be executed manually:

.. code-block:: bash
python -m pre_commit run --all-files
A practical tip is to also run pre_commits manually to reduce frustration when you want or need to create a commit.
Failed hooks ensure that a commit cannot be set.

To execute specific hooks, their names can be passed as an additional argument (e.g. codespell).

.. code-block:: bash
python -m pre_commit run --all-files codespell
31 changes: 0 additions & 31 deletions gtest-1.10.0/CMakeLists.txt

This file was deleted.

134 changes: 0 additions & 134 deletions gtest-1.10.0/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions gtest-1.10.0/googletest/LICENSE

This file was deleted.

Loading

0 comments on commit 253cd24

Please sign in to comment.