# HG changeset patch # User Sebastien Jodogne # Date 1733231537 -3600 # Node ID 2fc5667633e617505be18e3a3a18ecb63bba6943 # Parent 9b039f4b1421fa28bab8757dfb5cddfc43f22321 cppcheck diff -r 9b039f4b1421 -r 2fc5667633e6 OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp --- a/OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp Tue Dec 03 13:52:04 2024 +0100 +++ b/OrthancFramework/Sources/FileStorage/FilesystemStorage.cpp Tue Dec 03 14:12:17 2024 +0100 @@ -176,11 +176,11 @@ LOG(INFO) << "Created attachment \"" << uuid << "\" (" << timer.GetHumanTransferSpeed(true, size) << ")"; return; } - catch (OrthancException& ex) + catch (OrthancException& e) { if (retryCount >= maxRetryCount) { - throw ex; + throw; } } } diff -r 9b039f4b1421 -r 2fc5667633e6 OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp --- a/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Tue Dec 03 13:52:04 2024 +0100 +++ b/OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp Tue Dec 03 14:12:17 2024 +0100 @@ -1670,9 +1670,9 @@ target->SetParentIdentifier(source.parent_public_id()); } - for (int i = 0; i < source.labels().size(); i++) + for (int j = 0; j < source.labels().size(); j++) { - target->AddLabel(source.labels(i)); + target->AddLabel(source.labels(j)); } if (source.attachments().size() != source.attachments_revisions().size()) @@ -1680,9 +1680,9 @@ throw OrthancException(ErrorCode_DatabasePlugin); } - for (int i = 0; i < source.attachments().size(); i++) + for (int j = 0; j < source.attachments().size(); j++) { - target->AddAttachment(Convert(source.attachments(i)), source.attachments_revisions(i)); + target->AddAttachment(Convert(source.attachments(j)), source.attachments_revisions(j)); } Convert(*target, ResourceType_Patient, source.patient_content()); @@ -1727,12 +1727,12 @@ request.IsRetrieveOneInstanceMetadataAndAttachments()) { std::map metadata; - for (int i = 0; i < source.one_instance_metadata().size(); i++) + for (int j = 0; j < source.one_instance_metadata().size(); j++) { - MetadataType key = static_cast(source.one_instance_metadata(i).key()); + MetadataType key = static_cast(source.one_instance_metadata(j).key()); if (metadata.find(key) == metadata.end()) { - metadata[key] = source.one_instance_metadata(i).value(); + metadata[key] = source.one_instance_metadata(j).value(); } else { @@ -1742,9 +1742,9 @@ std::map attachments; - for (int i = 0; i < source.one_instance_attachments().size(); i++) + for (int j = 0; j < source.one_instance_attachments().size(); j++) { - FileInfo info(Convert(source.one_instance_attachments(i))); + FileInfo info(Convert(source.one_instance_attachments(j))); if (attachments.find(info.GetContentType()) == attachments.end()) { attachments[info.GetContentType()] = info; diff -r 9b039f4b1421 -r 2fc5667633e6 OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Tue Dec 03 13:52:04 2024 +0100 +++ b/OrthancServer/Resources/RunCppCheck.sh Tue Dec 03 14:12:17 2024 +0100 @@ -12,12 +12,12 @@ constParameter:../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp -nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:316 -stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1477 +nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:321 +stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1510 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:166 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:74 stlFindInsert:../../OrthancServer/Sources/Database/MainDicomTagsRegistry.cpp:65 -stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:480 +stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:328 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:41 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:191 stlFindInsert:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:361 @@ -36,7 +36,7 @@ assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1026 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:292 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:391 -assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3527 +assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3058 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:286 assertWithSideEffect:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:454 EOF diff -r 9b039f4b1421 -r 2fc5667633e6 OrthancServer/Sources/Database/FindResponse.h --- a/OrthancServer/Sources/Database/FindResponse.h Tue Dec 03 13:52:04 2024 +0100 +++ b/OrthancServer/Sources/Database/FindResponse.h Tue Dec 03 14:12:17 2024 +0100 @@ -141,7 +141,7 @@ { } - MetadataContent(const std::string& value) : + explicit MetadataContent(const std::string& value) : value_(value), revision_(0) { diff -r 9b039f4b1421 -r 2fc5667633e6 OrthancServer/Sources/ServerEnumerations.h --- a/OrthancServer/Sources/ServerEnumerations.h Tue Dec 03 13:52:04 2024 +0100 +++ b/OrthancServer/Sources/ServerEnumerations.h Tue Dec 03 14:12:17 2024 +0100 @@ -137,7 +137,7 @@ ResponseContentFlags_Labels = (1 << 11), ResponseContentFlags_IsStable = (1 << 12), - ResponseContentFlags_INTERNAL_CountResources = (1 << 31), + ResponseContentFlags_INTERNAL_CountResources = (1 << 30), // Some predefined combinations ResponseContentFlags_ExpandTrue = (ResponseContentFlags_ID |