changeset 5158:02cfd23a556a

CppCheck
author Alain Mazy <am@osimis.io>
date Thu, 02 Feb 2023 10:33:15 +0100
parents 874e6b135614
children f5907aecbaed
files OrthancFramework/Sources/DicomParsing/DicomModification.cpp OrthancServer/Resources/ImplementationNotes/memory_consumption.txt OrthancServer/Resources/RunCppCheck.sh OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp OrthancServer/Sources/ServerJobs/ResourceModificationJob.h
diffstat 5 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Thu Feb 02 09:40:48 2023 +0100
+++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Thu Feb 02 10:33:15 2023 +0100
@@ -1842,7 +1842,7 @@
   void DicomModification::GetReplacedTags(std::set<DicomTag>& target) const
   {
     target.clear();
-    for (Replacements::const_iterator it = replacements_.begin(); it != replacements_.end(); it++)
+    for (Replacements::const_iterator it = replacements_.begin(); it != replacements_.end(); ++it)
     {
       target.insert(it->first);
     }
--- a/OrthancServer/Resources/ImplementationNotes/memory_consumption.txt	Thu Feb 02 09:40:48 2023 +0100
+++ b/OrthancServer/Resources/ImplementationNotes/memory_consumption.txt	Thu Feb 02 10:33:15 2023 +0100
@@ -58,7 +58,7 @@
 
 In this test, we have measured the time required to anonymize a 2000 instances study
 with various configurations.  It appears that malloc_trim or the total amount
-of memory available in the system has no significant impact of performance.
+of memory available in the system has no significant impact on performance.
 
 - No malloc trim, 300 MB in the system:       ~ 38s
 - No malloc trim, 1500 MB in the system:      ~ 38s
--- a/OrthancServer/Resources/RunCppCheck.sh	Thu Feb 02 09:40:48 2023 +0100
+++ b/OrthancServer/Resources/RunCppCheck.sh	Thu Feb 02 10:33:15 2023 +0100
@@ -20,6 +20,7 @@
 stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:377
 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:40
 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:190
+stlFindInsert:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:334
 syntaxError:../../OrthancFramework/Sources/SQLite/FunctionContext.h:52
 syntaxError:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp:72
 syntaxError:../../OrthancFramework/UnitTestsSources/ZipTests.cpp:132
@@ -36,7 +37,7 @@
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:289
 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:388
 assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3490
-assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:241
+assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:272
 EOF
 
 ${CPPCHECK} --enable=all --quiet --std=c++11 \
--- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp	Thu Feb 02 09:40:48 2023 +0100
+++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp	Thu Feb 02 10:33:15 2023 +0100
@@ -665,20 +665,14 @@
     }
 
     bool replacePatientMainDicomTags = false;
-    bool replaceStudyMainDicomTags = false;
-    bool replaceSeriesMainDicomTags = false;
-    bool replaceInstanceMainDicomTags = false;
 
     ResourceType modificationLevel = modification_->GetLevel();
     std::set<DicomTag> replacedTags;
     modification_->GetReplacedTags(replacedTags);
 
-    for (std::set<DicomTag>::const_iterator it = replacedTags.begin(); it != replacedTags.end(); it++)
+    for (std::set<DicomTag>::const_iterator it = replacedTags.begin(); it != replacedTags.end(); ++it)
     {
       replacePatientMainDicomTags |= DicomMap::IsMainDicomTag(*it, ResourceType_Patient);
-      replaceStudyMainDicomTags |= DicomMap::IsMainDicomTag(*it, ResourceType_Study);
-      replaceSeriesMainDicomTags |= DicomMap::IsMainDicomTag(*it, ResourceType_Series);
-      replaceInstanceMainDicomTags |= DicomMap::IsMainDicomTag(*it, ResourceType_Instance);
     }
 
     if ((modificationLevel == ResourceType_Study || modificationLevel == ResourceType_Patient)
--- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.h	Thu Feb 02 09:40:48 2023 +0100
+++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.h	Thu Feb 02 10:33:15 2023 +0100
@@ -64,9 +64,9 @@
     std::set<std::string>               instancesToReconstruct_;  // for each new series generated, an instance id that we can use to reconstruct the hierarchy DB model
 
   protected:
-    virtual bool HandleInstance(const std::string& instance) ORTHANC_OVERRIDE; // from ThreadedSetOfInstancesJob
+    virtual bool HandleInstance(const std::string& instance) ORTHANC_OVERRIDE;
     
-    virtual void PostProcessInstances();
+    virtual void PostProcessInstances() ORTHANC_OVERRIDE;
 
   public:
     explicit ResourceModificationJob(ServerContext& context, unsigned int workersCount);