changeset 91:8fd5bf76bb8e

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 22 Dec 2016 20:18:34 +0100
parents bdc5cb0db9bf
children 4b0e0f7c9957
files Framework/DicomizerParameters.cpp Framework/Targets/FolderTarget.h Framework/Targets/OrthancTarget.h
diffstat 3 files changed, 20 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/DicomizerParameters.cpp	Thu Dec 22 09:03:36 2016 +0100
+++ b/Framework/DicomizerParameters.cpp	Thu Dec 22 20:18:34 2016 +0100
@@ -53,24 +53,26 @@
   }
 
 
-  DicomizerParameters::DicomizerParameters()
+  DicomizerParameters::DicomizerParameters() :
+    safetyCheck_(false),
+    repaintBackground_(false),
+    targetCompression_(ImageCompression_Jpeg),
+    hasTargetTileSize_(false),
+    targetTileWidth_(512),
+    targetTileHeight_(512),
+    maxDicomFileSize_(10 * 1024 * 1024),   // 10MB
+    reconstructPyramid_(false),
+    pyramidLevelsCount_(0),
+    pyramidLowerLevelsCount_(0),
+    smooth_(false),
+    jpegQuality_(90),
+    forceReencode_(false),
+    opticalPath_(OpticalPath_Brightfield)
   {
-    safetyCheck_ = false;
-    repaintBackground_ = false;
     backgroundColor_[0] = 255;
     backgroundColor_[1] = 255;
     backgroundColor_[2] = 255;
-    targetCompression_ = ImageCompression_Jpeg;
-    hasTargetTileSize_ = false;
     threadsCount_ = ChooseNumberOfThreads();
-    maxDicomFileSize_ = 10 * 1024 * 1024;   // 10MB
-    reconstructPyramid_ = false;
-    pyramidLevelsCount_ = 0;
-    pyramidLowerLevelsCount_ = 0;
-    smooth_ = false;
-    jpegQuality_ = 90;
-    forceReencode_ = false;
-    opticalPath_ = OpticalPath_Brightfield;
   }
 
 
@@ -146,7 +148,7 @@
 
   void DicomizerParameters::SetPyramidLevelsCount(unsigned int count)
   {
-    if (count <= 0)
+    if (count == 0)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }
@@ -195,7 +197,7 @@
 
   void DicomizerParameters::SetPyramidLowerLevelsCount(unsigned int count)
   {
-    if (count <= 0)
+    if (count == 0)
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }
--- a/Framework/Targets/FolderTarget.h	Thu Dec 22 09:03:36 2016 +0100
+++ b/Framework/Targets/FolderTarget.h	Thu Dec 22 20:18:34 2016 +0100
@@ -34,7 +34,7 @@
     std::string   pattern_;
 
   public:
-    FolderTarget(const std::string& pattern) : 
+    explicit FolderTarget(const std::string& pattern) : 
       count_(0),
       pattern_(pattern)
     {
--- a/Framework/Targets/OrthancTarget.h	Thu Dec 22 09:03:36 2016 +0100
+++ b/Framework/Targets/OrthancTarget.h	Thu Dec 22 20:18:34 2016 +0100
@@ -35,9 +35,9 @@
     bool  first_;
 
   public:
-    OrthancTarget(const Orthanc::WebServiceParameters& parameters);
+    explicit OrthancTarget(const Orthanc::WebServiceParameters& parameters);
 
-    OrthancTarget(OrthancPlugins::IOrthancConnection* orthanc) :   // Takes ownership
+    explicit OrthancTarget(OrthancPlugins::IOrthancConnection* orthanc) :   // Takes ownership
       orthanc_(orthanc),
       first_(true)
     {