changeset 4253:2221051b42df

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 15 Oct 2020 20:08:44 +0200
parents f047e2734655
children a4af6eaca23e 2d6e7471ec7f
files OrthancFramework/Sources/HttpServer/IWebDavBucket.h OrthancFramework/Sources/HttpServer/WebDavStorage.h OrthancServer/Resources/RunCppCheck.sh OrthancServer/Sources/OrthancWebDav.cpp
diffstat 4 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/HttpServer/IWebDavBucket.h	Thu Oct 15 17:13:35 2020 +0200
+++ b/OrthancFramework/Sources/HttpServer/IWebDavBucket.h	Thu Oct 15 20:08:44 2020 +0200
@@ -56,7 +56,7 @@
       boost::posix_time::ptime  modificationTime_;
 
     public:
-      Resource(const std::string& displayName);
+      explicit Resource(const std::string& displayName);
 
       virtual ~Resource()
       {
@@ -93,7 +93,7 @@
       MimeType  mime_;
 
     public:
-      File(const std::string& displayName);
+      explicit File(const std::string& displayName);
 
       void SetContentLength(uint64_t contentLength)
       {
@@ -125,7 +125,7 @@
     class Folder : public Resource
     {
     public:
-      Folder(const std::string& displayName) :
+      explicit Folder(const std::string& displayName) :
         Resource(displayName)
       {
       }
--- a/OrthancFramework/Sources/HttpServer/WebDavStorage.h	Thu Oct 15 17:13:35 2020 +0200
+++ b/OrthancFramework/Sources/HttpServer/WebDavStorage.h	Thu Oct 15 20:08:44 2020 +0200
@@ -42,7 +42,7 @@
     bool                              isMemory_;
 
   public:
-    WebDavStorage(bool isMemory);
+    explicit WebDavStorage(bool isMemory);
   
     virtual bool IsExistingFolder(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
 
--- a/OrthancServer/Resources/RunCppCheck.sh	Thu Oct 15 17:13:35 2020 +0200
+++ b/OrthancServer/Resources/RunCppCheck.sh	Thu Oct 15 20:08:44 2020 +0200
@@ -15,6 +15,7 @@
 nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:309
 nullPointerRedundantCheck:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp
 stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1103
+stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:382
 stlFindInsert:../../OrthancServer/Sources/ServerIndex.cpp:400
 syntaxError:../../OrthancFramework/Sources/SQLite/FunctionContext.h:50
 syntaxError:../../OrthancFramework/UnitTestsSources/ZipTests.cpp:129
@@ -33,6 +34,7 @@
             -DBOOST_HAS_FILESYSTEM_V3=1 \
             -DBOOST_HAS_REGEX=1 \
             -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1 \
+            -DCIVETWEB_HAS_WEBDAV_WRITING=1 \
             -DDCMTK_VERSION_NUMBER=365 \
             -DMONGOOSE_USE_CALLBACKS=1 \
             -DORTHANC_BUILDING_FRAMEWORK_LIBRARY=0 \
--- a/OrthancServer/Sources/OrthancWebDav.cpp	Thu Oct 15 17:13:35 2020 +0200
+++ b/OrthancServer/Sources/OrthancWebDav.cpp	Thu Oct 15 20:08:44 2020 +0200
@@ -612,16 +612,16 @@
       Children::const_iterator child = children_.find(path);
       if (child == children_.end())
       {
-        INode* child = CreateSubfolder(path);
+        INode* node = CreateSubfolder(path);
         
-        if (child == NULL)
+        if (node == NULL)
         {
           return NULL;
         }
         else
         {
-          children_[path] = child;
-          return child;
+          children_[path] = node;
+          return node;
         }
       }
       else
@@ -964,7 +964,7 @@
       std::list<std::string>&  resources_;
 
     public:
-      Visitor(std::list<std::string>& resources) :
+      explicit Visitor(std::list<std::string>& resources) :
         resources_(resources)
       {
       }