changeset 1303:bba8a47922d1

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Feb 2015 16:47:24 +0100
parents 5fe254fb1c93
children 7b6925b0890d
files Core/RestApi/RestApiHierarchy.cpp OrthancServer/DicomDirWriter.h OrthancServer/DicomInstanceToStore.h OrthancServer/DicomProtocol/DicomUserConnection.cpp OrthancServer/OrthancRestApi/OrthancRestArchive.cpp OrthancServer/OrthancRestApi/OrthancRestResources.cpp OrthancServer/OrthancRestApi/OrthancRestSystem.cpp Plugins/Include/OrthancCPlugin.h
diffstat 8 files changed, 22 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Core/RestApi/RestApiHierarchy.cpp	Tue Feb 10 16:33:57 2015 +0100
+++ b/Core/RestApi/RestApiHierarchy.cpp	Tue Feb 10 16:47:24 2015 +0100
@@ -159,7 +159,7 @@
   void RestApiHierarchy::DeleteChildren(Children& children)
   {
     for (Children::iterator it = children.begin();
-         it != children.end(); it++)
+         it != children.end(); ++it)
     {
       delete it->second;
     }
@@ -238,7 +238,7 @@
 
       // Try and go down in the hierarchy, using wildcard rules for children
       for (child = wildcardChildren_.begin();
-           child != wildcardChildren_.end(); child++)
+           child != wildcardChildren_.end(); ++child)
       {
         HttpHandler::Arguments subComponents = components;
         subComponents[child->first] = uri[level];
@@ -276,7 +276,7 @@
   bool RestApiHierarchy::CanGenerateDirectory() const
   {
     return (universalHandlers_.IsEmpty() &&
-            wildcardChildren_.size() == 0);
+            wildcardChildren_.empty());
   }
 
 
@@ -291,7 +291,7 @@
         result = Json::arrayValue;
 
         for (Children::const_iterator it = children_.begin();
-             it != children_.end(); it++)
+             it != children_.end(); ++it)
         {
           result.append(it->first);
         }
@@ -314,7 +314,7 @@
     }
 
     for (child = wildcardChildren_.begin(); 
-         child != wildcardChildren_.end(); child++)
+         child != wildcardChildren_.end(); ++child)
     {
       if (child->second->GetDirectory(result, uri, level + 1))
       {
@@ -388,13 +388,13 @@
       target = s;*/
       
     for (Children::const_iterator it = children_.begin();
-         it != children_.end(); it++)
+         it != children_.end(); ++it)
     {
       it->second->CreateSiteMap(target[it->first]);
     }
       
     for (Children::const_iterator it = wildcardChildren_.begin();
-         it != wildcardChildren_.end(); it++)
+         it != wildcardChildren_.end(); ++it)
     {
       it->second->CreateSiteMap(target["<" + it->first + ">"]);
     }
--- a/OrthancServer/DicomDirWriter.h	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/DicomDirWriter.h	Tue Feb 10 16:47:24 2015 +0100
@@ -34,9 +34,11 @@
 
 #include "ParsedDicomFile.h"
 
+#include <boost/noncopyable.hpp>
+
 namespace Orthanc
 {
-  class DicomDirWriter
+  class DicomDirWriter : public boost::noncopyable
   {
   private:
     class PImpl;
--- a/OrthancServer/DicomInstanceToStore.h	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/DicomInstanceToStore.h	Tue Feb 10 16:47:24 2015 +0100
@@ -60,7 +60,7 @@
       }
 
     public:
-      SmartContainer() : content_(NULL), toDelete_(false)
+      SmartContainer() : content_(NULL), toDelete_(false), isReadOnly_(true)
       {
       }
 
--- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp	Tue Feb 10 16:47:24 2015 +0100
@@ -942,7 +942,7 @@
              defaultStorageSOPClasses_.size() >= MAXIMUM_STORAGE_SOP_CLASSES)
     {
       // Make room in the default storage syntaxes
-      assert(defaultStorageSOPClasses_.size() > 0);  // Necessarily true because condition (*) is false
+      assert(!defaultStorageSOPClasses_.empty());  // Necessarily true because condition (*) is false
       defaultStorageSOPClasses_.erase(*defaultStorageSOPClasses_.rbegin());
     }
 
