changeset 6670:5aa6a0854de9

cppcheck
author Alain Mazy <am@orthanc.team>
date Fri, 03 Apr 2026 12:36:34 +0200
parents 906d50d05430
children a202510220c6
files OrthancFramework/Sources/Compression/GzipCompressor.cpp OrthancFramework/Sources/Compression/ZipReader.cpp OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp OrthancFramework/UnitTestsSources/JobsTests.cpp OrthancServer/Resources/RunCppCheck-2.17.1.sh OrthancServer/Sources/OutgoingDicomInstance.h OrthancServer/Sources/ServerJobs/ArchiveJob.cpp OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.h OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.h
diffstat 9 files changed, 22 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Compression/GzipCompressor.cpp	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancFramework/Sources/Compression/GzipCompressor.cpp	Fri Apr 03 12:36:34 2026 +0200
@@ -193,7 +193,7 @@
       z_stream&  stream_;
 
     public:
-      GzipRaii(z_stream& stream) :
+      explicit GzipRaii(z_stream& stream) :
         stream_(stream)
       {
         int error = inflateInit2(&stream_,
--- a/OrthancFramework/Sources/Compression/ZipReader.cpp	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancFramework/Sources/Compression/ZipReader.cpp	Fri Apr 03 12:36:34 2026 +0200
@@ -331,7 +331,7 @@
 
 
   static bool ReadInternal(std::string& content,
-                           unzFile& unzip,
+                           const unzFile& unzip,
                            uint64_t size) ORTHANC_NOEXCEPT
   {
 #if 0
--- a/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancFramework/Sources/JobsEngine/JobsRegistry.cpp	Fri Apr 03 12:36:34 2026 +0200
@@ -53,7 +53,7 @@
     JobsRegistry&  registry_;
 
   public:
-    LastModificationTimeUpdater(JobsRegistry& registry) :
+    explicit LastModificationTimeUpdater(JobsRegistry& registry) :
       registry_(registry)
     {
     }
--- a/OrthancFramework/UnitTestsSources/JobsTests.cpp	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancFramework/UnitTestsSources/JobsTests.cpp	Fri Apr 03 12:36:34 2026 +0200
@@ -255,7 +255,7 @@
       target_.insert(value);
     }
 
-    virtual ~DynamicInteger()
+    virtual ~DynamicInteger() ORTHANC_OVERRIDE
     {
       target_.erase(value_);
     }
--- a/OrthancServer/Resources/RunCppCheck-2.17.1.sh	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancServer/Resources/RunCppCheck-2.17.1.sh	Fri Apr 03 12:36:34 2026 +0200
@@ -12,33 +12,34 @@
 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/ServerJobs/ResourceModificationJob.cpp:286
+assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:287
 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:3503
-constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp:47
+constParameterCallback:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp:3545
+constParameterCallback:../../OrthancServer/Sources/OrthancGetRequestHandler.cpp:48
 constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:447
 constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:451
-constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3046
+constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3367
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:108
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:124
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:140
 cstyleCast:../../OrthancServer/Plugins/Engine/PluginsManager.cpp:85
 knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:114
-knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:425
+knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:435
 knownConditionTrueFalse:../../OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp:345
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2438
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2439
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2440
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2441
-knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2442
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2448
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2449
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2450
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2451
+knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2452
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2443
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2444
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2445
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2446
 knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp:2447
+knownConditionTrueFalse:../../OrthancFramework/Sources/Images/PamReader.cpp:204
 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166
 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74
@@ -50,7 +51,7 @@
 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:91
 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:99
 useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:275
-variableScope:../../OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp:228
+variableScope:../../OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp:229
 variableScope:../../OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.cpp:94
 EOF
 
@@ -100,6 +101,7 @@
             -DORTHANC_ENABLE_SQLITE=1 \
             -DORTHANC_ENABLE_SSL=1 \
             -DORTHANC_ENABLE_ZLIB=1 \
+            -DORTHANC_USE_SYSTEM_MINIZIP=0 \
             -DORTHANC_SANDBOXED=0 \
             -DORTHANC_SQLITE_VERSION=3027001 \
             -DORTHANC_UNIT_TESTS_LINK_FRAMEWORK=1 \
--- a/OrthancServer/Sources/OutgoingDicomInstance.h	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancServer/Sources/OutgoingDicomInstance.h	Fri Apr 03 12:36:34 2026 +0200
@@ -40,7 +40,7 @@
     DicomInstanceDestination            destination_;
     std::unique_ptr<ParsedDicomFile>    dicom_;
 
-    OutgoingDicomInstance(ParsedDicomFile* dicom) :
+    explicit OutgoingDicomInstance(ParsedDicomFile* dicom) :
       dicom_(dicom)
     {}
 
--- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp	Fri Apr 03 12:36:34 2026 +0200
@@ -525,7 +525,7 @@
         switch (type_)
         {
           case Type_OpenDirectory:
-            writer.OpenDirectory(filename_.c_str());
+            writer.OpenDirectory(filename_);
             break;
 
           case Type_CloseDirectory:
@@ -547,7 +547,7 @@
               return;
             }
 
-            writer.OpenFile(filename_.c_str());
+            writer.OpenFile(filename_);
 
             writer.Write(content);
 
--- a/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.h	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.h	Fri Apr 03 12:36:34 2026 +0200
@@ -92,7 +92,7 @@
       target = "DicomModalityStore";
     }
 
-    virtual const char* GetLoaderPrefix() const
+    virtual const char* GetLoaderPrefix() const ORTHANC_OVERRIDE
     {
       return "CSTO";
     }
--- a/OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.h	Fri Apr 03 12:20:59 2026 +0200
+++ b/OrthancServer/Sources/ServerJobs/OrthancPeerStoreJob.h	Fri Apr 03 12:36:34 2026 +0200
@@ -96,7 +96,7 @@
       target = "OrthancPeerStore";
     }
 
-    virtual const char* GetLoaderPrefix() const
+    virtual const char* GetLoaderPrefix() const ORTHANC_OVERRIDE
     {
       return "PSTO";
     }