changeset 4956:964bbf5cb365

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Mar 2022 11:48:47 +0100
parents 1610e56cadfb
children 94edc2c89768 924b15d983c7
files OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp OrthancServer/Plugins/Engine/OrthancPlugins.cpp
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Mar 23 11:44:40 2022 +0100
+++ b/OrthancFramework/Sources/DicomParsing/ParsedDicomFile.cpp	Wed Mar 23 11:48:47 2022 +0100
@@ -1962,7 +1962,7 @@
     Uint16 rows, columns, bitsAllocated, bitPosition;
     const Sint16* origin = NULL;
     unsigned long originSize = 0;
-    DcmElement* overlay = NULL;
+    DcmElement* overlayElement = NULL;
     Uint8* overlayData = NULL;
     
     if (dataset.findAndGetUint16(DcmTagKey(group, 0x0010), rows).good() &&
@@ -1974,9 +1974,9 @@
         bitsAllocated == 1 &&
         dataset.findAndGetUint16(DcmTagKey(group, 0x0102), bitPosition).good() &&
         bitPosition == 0 &&
-        dataset.findAndGetElement(DcmTagKey(group, 0x3000), overlay).good() &&
-        overlay != NULL &&
-        overlay->getUint8Array(overlayData).good() &&
+        dataset.findAndGetElement(DcmTagKey(group, 0x3000), overlayElement).good() &&
+        overlayElement != NULL &&
+        overlayElement->getUint8Array(overlayData).good() &&
         overlayData != NULL)
     {
       /**
@@ -1992,7 +1992,7 @@
        **/
 
       unsigned int expectedSize = Ceiling(rows * columns, 8);
-      if (overlay->getLengthField() < expectedSize)
+      if (overlayElement->getLengthField() < expectedSize)
       {
         throw OrthancException(ErrorCode_CorruptedFile, "Overlay doesn't have a valid number of bits");
       }
--- a/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Wed Mar 23 11:44:40 2022 +0100
+++ b/OrthancServer/Plugins/Engine/OrthancPlugins.cpp	Wed Mar 23 11:48:47 2022 +0100
@@ -95,7 +95,7 @@
       std::vector<const char*>  items_;
 
     public:
-      PathHelper(const std::vector<std::string>& path)
+      explicit PathHelper(const std::vector<std::string>& path)
       {
         items_.resize(path.size());
         for (size_t i = 0; i < path.size(); i++)