Mercurial > hg > orthanc
changeset 7208:77036da5716c default tip
cppcheck
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Mon, 09 Nov 2026 12:07:05 +0100 |
| parents | 2a6c2e36d464 |
| children | |
| files | OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.cpp OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.h OrthancServer/Resources/RunCppCheck-2.1.sh OrthancServer/Resources/RunCppCheck-2.17.0.sh OrthancServer/Resources/RunCppCheck-2.17.1.sh OrthancServer/Resources/RunCppCheck-2.20.0.sh OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp |
| diffstat | 8 files changed, 67 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.cpp Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.cpp Mon Nov 09 12:07:05 2026 +0100 @@ -111,6 +111,19 @@ } + PeriodicRunnableThread::~PeriodicRunnableThread() + { + try + { + StopInternal(false /* no exception in destructors */); + } + catch (...) + { + // This should never happen + } + } + + void PeriodicRunnableThread::SetTimeResolution(unsigned int resolution) { boost::mutex::scoped_lock lock(mutex_);
--- a/OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.h Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancFramework/Sources/MultiThreading/PeriodicRunnableThread.h Mon Nov 09 12:07:05 2026 +0100 @@ -57,10 +57,7 @@ PeriodicRunnableThread(IRunnable* runnable /* takes ownership */, unsigned int delay /* number of milliseconds between 2 executions */); - ~PeriodicRunnableThread() - { - StopInternal(false /* no exception in destructors */); - } + ~PeriodicRunnableThread(); /** * Set the granularity (in milliseconds) at which "Stop()" is
--- a/OrthancServer/Resources/RunCppCheck-2.1.sh Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Resources/RunCppCheck-2.1.sh Mon Nov 09 12:07:05 2026 +0100 @@ -10,17 +10,18 @@ fi cat <<EOF > /tmp/cppcheck-suppressions.txt -assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:460 +assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:470 assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1028 assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:279 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:389 assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3192 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:293 constParameter:../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 +passedByValue:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:127 stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1514 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74 @@ -34,10 +35,10 @@ syntaxError:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp:74 syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:345 unreadVariable:../../OrthancFramework/Sources/FileStorage/StorageAccessor.cpp -unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1174 +unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1179 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:95 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99 -useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:277 +useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:276 EOF CPPCHECK_BUILD_DIR=/tmp/cppcheck-build-dir-2.1/
--- a/OrthancServer/Resources/RunCppCheck-2.17.0.sh Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Resources/RunCppCheck-2.17.0.sh Mon Nov 09 12:07:05 2026 +0100 @@ -10,20 +10,20 @@ fi cat <<EOF > /tmp/cppcheck-suppressions.txt -assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:460 +assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:470 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:389 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:293 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp:50 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:112 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:113 constParameterCallback:../../OrthancFramework/Sources/Pkcs11.cpp:125 -constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3553 +constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3554 constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp:66 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:450 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:454 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:476 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:480 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3467 -knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:112 +knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:113 knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:444 knownConditionTrueFalse:../../OrthancFramework/Sources/Images/PamReader.cpp:204 knownConditionTrueFalse:../../OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp:336 @@ -38,6 +38,8 @@ knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2459 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2460 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:111 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:127 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74 stlFindInsert:../../OrthancServer/Sources/Database/ResourcesContent.h:141 @@ -47,7 +49,7 @@ syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:345 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:95 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99 -useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:277 +useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:276 variableScope:../../OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp:230 variableScope:../../OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp:98 EOF @@ -123,12 +125,29 @@ ../../OrthancServer/Plugins/Include \ ../../OrthancServer/Sources \ ../../OrthancServer/UnitTestsSources \ - ../../OrthancServer/Plugins/Samples/Common \ - ../../OrthancServer/Plugins/Samples/ConnectivityChecks \ - ../../OrthancServer/Plugins/Samples/DelayedDeletion \ - ../../OrthancServer/Plugins/Samples/Housekeeper \ - ../../OrthancServer/Plugins/Samples/ModalityWorklists \ - ../../OrthancServer/Plugins/Samples/MultitenantDicom \ - ../../OrthancServer/Plugins/Samples/AdoptDicomInstance \ + \ + ../../OrthancServer/Plugins/Samples/AdoptDicomInstance/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/AutomatedJpeg2kCompression/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp \ + ../../OrthancServer/Plugins/Samples/ConnectivityChecks/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/CppSkeleton/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/CustomImageDecoder/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp \ + ../../OrthancServer/Plugins/Samples/DelayedDeletion/PendingDeletionsDatabase.cpp \ + ../../OrthancServer/Plugins/Samples/DelayedDeletion/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/DicomFilter.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/FindRequestHandler.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/MoveRequestHandler.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/PluginToolbox.cpp \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom/StoreRequestHandler.cpp \ + ../../OrthancServer/Plugins/Samples/Sanitizer/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/StorageArea/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/StorageCommitmentScp/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/WebDavFilesystem/Plugin.cpp \ + ../../OrthancServer/Plugins/Samples/WebSkeleton/Framework/Plugin.cpp \ \ 2>&1
--- a/OrthancServer/Resources/RunCppCheck-2.17.1.sh Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Resources/RunCppCheck-2.17.1.sh Mon Nov 09 12:07:05 2026 +0100 @@ -11,18 +11,18 @@ cat <<EOF > /tmp/cppcheck-suppressions.txt assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:389 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:293 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/DicomStoreUserConnection.cpp:50 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:112 constParameterCallback:../../OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.cpp:113 constParameterCallback:../../OrthancFramework/Sources/Pkcs11.cpp:125 -constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3553 +constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3554 constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp:66 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:450 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:454 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:476 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:480 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3467 -knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:112 +knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:113 knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:444 knownConditionTrueFalse:../../OrthancFramework/Sources/Images/PamReader.cpp:204 knownConditionTrueFalse:../../OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp:336 @@ -37,6 +37,8 @@ knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2459 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2460 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:111 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:127 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74 stlFindInsert:../../OrthancServer/Sources/Database/ResourcesContent.h:141 @@ -46,7 +48,7 @@ syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:345 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:95 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99 -useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:277 +useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:276 variableScope:../../OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp:230 variableScope:../../OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp:98 EOF
--- a/OrthancServer/Resources/RunCppCheck-2.20.0.sh Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Resources/RunCppCheck-2.20.0.sh Mon Nov 09 12:07:05 2026 +0100 @@ -12,13 +12,15 @@ cat <<EOF > /tmp/cppcheck-suppressions.txt assertWithSideEffect:../../OrthancFramework/Sources/DataSource/DataSourceReader.cpp:356 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:389 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:293 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:450 -constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:454 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:476 +constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:480 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3467 missingInclude:../../OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp:41 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:111 +passedByValueCallback:../../OrthancFramework/Sources/JobsEngine/JobsEngine.cpp:127 sizeofCalculation:../../OrthancFramework/UnitTestsSources/ToolboxTests.cpp:517 sizeofCalculation:../../OrthancFramework/UnitTestsSources/ToolboxTests.cpp:518 sizeofCalculation:../../OrthancFramework/UnitTestsSources/ToolboxTests.cpp:519 @@ -33,7 +35,7 @@ syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:345 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:95 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99 -useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:277 +useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:276 variableScope:../../OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp:230 variableScope:../../OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp:98 EOF
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Mon Nov 09 12:07:05 2026 +0100 @@ -2531,8 +2531,6 @@ DicomAssociationParameters parameters(localAet, remote); InjectAssociationTimeout(parameters, json); - std::vector<std::string> a(sopClassUids.begin(), sopClassUids.end()); - std::vector<std::string> b(sopInstanceUids.begin(), sopInstanceUids.end()); DicomAssociation::RequestStorageCommitment(parameters, transactionUid, sopClassUids, sopInstanceUids); }
--- a/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp Mon Nov 09 10:48:21 2026 +0100 +++ b/OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp Mon Nov 09 12:07:05 2026 +0100 @@ -272,7 +272,7 @@ continue; // timeout, nothing to process yet } - SingleValueObject<std::string>* instanceId = dynamic_cast<SingleValueObject<std::string>*>(message.get()); + const SingleValueObject<std::string>* instanceId = dynamic_cast<const SingleValueObject<std::string>*>(message.get()); if (instanceId == NULL) { LOG(ERROR) << "Unexpected message type in the instances queue";
