changeset 1616:644c32c07306

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Sep 2015 16:00:50 +0200
parents c40fe92a68e7
children dd1f7909a14c
files Core/Images/Font.cpp Core/Images/Font.h Core/Images/FontRegistry.h Core/Images/Image.h OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp OrthancServer/ParsedDicomFile.cpp
diffstat 6 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Images/Font.cpp	Wed Sep 16 15:18:59 2015 +0200
+++ b/Core/Images/Font.cpp	Wed Sep 16 16:00:50 2015 +0200
@@ -45,7 +45,7 @@
   Font::~Font()
   {
     for (Characters::iterator it = characters_.begin();
-         it != characters_.end(); it++)
+         it != characters_.end(); ++it)
     {
       delete it->second;
     }
--- a/Core/Images/Font.h	Wed Sep 16 15:18:59 2015 +0200
+++ b/Core/Images/Font.h	Wed Sep 16 16:00:50 2015 +0200
@@ -37,10 +37,11 @@
 #include <stdint.h>
 #include <vector>
 #include <map>
+#include <boost/noncopyable.hpp>
 
 namespace Orthanc
 {
-  class Font
+  class Font : public boost::noncopyable
   {
   private:
     struct Character
@@ -72,6 +73,10 @@
                       const uint8_t color[4]) const;
 
   public:
+    Font()
+    {
+    }
+
     ~Font();
 
     void LoadFromMemory(const std::string& font);
--- a/Core/Images/FontRegistry.h	Wed Sep 16 15:18:59 2015 +0200
+++ b/Core/Images/FontRegistry.h	Wed Sep 16 16:00:50 2015 +0200
@@ -38,7 +38,7 @@
 
 namespace Orthanc
 {
-  class FontRegistry
+  class FontRegistry : public boost::noncopyable
   {
   private:
     typedef std::vector<Font*>  Fonts;
--- a/Core/Images/Image.h	Wed Sep 16 15:18:59 2015 +0200
+++ b/Core/Images/Image.h	Wed Sep 16 16:00:50 2015 +0200
@@ -40,15 +40,15 @@
   class Image : public ImageAccessor
   {
   private:
-    ImageBuffer  buffer_;
+    ImageBuffer  image_;
 
   public:
     Image(PixelFormat format,
           unsigned int width,
           unsigned int height) :
-      buffer_(format, width, height)
+      image_(format, width, height)
     {
-      ImageAccessor accessor = buffer_.GetAccessor();
+      ImageAccessor accessor = image_.GetAccessor();
       AssignWritable(format, width, height, accessor.GetPitch(), accessor.GetBuffer());
     }
   };
--- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Wed Sep 16 15:18:59 2015 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Wed Sep 16 16:00:50 2015 +0200
@@ -578,7 +578,7 @@
         StoreCreatedInstance(someInstance, call, *dicom);
       }
     }
-    catch (OrthancException& e)
+    catch (OrthancException&)
     {
       // Error: Remove the newly-created series
       
@@ -589,7 +589,7 @@
         context.GetIndex().DeleteResource(dummy, series, ResourceType_Series);
       }
 
-      throw e;
+      throw;
     }
 
     std::string series;
@@ -715,7 +715,7 @@
       }
 
       for (ModuleTags::const_iterator it = moduleTags.begin();
-           it != moduleTags.end(); it++)
+           it != moduleTags.end(); ++it)
       {
         std::string t = it->Format();
         if (siblingTags.isMember(t))
@@ -786,7 +786,6 @@
       else
       {
         throw OrthancException(ErrorCode_CreateDicomUseDataUriScheme);
-        return;
       }
     }
 
--- a/OrthancServer/ParsedDicomFile.cpp	Wed Sep 16 15:18:59 2015 +0200
+++ b/OrthancServer/ParsedDicomFile.cpp	Wed Sep 16 16:00:50 2015 +0200
@@ -272,7 +272,8 @@
                        E_TransferSyntax transferSyntax) :
         element_(element),
         length_(element.getLength(transferSyntax)),
-        offset_(0)
+        offset_(0),
+        chunkSize_(0)
       {
         static const size_t CHUNK_SIZE = 64 * 1024;  // Use chunks of max 64KB
         chunk_.resize(CHUNK_SIZE);