changeset 12:34b1875c8e3a

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Mar 2019 16:12:52 +0100
parents 4b9c2e0a92c8
children df314d38a4e0
files Framework/DicomInstanceInfo.h Framework/DownloadArea.h Framework/PushMode/ActivePushTransactions.h Framework/PushMode/BucketPushQuery.cpp Framework/SourceDicomInstance.h Framework/StatefulOrthancJob.h Framework/TransferBucket.h Framework/TransferQuery.h Plugin/Plugin.cpp Plugin/PluginContext.cpp
diffstat 10 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/DicomInstanceInfo.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/DicomInstanceInfo.h	Mon Mar 04 16:12:52 2019 +0100
@@ -46,7 +46,7 @@
                       size_t size,
                       const std::string& md5);
 
-    DicomInstanceInfo(const Json::Value& serialized);
+    explicit DicomInstanceInfo(const Json::Value& serialized);
 
     const std::string& GetId() const
     {
--- a/Framework/DownloadArea.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/DownloadArea.h	Mon Mar 04 16:12:52 2019 +0100
@@ -37,7 +37,7 @@
       class Writer;
 
     public:
-      Instance(const DicomInstanceInfo& info);
+      explicit Instance(const DicomInstanceInfo& info);
 
       const DicomInstanceInfo& GetInfo() const
       {
@@ -72,9 +72,9 @@
     void CommitInternal(bool simulate);
 
   public:
-    DownloadArea(const TransferScheduler& scheduler);
+    explicit DownloadArea(const TransferScheduler& scheduler);
 
-    DownloadArea(const std::vector<DicomInstanceInfo>& instances)
+    explicit DownloadArea(const std::vector<DicomInstanceInfo>& instances)
     {
       Setup(instances);
     }
--- a/Framework/PushMode/ActivePushTransactions.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/PushMode/ActivePushTransactions.h	Mon Mar 04 16:12:52 2019 +0100
@@ -44,7 +44,7 @@
                              bool commit);
 
   public:
-    ActivePushTransactions(size_t maxSize) :
+    explicit ActivePushTransactions(size_t maxSize) :
       maxSize_(maxSize)
     {
     }
--- a/Framework/PushMode/BucketPushQuery.cpp	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/PushMode/BucketPushQuery.cpp	Mon Mar 04 16:12:52 2019 +0100
@@ -36,9 +36,9 @@
     cache_(cache),
     bucket_(bucket),
     peer_(peer),
+    uri_(transactionUri + "/" + boost::lexical_cast<std::string>(bucketIndex)),
     compression_(compression)
   {
-    uri_ = transactionUri + "/" + boost::lexical_cast<std::string>(bucketIndex);
   }
 
 
--- a/Framework/SourceDicomInstance.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/SourceDicomInstance.h	Mon Mar 04 16:12:52 2019 +0100
@@ -35,7 +35,7 @@
     std::auto_ptr<DicomInstanceInfo>  info_;
 
   public:
-    SourceDicomInstance(const std::string& instanceId);
+    explicit SourceDicomInstance(const std::string& instanceId);
 
     ~SourceDicomInstance();
 
--- a/Framework/StatefulOrthancJob.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/StatefulOrthancJob.h	Mon Mar 04 16:12:52 2019 +0100
@@ -40,7 +40,7 @@
       Json::Value          content_;
 
     public:
-      JobInfo(StatefulOrthancJob& job);
+      explicit JobInfo(StatefulOrthancJob& job);
 
       void SetProgress(float progress)
       {
@@ -61,12 +61,12 @@
       OrthancPluginJobStepStatus  status_;
       std::auto_ptr<IState>       state_;
 
-      StateUpdate(OrthancPluginJobStepStatus status) :
+      explicit StateUpdate(OrthancPluginJobStepStatus status) :
         status_(status)
       {
       }
 
-      StateUpdate(IState* state);
+      explicit StateUpdate(IState* state);
 
     public:
       static StateUpdate* Next(IState* state)  // Takes ownsership
--- a/Framework/TransferBucket.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/TransferBucket.h	Mon Mar 04 16:12:52 2019 +0100
@@ -41,7 +41,7 @@
   public:
     TransferBucket();
 
-    TransferBucket(const Json::Value& serialized);
+    explicit TransferBucket(const Json::Value& serialized);
 
     size_t GetTotalSize() const
     {
--- a/Framework/TransferQuery.h	Mon Mar 04 16:04:52 2019 +0100
+++ b/Framework/TransferQuery.h	Mon Mar 04 16:12:52 2019 +0100
@@ -36,7 +36,7 @@
     int                priority_;
 
   public:
-    TransferQuery(const Json::Value& body);
+    explicit TransferQuery(const Json::Value& body);
 
     const std::string& GetPeer() const
     {
--- a/Plugin/Plugin.cpp	Mon Mar 04 16:04:52 2019 +0100
+++ b/Plugin/Plugin.cpp	Mon Mar 04 16:12:52 2019 +0100
@@ -643,7 +643,6 @@
       size_t maxPushTransactions = 4;
       size_t memoryCacheSize = 512;    // In MB
       unsigned int maxHttpRetries = 0;
-      std::map<std::string, std::string> bidirectionalPeers;
     
       {
         OrthancPlugins::OrthancConfiguration config;
--- a/Plugin/PluginContext.cpp	Mon Mar 04 16:04:52 2019 +0100
+++ b/Plugin/PluginContext.cpp	Mon Mar 04 16:12:52 2019 +0100
@@ -31,12 +31,11 @@
                                unsigned int maxHttpRetries) :
     pushTransactions_(maxPushTransactions),
     semaphore_(threadsCount),
+    pluginUuid_(Orthanc::Toolbox::GenerateUuid()),
     threadsCount_(threadsCount),
     targetBucketSize_(targetBucketSize),
     maxHttpRetries_(maxHttpRetries)
   {
-    pluginUuid_ = Orthanc::Toolbox::GenerateUuid();
-
     cache_.SetMaxMemorySize(memoryCacheSize);
 
     LOG(INFO) << "Transfers accelerator will use " << threadsCount << " threads to run HTTP queries";