# HG changeset patch # User Sebastien Jodogne # Date 1720790246 -7200 # Node ID 359a8adb38029207ae6d8fb218ceb71f0603716d # Parent 388aef262b1ba0cff6c695044204b01d705bc28a cppcheck diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Resources/RunCppCheck.sh Fri Jul 12 15:17:26 2024 +0200 @@ -17,7 +17,7 @@ stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74 stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:374 -stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:378 +stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:480 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:41 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:191 stlFindInsert:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:361 @@ -34,8 +34,8 @@ useInitializationList:../../OrthancServer/Sources/ServerJobs/DicomModalityStoreJob.cpp:275 assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:277 assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1026 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:290 -assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:389 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 +assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3663 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:286 assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:454 diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/Database/FindResponse.cpp --- a/OrthancServer/Sources/Database/FindResponse.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/Database/FindResponse.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -600,7 +600,7 @@ DebugDicomMap(target[level]["MainDicomTags"], m); } - if (request.GetParentSpecification(levels[i]).IsRetrieveMainDicomTags()) + if (request.GetParentSpecification(levels[i]).IsRetrieveMetadata()) { DebugMetadata(target[level]["Metadata"], GetMetadata(levels[i])); } diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/Database/OrthancIdentifiers.cpp --- a/OrthancServer/Sources/Database/OrthancIdentifiers.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/Database/OrthancIdentifiers.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -194,7 +194,7 @@ void OrthancIdentifiers::SetLevel(ResourceType level, - const std::string id) + const std::string& id) { switch (level) { diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/Database/OrthancIdentifiers.h --- a/OrthancServer/Sources/Database/OrthancIdentifiers.h Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/Database/OrthancIdentifiers.h Fri Jul 12 15:17:26 2024 +0200 @@ -86,7 +86,7 @@ ResourceType DetectLevel() const; void SetLevel(ResourceType level, - const std::string id); + const std::string& id); std::string GetLevel(ResourceType level) const; }; diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/OrthancFindRequestHandler.cpp --- a/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/OrthancFindRequestHandler.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -392,7 +392,6 @@ } else { - const DicomTag& tag = queryAsArray_.GetElement(i).GetTag(); const DicomValue* value = resourceTags.TestAndGetValue(tag); if (value == NULL || diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/OrthancWebDav.cpp --- a/OrthancServer/Sources/OrthancWebDav.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/OrthancWebDav.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -186,7 +186,7 @@ Collection& target_; public: - DicomIdentifiersVisitorV2(Collection& target) : + explicit DicomIdentifiersVisitorV2(Collection& target) : isComplete_(false), target_(target) { diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/ResourceFinder.cpp --- a/OrthancServer/Sources/ResourceFinder.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/ResourceFinder.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -301,11 +301,11 @@ static const char* const INDEX_IN_SERIES = "IndexInSeries"; std::string s; - uint32_t index; + uint32_t indexInSeries; if (resource.LookupMetadata(s, ResourceType_Instance, MetadataType_Instance_IndexInSeries) && - SerializationToolbox::ParseUnsignedInteger32(index, s)) + SerializationToolbox::ParseUnsignedInteger32(indexInSeries, s)) { - target[INDEX_IN_SERIES] = index; + target[INDEX_IN_SERIES] = indexInSeries; } else { diff -r 388aef262b1b -r 359a8adb3802 OrthancServer/Sources/Search/DatabaseConstraint.cpp --- a/OrthancServer/Sources/Search/DatabaseConstraint.cpp Fri Jul 12 15:08:43 2024 +0200 +++ b/OrthancServer/Sources/Search/DatabaseConstraint.cpp Fri Jul 12 15:17:26 2024 +0200 @@ -320,7 +320,7 @@ { s += " in [ "; bool first = true; - for (size_t i = 0; i < constraint.GetValuesCount(); i++) + for (size_t j = 0; j < constraint.GetValuesCount(); j++) { if (first) { @@ -330,7 +330,7 @@ { s += ", "; } - s += constraint.GetValue(i); + s += constraint.GetValue(j); } s += "]"; break;