changeset 6403:18a70fb61b91

cppcheck: passedByValue, constParameterPointer, constVariablePointer
author Alain Mazy <am@orthanc.team>
date Thu, 13 Nov 2025 06:10:43 +0100
parents 55db426a8667
children 3da6afe03965
files OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp OrthancFramework/Sources/Images/ImageProcessing.cpp OrthancServer/Plugins/Engine/OrthancPlugins.cpp OrthancServer/Resources/RunCppCheck.sh
diffstat 5 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Wed Nov 12 18:02:18 2025 +0100
+++ b/OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp	Thu Nov 13 06:10:43 2025 +0100
@@ -141,7 +141,7 @@
   T_ASC_SC_ROLE acceptedRole)
 {
   int n, i, k;
-  DUL_PRESENTATIONCONTEXT *dpc;
+  const DUL_PRESENTATIONCONTEXT *dpc;
   T_ASC_PresentationContext pc;
 
   n = ASC_countPresentationContexts(params);
--- a/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Wed Nov 12 18:02:18 2025 +0100
+++ b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp	Thu Nov 13 06:10:43 2025 +0100
@@ -275,10 +275,10 @@
       else if (DecodePsmctRle1(psmct_, dataset))
       {
         LOG(INFO) << "The PMSCT_RLE1 decoding has succeeded";
-        Uint8* pixData = NULL;
+        const Uint8* pixData = NULL;
         if (psmct_.size() > 0)
         {
-          pixData = reinterpret_cast<Uint8*>(&psmct_[0]);
+          pixData = reinterpret_cast<const Uint8*>(&psmct_[0]);
         }
 
         slowAccessor_.reset(new DicomIntegerPixelAccessor(m, pixData, psmct_.size()));
--- a/OrthancFramework/Sources/Images/ImageProcessing.cpp	Wed Nov 12 18:02:18 2025 +0100
+++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp	Thu Nov 13 06:10:43 2025 +0100
@@ -1224,7 +1224,7 @@
     for (unsigned int y = 0; y < height; y++)
     {
       uint8_t* q = reinterpret_cast<uint8_t*>(image.GetRow(y));
-      uint8_t* a = reinterpret_cast<uint8_t*>(alpha.GetRow(y));
+      const uint8_t* a = reinterpret_cast<uint8_t*>(alpha.GetRow(y));
 
       for (unsigned int x = 0; x < width; x++)
       {
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Wed Nov 12 18:02:18 2025 +0100
+++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Thu Nov 13 06:10:43 2025 +0100
@@ -2547,7 +2547,7 @@
   }
 
 
-  static std::string GetAllowedMethods(_OrthancPluginChunkedRestCallback parameters)
+  static std::string GetAllowedMethods(const _OrthancPluginChunkedRestCallback& parameters)
   {
     std::string s;
 
--- a/OrthancServer/Resources/RunCppCheck.sh	Wed Nov 12 18:02:18 2025 +0100
+++ b/OrthancServer/Resources/RunCppCheck.sh	Thu Nov 13 06:10:43 2025 +0100
@@ -66,6 +66,7 @@
 throwInNoexceptFunction:../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.h:496
 rethrowNoCurrentException:../../OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp
 rethrowNoCurrentException:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp
+constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3046
 EOF
 
 # TODO: re-enable nullPointerOutOfMemory