# HG changeset patch # User Alain Mazy # Date 1762939578 -3600 # Node ID 32c736c4beb7e74e7863e94fc47d1f56c48e485c # Parent 0b94f843be89683d894d2d546c5f04dbcedcd244 cppcheck: knownConditionTrueFalse diff -r 0b94f843be89 -r 32c736c4beb7 OrthancFramework/Sources/Images/ImageProcessing.cpp --- a/OrthancFramework/Sources/Images/ImageProcessing.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancFramework/Sources/Images/ImageProcessing.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -2161,7 +2161,7 @@ PolygonEdge edge(v1, v2, GetPolygonNextY(points, i)); globalEdgeTable[v1.GetY()].push_back(edge); } - else if (v1.GetY() > v2.GetY()) + else { // Down-going edge PolygonEdge edge(v2, v1, yPrev); diff -r 0b94f843be89 -r 32c736c4beb7 OrthancFramework/Sources/Images/PngReader.cpp --- a/OrthancFramework/Sources/Images/PngReader.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancFramework/Sources/Images/PngReader.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -102,9 +102,9 @@ } endInfo_ = png_create_info_struct(png_); - if (!info_) + if (!endInfo_) { - png_destroy_read_struct(&png_, &info_, NULL); + png_destroy_read_struct(&png_, &endInfo_, NULL); throw OrthancException(ErrorCode_NotEnoughMemory); } } diff -r 0b94f843be89 -r 32c736c4beb7 OrthancFramework/Sources/Toolbox.cpp --- a/OrthancFramework/Sources/Toolbox.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancFramework/Sources/Toolbox.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -2935,17 +2935,10 @@ else if (ORTHANC_SCANF(version, "%4d", &a) == 1 && a >= 0) { - if (a >= 0) - { - major = static_cast(a); - minor = 0; - revision = 0; - return true; - } - else - { - return false; - } + major = static_cast(a); + minor = 0; + revision = 0; + return true; } else { diff -r 0b94f843be89 -r 32c736c4beb7 OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancServer/Resources/RunCppCheck.sh Wed Nov 12 10:26:18 2025 +0100 @@ -51,6 +51,10 @@ constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:447 constParameterPointer:../../OrthancFramework/Sources/Logging.cpp:451 constParameterPointer:../../OrthancFramework/Sources/Toolbox.cpp:3053 +knownConditionTrueFalse:../../OrthancFramework/Sources/DicomNetworking/Internals/CommandDispatcher.cpp:114 +knownConditionTrueFalse:../../OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp:425 +knownConditionTrueFalse:../../OrthancFramework/Sources/JobsEngine/Operations/SequenceOfOperationsJob.cpp:345 + EOF # TODO: re-enable nullPointerOutOfMemory diff -r 0b94f843be89 -r 32c736c4beb7 OrthancServer/Sources/Database/Compatibility/GenericFind.cpp --- a/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancServer/Sources/Database/Compatibility/GenericFind.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -187,7 +187,6 @@ request.GetOrthancIdentifiers(), ResourceType_Series, request.GetLevel()); } else if (request.GetMetadataConstraintsCount() == 0 && - request.GetOrdering().empty() && !request.GetOrthancIdentifiers().HasPatientId() && !request.GetOrthancIdentifiers().HasStudyId() && !request.GetOrthancIdentifiers().HasSeriesId() && diff -r 0b94f843be89 -r 32c736c4beb7 OrthancServer/Sources/ServerJobs/ArchiveJob.cpp --- a/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancServer/Sources/ServerJobs/ArchiveJob.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -813,16 +813,11 @@ writer.OpenFile(filename_.c_str()); - std::unique_ptr parsed; - writer.Write(content); if (dicomDir != NULL) { - if (parsed.get() == NULL) - { - parsed.reset(new ParsedDicomFile(content)); - } + std::unique_ptr parsed(new ParsedDicomFile(content)); dicomDir->Add(dicomDirFolder, filename_, *parsed); } diff -r 0b94f843be89 -r 32c736c4beb7 OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp --- a/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Mon Nov 10 18:44:19 2025 +0100 +++ b/OrthancServer/Sources/ServerJobs/ResourceModificationJob.cpp Wed Nov 12 10:26:18 2025 +0100 @@ -719,7 +719,7 @@ } // and we must make sure that we overwite them with the modified resources - if (IsKeepSource() && !GetContext().IsOverwriteInstances()) + if (!GetContext().IsOverwriteInstances()) { throw OrthancException(ErrorCode_BadRequest, "When keeping StudyInstanceUID, SeriesInstanceUID and SOPInstanceUID tag, you must have the 'OverwriteInstances' Orthanc configuration set to true in order to replace the modified resources");