# HG changeset patch # User Sebastien Jodogne # Date 1650900778 -7200 # Node ID d0c34145320c0ddc9bba86735fefcfd5039d8a8e # Parent 8b95fc86b8d9f2bda584d8c9651fc78db4cf68f6 cppcheck diff -r 8b95fc86b8d9 -r d0c34145320c OrthancFramework/Sources/DicomFormat/DicomMap.cpp --- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Mon Apr 25 17:32:58 2022 +0200 @@ -204,7 +204,7 @@ { // std::set are sorted by default (which is important for us !) std::set tagsIds; - for (std::set::const_iterator it = tags.begin(); it != tags.end(); it++) + for (std::set::const_iterator it = tags.begin(); it != tags.end(); ++it) { tagsIds.insert(it->Format()); } @@ -411,7 +411,7 @@ result.Clear(); for (std::map::const_iterator itmt = mainDicomTags.begin(); - itmt != mainDicomTags.end(); itmt++) + itmt != mainDicomTags.end(); ++itmt) { DicomMap::Content::const_iterator it = source.find(itmt->first); if (it != source.end()) @@ -426,7 +426,7 @@ result.Clear(); for (std::set::const_iterator itmt = tags.begin(); - itmt != tags.end(); itmt++) + itmt != tags.end(); ++itmt) { DicomMap::Content::const_iterator it = content_.find(*itmt); if (it != content_.end()) @@ -550,7 +550,7 @@ result.Clear(); for (std::map::const_iterator itmt = mainDicomTags.begin(); - itmt != mainDicomTags.end(); itmt++) + itmt != mainDicomTags.end(); ++itmt) { result.SetValue(itmt->first, "", false); } @@ -1415,7 +1415,7 @@ const std::map& mainDicomTags = DicomMap::MainDicomTagsConfiguration::GetInstance().GetMainDicomTags(level); for (std::map::const_iterator itmt = mainDicomTags.begin(); - itmt != mainDicomTags.end(); itmt++) + itmt != mainDicomTags.end(); ++itmt) { Content::const_iterator found = other.content_.find(itmt->first); diff -r 8b95fc86b8d9 -r d0c34145320c OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp --- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Mon Apr 25 17:32:58 2022 +0200 @@ -1315,7 +1315,7 @@ { std::set values; for (std::set::const_iterator it = tags.begin(); - it != tags.end(); it++) + it != tags.end(); ++it) { values.insert(it->Format()); } @@ -1327,7 +1327,7 @@ { output = Json::arrayValue; for (std::set::const_iterator it = tags.begin(); - it != tags.end(); it++) + it != tags.end(); ++it) { output.append(it->Format()); } @@ -1342,7 +1342,7 @@ Toolbox::TokenizeString(tokens, source, ';'); for (std::vector::const_iterator it = tokens.begin(); - it != tokens.end(); it++) + it != tokens.end(); ++it) { if (it->size() > 0) { diff -r 8b95fc86b8d9 -r d0c34145320c OrthancFramework/Sources/Toolbox.h --- a/OrthancFramework/Sources/Toolbox.h Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancFramework/Sources/Toolbox.h Mon Apr 25 17:32:58 2022 +0200 @@ -197,7 +197,7 @@ template static bool IsSetInSet(const std::set& needles, const std::set& haystack) { for (typename std::set::const_iterator it = needles.begin(); - it != needles.end(); it++) + it != needles.end(); ++it) { if (haystack.count(*it) == 0) { @@ -214,7 +214,7 @@ missings.clear(); for (typename std::set::const_iterator it = needles.begin(); - it != needles.end(); it++) + it != needles.end(); ++it) { if (haystack.count(*it) == 0) { @@ -228,7 +228,7 @@ template static void AppendSets(std::set& target, const std::set& toAppend) { for (typename std::set::const_iterator it = toAppend.begin(); - it != toAppend.end(); it++) + it != toAppend.end(); ++it) { target.insert(*it); } @@ -237,7 +237,7 @@ template static void RemoveSets(std::set& target, const std::set& toRemove) { for (typename std::set::const_iterator it = toRemove.begin(); - it != toRemove.end(); it++) + it != toRemove.end(); ++it) { target.erase(*it); } diff -r 8b95fc86b8d9 -r d0c34145320c OrthancServer/CMakeLists.txt --- a/OrthancServer/CMakeLists.txt Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancServer/CMakeLists.txt Mon Apr 25 17:32:58 2022 +0200 @@ -316,7 +316,7 @@ -DHAS_ORTHANC_EXCEPTION=0 -DMODALITY_WORKLISTS_VERSION="${ORTHANC_VERSION}" -DSERVE_FOLDERS_VERSION="${ORTHANC_VERSION}" - -DDB_OPTIMIZER_VERSION="${ORTHANC_VERSION}" + -DHOUSEKEEPER_VERSION="${ORTHANC_VERSION}" ) @@ -429,7 +429,7 @@ ##################################################################### if (ENABLE_PLUGINS AND - (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_DB_OPTIMIZER)) + (BUILD_SERVE_FOLDERS OR BUILD_MODALITY_WORKLISTS OR BUILD_HOUSEKEEPER)) add_library(ThirdPartyPlugins STATIC ${BOOST_SOURCES} ${JSONCPP_SOURCES} @@ -610,43 +610,43 @@ ## Build the "Housekeeper" plugin ##################################################################### -if (ENABLE_PLUGINS AND BUILD_DB_OPTIMIZER) -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") -execute_process( - COMMAND - ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py - ${ORTHANC_VERSION} Housekeeper Housekeeper.dll "Sample Orthanc plugin to optimize/clean the DB/Storage" - ERROR_VARIABLE Failure - OUTPUT_FILE ${AUTOGENERATED_DIR}/Housekeeper.rc - ) - -if (Failure) - message(FATAL_ERROR "Error while computing the version information: ${Failure}") -endif() - -list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) -endif() - -add_library(Housekeeper SHARED -${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp -${HOUSEKEEPER_RESOURCES} -) - -target_link_libraries(Housekeeper - ThirdPartyPlugins - ) - -set_target_properties( - Housekeeper PROPERTIES -VERSION ${ORTHANC_VERSION} -SOVERSION ${ORTHANC_VERSION} -) - -install( -TARGETS Housekeeper -RUNTIME DESTINATION lib # Destination for Windows -LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux -) +if (ENABLE_PLUGINS AND BUILD_HOUSEKEEPER) + if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + execute_process( + COMMAND + ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../OrthancFramework/Resources/WindowsResources.py + ${ORTHANC_VERSION} Housekeeper Housekeeper.dll "Sample Orthanc plugin to optimize/clean the DB/Storage" + ERROR_VARIABLE Failure + OUTPUT_FILE ${AUTOGENERATED_DIR}/Housekeeper.rc + ) + + if (Failure) + message(FATAL_ERROR "Error while computing the version information: ${Failure}") + endif() + + list(APPEND HOUSEKEEPER_RESOURCES ${AUTOGENERATED_DIR}/Housekeeper.rc) + endif() + + add_library(Housekeeper SHARED + ${CMAKE_SOURCE_DIR}/Plugins/Samples/Housekeeper/Plugin.cpp + ${HOUSEKEEPER_RESOURCES} + ) + + target_link_libraries(Housekeeper + ThirdPartyPlugins + ) + + set_target_properties( + Housekeeper PROPERTIES + VERSION ${ORTHANC_VERSION} + SOVERSION ${ORTHANC_VERSION} + ) + + install( + TARGETS Housekeeper + RUNTIME DESTINATION lib # Destination for Windows + LIBRARY DESTINATION share/orthanc/plugins # Destination for Linux + ) endif() diff -r 8b95fc86b8d9 -r d0c34145320c OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp --- a/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Mon Apr 25 17:32:58 2022 +0200 @@ -674,6 +674,6 @@ ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion() { - return DB_OPTIMIZER_VERSION; + return HOUSEKEEPER_VERSION; } } diff -r 8b95fc86b8d9 -r d0c34145320c OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancServer/Resources/RunCppCheck.sh Mon Apr 25 17:32:58 2022 +0200 @@ -13,15 +13,15 @@ knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 -nullPointerRedundantCheck:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp -stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1195 +stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1406 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:165 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:73 -stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:373 -stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:375 +stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:372 +stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:377 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:40 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:190 syntaxError:../../OrthancFramework/Sources/SQLite/FunctionContext.h:52 +syntaxError:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp:72 syntaxError:../../OrthancFramework/UnitTestsSources/ZipTests.cpp:132 syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:310 uninitMemberVar:../../OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp:416 diff -r 8b95fc86b8d9 -r d0c34145320c OrthancServer/Sources/Search/DatabaseLookup.cpp --- a/OrthancServer/Sources/Search/DatabaseLookup.cpp Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancServer/Sources/Search/DatabaseLookup.cpp Mon Apr 25 17:32:58 2022 +0200 @@ -334,7 +334,7 @@ assert(constraints_[i] != NULL); if (constraints_[i]->GetTag() == tag) { - constraint = constraints_.at(i); + constraint = constraints_[i]; return true; } } diff -r 8b95fc86b8d9 -r d0c34145320c OrthancServer/Sources/ServerContext.cpp --- a/OrthancServer/Sources/ServerContext.cpp Mon Apr 25 15:50:57 2022 +0200 +++ b/OrthancServer/Sources/ServerContext.cpp Mon Apr 25 17:32:58 2022 +0200 @@ -2392,7 +2392,7 @@ { std::set missingTags; Toolbox::AppendSets(missingTags, resource.missingRequestedTags_); - for (std::set::const_iterator it = resource.missingRequestedTags_.begin(); it != resource.missingRequestedTags_.end(); it++) + for (std::set::const_iterator it = resource.missingRequestedTags_.begin(); it != resource.missingRequestedTags_.end(); ++it) { if (DicomMap::IsComputedTag(*it)) {