changeset 5132:482f3e80ed0a

cppcheck
author Alain Mazy <am@osimis.io>
date Thu, 05 Jan 2023 18:03:25 +0100
parents e107ff622e6d
children 7dacd2c3c009
files OrthancFramework/Sources/DicomParsing/DicomModification.cpp OrthancServer/Resources/RunCppCheck.sh
diffstat 2 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Thu Jan 05 17:25:21 2023 +0100
+++ b/OrthancFramework/Sources/DicomParsing/DicomModification.cpp	Thu Jan 05 18:03:25 2023 +0100
@@ -929,10 +929,9 @@
       throw OrthancException(ErrorCode_BadRequest);
     }
     
-
-    // Sanity checks at the patient level
     if (!allowManualIdentifiers_)
     {
+       // Sanity checks at the patient level
       if (level_ == ResourceType_Patient && IsReplaced(DICOM_TAG_STUDY_INSTANCE_UID))
       {
         throw OrthancException(ErrorCode_BadRequest,
@@ -950,12 +949,8 @@
         throw OrthancException(ErrorCode_BadRequest,
                                "When modifying a patient, the SopInstanceUID cannot be manually modified");
       }
-    }
 
-
-    // Sanity checks at the study level
-    if (!allowManualIdentifiers_)
-    {
+      // Sanity checks at the study level
       if (level_ == ResourceType_Study && IsReplaced(DICOM_TAG_SERIES_INSTANCE_UID))
       {
         throw OrthancException(ErrorCode_BadRequest,
@@ -967,12 +962,8 @@
         throw OrthancException(ErrorCode_BadRequest,
                                "When modifying a study, the SopInstanceUID cannot be manually modified");
       }
-    }
 
-
-    // Sanity checks at the series level
-    if (!allowManualIdentifiers_)
-    {
+      // Sanity checks at the series level
       if (level_ == ResourceType_Series && IsReplaced(DICOM_TAG_SOP_INSTANCE_UID))
       {
         throw OrthancException(ErrorCode_BadRequest,
--- a/OrthancServer/Resources/RunCppCheck.sh	Thu Jan 05 17:25:21 2023 +0100
+++ b/OrthancServer/Resources/RunCppCheck.sh	Thu Jan 05 18:03:25 2023 +0100
@@ -26,7 +26,7 @@
 syntaxError:../../OrthancServer/UnitTestsSources/UnitTestsMain.cpp:310
 uninitMemberVar:../../OrthancServer/Sources/ServerJobs/StorageCommitmentScpJob.cpp:416
 unreadVariable:../../OrthancFramework/Sources/FileStorage/StorageAccessor.cpp
-unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1115
+unreadVariable:../../OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp:1118
 unusedFunction
 useInitializationList:../../OrthancFramework/Sources/Images/PngReader.cpp:90
 useInitializationList:../../OrthancFramework/Sources/Images/PngWriter.cpp:98