Mercurial > hg > orthanc
changeset 5050:ea9e2680da6f
CPP check and cleanup
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 30 Jun 2022 07:15:37 +0200 |
parents | 8c9a1cce076e |
children | eb657d880427 e2dece12f444 |
files | OrthancFramework/Sources/DicomFormat/DicomMap.cpp OrthancFramework/Sources/DicomFormat/DicomValue.h OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp OrthancServer/Resources/RunCppCheck.sh |
diffstat | 4 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Wed Jun 29 15:32:44 2022 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomMap.cpp Thu Jun 30 07:15:37 2022 +0200 @@ -1380,7 +1380,6 @@ { if (value["Value"].type() != Json::arrayValue) { - printf("%s", dicomAsJson.toStyledString().c_str()); throw OrthancException(ErrorCode_CorruptedFile); } else
--- a/OrthancFramework/Sources/DicomFormat/DicomValue.h Wed Jun 29 15:32:44 2022 +0200 +++ b/OrthancFramework/Sources/DicomFormat/DicomValue.h Thu Jun 30 07:15:37 2022 +0200 @@ -63,7 +63,7 @@ size_t size, bool isBinary); - DicomValue(const Json::Value& value); + explicit DicomValue(const Json::Value& value); const std::string& GetContent() const;
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Wed Jun 29 15:32:44 2022 +0200 +++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp Thu Jun 30 07:15:37 2022 +0200 @@ -571,9 +571,9 @@ if (sequence) { Json::Value jsonSequence = Json::arrayValue; - for (unsigned long i = 0; i < sequence->card(); i++) + for (unsigned long s = 0; s < sequence->card(); s++) { - DcmItem* child = sequence->getItem(i); + DcmItem* child = sequence->getItem(s); Json::Value& v = jsonSequence.append(Json::objectValue); DatasetToJson(v, *child, DicomToJsonFormat_Full, DicomToJsonFlags_Default, maxStringLength, encoding, hasCodeExtensions,
--- a/OrthancServer/Resources/RunCppCheck.sh Wed Jun 29 15:32:44 2022 +0200 +++ b/OrthancServer/Resources/RunCppCheck.sh Thu Jun 30 07:15:37 2022 +0200 @@ -13,10 +13,10 @@ knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:322 -stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1387 +stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1403 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:165 stlFindInsert:../../OrthancFramework/Sources/RestApi/RestApiCallDocumentation.cpp:73 -stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:431 +stlFindInsert:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:372 stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:377 stlFindInsert:../../OrthancServer/Sources/ServerJobs/MergeStudyJob.cpp:40 stlFindInsert:../../OrthancServer/Sources/ServerJobs/SplitStudyJob.cpp:190 @@ -35,7 +35,7 @@ assertWithSideEffect:../../OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp:1018 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:289 assertWithSideEffect:../../OrthancServer/Sources/Database/Compatibility/DatabaseLookup.cpp:388 -assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3492 +assertWithSideEffect:../../OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp:3460 assertWithSideEffect:../../OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp:241 EOF