--- a/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Tue Feb 10 16:47:24 2015 +0100
@@ -324,7 +324,7 @@
 
       size_t pos = 0;
       for (std::list<std::string>::const_iterator
-             it = instances.begin(); it != instances.end(); it++, pos++)
+             it = instances.begin(); it != instances.end(); ++it, ++pos)
       {
         // "DICOM restricts the filenames on DICOM media to 8
         // characters (some systems wrongly use 8.3, but this does not
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp	Tue Feb 10 16:47:24 2015 +0100
@@ -626,7 +626,7 @@
     shared = Json::objectValue;
 
     for (Instances::const_iterator it = instances.begin();
-         it != instances.end(); it++)
+         it != instances.end(); ++it)
     {
       // Get the tags of the current instance, in the simplified format
       Json::Value tags;
@@ -755,7 +755,7 @@
     
     // Filter the tags of the instance according to the module
     Json::Value result = Json::objectValue;
-    for (ModuleTags::const_iterator tag = moduleTags.begin(); tag != moduleTags.end(); tag++)
+    for (ModuleTags::const_iterator tag = moduleTags.begin(); tag != moduleTags.end(); ++tag)
     {
       std::string s = tag->Format();
       if (tags.isMember(s))
@@ -798,7 +798,7 @@
     Json::Value result = Json::arrayValue;
     
     for (Resources::const_iterator it = resources.begin();
-         it != resources.end(); it++)
+         it != resources.end(); ++it)
     {     
       ResourceType type = it->first;
       const std::string& id = it->second;
@@ -830,7 +830,7 @@
       b.clear();
 
       for (std::list<std::string>::const_iterator
-             it = a.begin(); it != a.end(); it++)
+             it = a.begin(); it != a.end(); ++it)
       {
         index.GetChildren(c, *it);
         b.splice(b.begin(), c);
@@ -861,7 +861,7 @@
     Json::Value result = Json::arrayValue;
 
     for (std::list<std::string>::const_iterator
-           it = a.begin(); it != a.end(); it++)
+           it = a.begin(); it != a.end(); ++it)
     {
       Json::Value item;
 
@@ -890,7 +890,7 @@
     Json::Value result = Json::objectValue;
 
     for (Instances::const_iterator it = instances.begin();
-         it != instances.end(); it++)
+         it != instances.end(); ++it)
     {
       Json::Value full;
       context.ReadJson(full, *it);
--- a/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Tue Feb 10 16:33:57 2015 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestSystem.cpp	Tue Feb 10 16:47:24 2015 +0100
@@ -130,7 +130,7 @@
       OrthancRestApi::GetContext(call).GetPluginsManager().ListPlugins(plugins);
 
       for (std::list<std::string>::const_iterator 
-             it = plugins.begin(); it != plugins.end(); it++)
+             it = plugins.begin(); it != plugins.end(); ++it)
       {
         v.append(*it);
       }
@@ -190,7 +190,7 @@
       OrthancRestApi::GetContext(call).GetPluginsManager().ListPlugins(lst);
 
       for (std::list<std::string>::const_iterator
-             it = lst.begin(); it != lst.end(); it++)
+             it = lst.begin(); it != lst.end(); ++it)
       {
         const char* tmp = plugins.GetProperty(it->c_str(), _OrthancPluginProperty_OrthancExplorer);
         if (tmp != NULL)
--- a/Plugins/Include/OrthancCPlugin.h	Tue Feb 10 16:33:57 2015 +0100
+++ b/Plugins/Include/OrthancCPlugin.h	Tue Feb 10 16:47:24 2015 +0100
@@ -588,7 +588,7 @@
 #else
       sscanf
 #endif
-      (context->orthancVersion, "%d.%d.%d", &major, &minor, &revision) != 3)
+      (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
     {
       return 0;
     }