changeset 221:c1b361117062

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 19 Apr 2018 14:41:17 +0200
parents d050ad099ed1
children 6a0e51470f1e 5be061c8874b
files Plugin/Dicom.h Plugin/DicomWebClient.cpp Plugin/DicomWebServers.cpp Plugin/QidoRs.cpp Resources/Orthanc/DownloadOrthancFramework.cmake Resources/Orthanc/MinGWToolchain.cmake
diffstat 6 files changed, 25 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Plugin/Dicom.h	Tue Apr 17 19:50:03 2018 +0200
+++ b/Plugin/Dicom.h	Thu Apr 19 14:41:17 2018 +0200
@@ -63,11 +63,11 @@
     void Setup(const std::string& dicom);
 
   public:
-    ParsedDicomFile(const OrthancPlugins::MultipartItem& item);
+    explicit ParsedDicomFile(const OrthancPlugins::MultipartItem& item);
 
-    ParsedDicomFile(const OrthancPlugins::MemoryBuffer& item);
+    explicit ParsedDicomFile(const OrthancPlugins::MemoryBuffer& item);
 
-    ParsedDicomFile(const std::string& dicom)
+    explicit ParsedDicomFile(const std::string& dicom)
     {
       Setup(dicom);
     }
--- a/Plugin/DicomWebClient.cpp	Tue Apr 17 19:50:03 2018 +0200
+++ b/Plugin/DicomWebClient.cpp	Thu Apr 19 14:41:17 2018 +0200
@@ -298,7 +298,7 @@
   Orthanc::ChunkedBuffer chunks;
   size_t countInstances = 0;
 
-  for (std::list<std::string>::const_iterator it = instances.begin(); it != instances.end(); it++)
+  for (std::list<std::string>::const_iterator it = instances.begin(); it != instances.end(); ++it)
   {
     OrthancPlugins::MemoryBuffer dicom(context);
     if (dicom.RestApiGet("/instances/" + *it + "/file", false))
--- a/Plugin/DicomWebServers.cpp	Tue Apr 17 19:50:03 2018 +0200
+++ b/Plugin/DicomWebServers.cpp	Thu Apr 19 14:41:17 2018 +0200
@@ -144,7 +144,6 @@
     assert(!url.empty() && url[url.size() - 1] == '/');
 
     // Remove the leading "/" in the URI if need be
-    std::string tmp;
     if (!uri.empty() &&
         uri[0] == '/')
     {
--- a/Plugin/QidoRs.cpp	Tue Apr 17 19:50:03 2018 +0200
+++ b/Plugin/QidoRs.cpp	Thu Apr 19 14:41:17 2018 +0200
@@ -158,11 +158,11 @@
 
 
   public:
-    ModuleMatcher(const OrthancPluginHttpRequest* request) :
-    fuzzy_(false),
-    offset_(0),
-    limit_(0),
-    includeAllFields_(false)
+    explicit ModuleMatcher(const OrthancPluginHttpRequest* request) :
+      fuzzy_(false),
+      offset_(0),
+      limit_(0),
+      includeAllFields_(false)
     {
       std::string args;
       
@@ -198,7 +198,7 @@
         }
         else if (key == "includefield")
         {
-          if (key == "all")
+          if (value == "all")
           {
             includeAllFields_ = true;
           }
--- a/Resources/Orthanc/DownloadOrthancFramework.cmake	Tue Apr 17 19:50:03 2018 +0200
+++ b/Resources/Orthanc/DownloadOrthancFramework.cmake	Thu Apr 19 14:41:17 2018 +0200
@@ -82,6 +82,8 @@
 
     if (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.1")
       set(ORTHANC_FRAMEWORK_MD5 "dac95bd6cf86fb19deaf4e612961f378")
+    elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.3.2")
+      set(ORTHANC_FRAMEWORK_MD5 "d0ccdf68e855d8224331f13774992750")
     endif()
   endif()
 endif()
@@ -206,12 +208,18 @@
 
 
 ##
-## Case of the Orthanc framework downloaded from the official Web site
+## Case of the Orthanc framework downloaded from the Web
 ##
 
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "web")
-  set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz)
-  set(ORTHANC_FRAMEWORK_URL "https://www.orthanc-server.com/downloads/get.php?path=/orthanc/${ORTHANC_FRAMEMORK_FILENAME}")
+  if (DEFINED ORTHANC_FRAMEWORK_URL)
+    string(REGEX REPLACE "^.*/" "" ORTHANC_FRAMEMORK_FILENAME "${ORTHANC_FRAMEWORK_URL}")
+  else()
+    # Default case: Download from the official Web site
+    set(ORTHANC_FRAMEMORK_FILENAME Orthanc-${ORTHANC_FRAMEWORK_VERSION}.tar.gz)
+    #set(ORTHANC_FRAMEWORK_URL "https://www.orthanc-server.com/downloads/get.php?path=/orthanc/${ORTHANC_FRAMEMORK_FILENAME}")
+    set(ORTHANC_FRAMEWORK_URL "https://www.orthanc-server.com/downloads/third-party/orthanc-framework/${ORTHANC_FRAMEMORK_FILENAME}")
+  endif()
 
   set(ORTHANC_FRAMEWORK_ARCHIVE "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${ORTHANC_FRAMEMORK_FILENAME}")
 
@@ -220,7 +228,7 @@
       message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON")
     endif()
 
-    message("Downloading: ${ORTHANC_FRAMEWORK_ARCHIVE}")
+    message("Downloading: ${ORTHANC_FRAMEWORK_URL}")
 
     file(DOWNLOAD
       "${ORTHANC_FRAMEWORK_URL}" "${ORTHANC_FRAMEWORK_ARCHIVE}" 
--- a/Resources/Orthanc/MinGWToolchain.cmake	Tue Apr 17 19:50:03 2018 +0200
+++ b/Resources/Orthanc/MinGWToolchain.cmake	Thu Apr 19 14:41:17 2018 +0200
@@ -15,3 +15,6 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSTACK_SIZE_PARAM_IS_A_RESERVATION=0x10000" CACHE INTERNAL "" FORCE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTACK_SIZE_PARAM_IS_A_RESERVATION=0x10000" CACHE INTERNAL "" FORCE)