changeset 2223:29689b30f9ae

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Dec 2016 15:28:05 +0100
parents 21713ce8717b
children 87c71bfb4e8a
files Core/DicomFormat/DicomArray.h Core/DicomFormat/DicomImageInformation.h Core/FileStorage/FilesystemStorage.h Core/HttpServer/FilesystemHttpSender.h Core/HttpServer/HttpStreamTranscoder.h Core/Images/JpegWriter.cpp Core/MultiThreading/BagOfTasksProcessor.h Core/MultiThreading/ReaderWriterLock.cpp Core/MultiThreading/RunnableWorkersPool.h Core/MultiThreading/Semaphore.h Core/OrthancException.h OrthancServer/Scheduler/ServerScheduler.cpp OrthancServer/Scheduler/ServerScheduler.h Plugins/Engine/SharedLibrary.h
diffstat 14 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomFormat/DicomArray.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/DicomFormat/DicomArray.h	Tue Dec 13 15:28:05 2016 +0100
@@ -47,7 +47,7 @@
     Elements  elements_;
 
   public:
-    DicomArray(const DicomMap& map);
+    explicit DicomArray(const DicomMap& map);
 
     ~DicomArray();
 
--- a/Core/DicomFormat/DicomImageInformation.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/DicomFormat/DicomImageInformation.h	Tue Dec 13 15:28:05 2016 +0100
@@ -57,7 +57,7 @@
     PhotometricInterpretation  photometric_;
 
   public:
-    DicomImageInformation(const DicomMap& values);
+    explicit DicomImageInformation(const DicomMap& values);
 
     unsigned int GetWidth() const
     {
--- a/Core/FileStorage/FilesystemStorage.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/FileStorage/FilesystemStorage.h	Tue Dec 13 15:28:05 2016 +0100
@@ -52,7 +52,7 @@
     boost::filesystem::path GetPath(const std::string& uuid) const;
 
   public:
-    FilesystemStorage(std::string root);
+    explicit FilesystemStorage(std::string root);
 
     virtual void Create(const std::string& uuid,
                         const void* content, 
--- a/Core/HttpServer/FilesystemHttpSender.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/HttpServer/FilesystemHttpSender.h	Tue Dec 13 15:28:05 2016 +0100
@@ -50,12 +50,12 @@
     void Initialize(const boost::filesystem::path& path);
 
   public:
-    FilesystemHttpSender(const std::string& path)
+    explicit FilesystemHttpSender(const std::string& path)
     {
       Initialize(path);
     }
 
-    FilesystemHttpSender(const boost::filesystem::path& path)
+    explicit FilesystemHttpSender(const boost::filesystem::path& path)
     {
       Initialize(path);
     }
--- a/Core/HttpServer/HttpStreamTranscoder.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/HttpServer/HttpStreamTranscoder.h	Tue Dec 13 15:28:05 2016 +0100
@@ -61,6 +61,7 @@
       sourceCompression_(compression),
       bytesToSkip_(0),
       skipped_(0),
+      currentChunkOffset_(0),
       ready_(false)
     {
     }
--- a/Core/Images/JpegWriter.cpp	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/Images/JpegWriter.cpp	Tue Dec 13 15:28:05 2016 +0100
@@ -105,7 +105,7 @@
 
   void JpegWriter::SetQuality(uint8_t quality)
   {
-    if (quality <= 0 || quality > 100)
+    if (quality == 0 || quality > 100)
     {
       throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
--- a/Core/MultiThreading/BagOfTasksProcessor.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/MultiThreading/BagOfTasksProcessor.h	Tue Dec 13 15:28:05 2016 +0100
@@ -64,10 +64,10 @@
       {
       }
 
-      Bag(size_t size) : 
-      size_(size),
-      done_(0),
-      status_(BagStatus_Running)
+      explicit Bag(size_t size) : 
+        size_(size),
+        done_(0),
+        status_(BagStatus_Running)
       {
       }
     };
@@ -140,7 +140,7 @@
     };
   
 
-    BagOfTasksProcessor(size_t countThreads);
+    explicit BagOfTasksProcessor(size_t countThreads);
 
     ~BagOfTasksProcessor();
 
--- a/Core/MultiThreading/ReaderWriterLock.cpp	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/MultiThreading/ReaderWriterLock.cpp	Tue Dec 13 15:28:05 2016 +0100
@@ -59,7 +59,7 @@
       }
 
     public:
-      ReaderLockable(boost::shared_mutex& lock) : lock_(lock)
+      explicit ReaderLockable(boost::shared_mutex& lock) : lock_(lock)
       {
       }
     };
@@ -82,10 +82,9 @@
       }
 
     public:
-      WriterLockable(boost::shared_mutex& lock) : lock_(lock)
+      explicit WriterLockable(boost::shared_mutex& lock) : lock_(lock)
       {
       }
-
     };
   }
 
--- a/Core/MultiThreading/RunnableWorkersPool.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/MultiThreading/RunnableWorkersPool.h	Tue Dec 13 15:28:05 2016 +0100
@@ -47,7 +47,7 @@
     void Stop();
 
   public:
-    RunnableWorkersPool(size_t countWorkers);
+    explicit RunnableWorkersPool(size_t countWorkers);
 
     ~RunnableWorkersPool();
 
--- a/Core/MultiThreading/Semaphore.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/MultiThreading/Semaphore.h	Tue Dec 13 15:28:05 2016 +0100
@@ -57,7 +57,7 @@
       Semaphore&  that_;
 
     public:
-      Locker(Semaphore& that) :
+      explicit Locker(Semaphore& that) :
         that_(that)
       {
         that_.Acquire();
--- a/Core/OrthancException.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Core/OrthancException.h	Tue Dec 13 15:28:05 2016 +0100
@@ -45,7 +45,7 @@
     HttpStatus httpStatus_;
 
   public:
-    OrthancException(ErrorCode errorCode) : 
+    explicit OrthancException(ErrorCode errorCode) : 
       errorCode_(errorCode),
       httpStatus_(ConvertErrorCodeToHttpStatus(errorCode))
     {
--- a/OrthancServer/Scheduler/ServerScheduler.cpp	Tue Dec 13 14:34:33 2016 +0100
+++ b/OrthancServer/Scheduler/ServerScheduler.cpp	Tue Dec 13 15:28:05 2016 +0100
@@ -47,7 +47,7 @@
       ListOfStrings& target_;
 
     public:
-      Sink(ListOfStrings& target) : target_(target)
+      explicit Sink(ListOfStrings& target) : target_(target)
       {
       }
 
--- a/OrthancServer/Scheduler/ServerScheduler.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/OrthancServer/Scheduler/ServerScheduler.h	Tue Dec 13 15:28:05 2016 +0100
@@ -82,7 +82,7 @@
                         bool watched);
 
   public:
-    ServerScheduler(unsigned int maxjobs);
+    explicit ServerScheduler(unsigned int maxjobs);
 
     ~ServerScheduler();
 
--- a/Plugins/Engine/SharedLibrary.h	Tue Dec 13 14:34:33 2016 +0100
+++ b/Plugins/Engine/SharedLibrary.h	Tue Dec 13 15:28:05 2016 +0100
@@ -60,7 +60,7 @@
     FunctionPointer GetFunctionInternal(const std::string& name);
 
   public:
-    SharedLibrary(const std::string& path);
+    explicit SharedLibrary(const std::string& path);
 
     ~SharedLibrary();