changeset 3589:a648c2d67a65

merge
author Alain Mazy <alain@mazy.be>
date Thu, 19 Dec 2019 22:17:24 +0100
parents eb48adfd931e (current diff) 76b3228f99b0 (diff)
children d5740d3b1d67
files
diffstat 9 files changed, 57 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Images/ImageProcessing.cpp	Thu Dec 19 22:16:49 2019 +0100
+++ b/Core/Images/ImageProcessing.cpp	Thu Dec 19 22:17:24 2019 +0100
@@ -39,6 +39,17 @@
 #include "PixelTraits.h"
 #include "../OrthancException.h"
 
+#ifdef __EMSCRIPTEN__
+/* 
+Avoid this error:
+-----------------
+.../boost/math/special_functions/round.hpp:118:12: warning: implicit conversion from 'std::__2::numeric_limits<long long>::type' (aka 'long long') to 'float' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
+.../mnt/c/osi/dev/orthanc/Core/Images/ImageProcessing.cpp:333:28: note: in instantiation of function template specialization 'boost::math::llround<float>' requested here
+.../mnt/c/osi/dev/orthanc/Core/Images/ImageProcessing.cpp:1006:9: note: in instantiation of function template specialization 'Orthanc::MultiplyConstantInternal<unsigned char, true>' requested here
+*/
+#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
+#endif 
+
 #include <boost/math/special_functions/round.hpp>
 
 #include <cassert>
@@ -1874,7 +1885,7 @@
       
     for (unsigned int x = 0; x < targetWidth; x++)
     {
-      int sourceX = std::floor((static_cast<float>(x) + 0.5f) * scaleX);
+      int sourceX = static_cast<int>(std::floor((static_cast<float>(x) + 0.5f) * scaleX));
       if (sourceX < 0)
       {
         sourceX = 0;  // Should never happen
@@ -1891,7 +1902,7 @@
       
     for (unsigned int y = 0; y < targetHeight; y++)
     {
-      int sourceY = std::floor((static_cast<float>(y) + 0.5f) * scaleY);
+      int sourceY = static_cast<int>(std::floor((static_cast<float>(y) + 0.5f) * scaleY));
       if (sourceY < 0)
       {
         sourceY = 0;  // Should never happen
@@ -2173,7 +2184,8 @@
         }
 
         // Deal with the right border
-        for (unsigned int x = horizontalAnchor + width - horizontal.size() + 1; x < width; x++)
+        for (unsigned int x = static_cast<unsigned int>(
+          horizontalAnchor + width - horizontal.size() + 1); x < width; x++)
         {
           for (unsigned int c = 0; c < ChannelsCount; c++, p++)
           {
@@ -2205,7 +2217,7 @@
         }
         else
         {
-          rows[k] = reinterpret_cast<const float*>(tmp.GetConstRow(y + k - verticalAnchor));
+          rows[k] = reinterpret_cast<const float*>(tmp.GetConstRow(static_cast<unsigned int>(y + k - verticalAnchor)));
         }
       }
 
--- a/Core/JobsEngine/JobInfo.cpp	Thu Dec 19 22:16:49 2019 +0100
+++ b/Core/JobsEngine/JobInfo.cpp	Thu Dec 19 22:17:24 2019 +0100
@@ -32,6 +32,22 @@
 
 
 #include "../PrecompiledHeaders.h"
+
+#ifdef __EMSCRIPTEN__
+/* 
+Avoid this error:
+
+.../boost/math/special_functions/round.hpp:118:12: warning: implicit conversion from 'std::__2::numeric_limits<long long>::type' (aka 'long long') to 'float' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
+.../boost/math/special_functions/round.hpp:125:11: note: in instantiation of function template specialization 'boost::math::llround<float, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >' requested here
+.../orthanc/Core/JobsEngine/JobInfo.cpp:69:44: note: in instantiation of function template specialization 'boost::math::llround<float>' requested here
+
+.../boost/math/special_functions/round.hpp:86:12: warning: implicit conversion from 'std::__2::numeric_limits<int>::type' (aka 'int') to 'float' changes value from 2147483647 to 2147483648 [-Wimplicit-int-float-conversion]
+.../boost/math/special_functions/round.hpp:93:11: note: in instantiation of function template specialization 'boost::math::iround<float, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >' requested here
+.../orthanc/Core/JobsEngine/JobInfo.cpp:133:39: note: in instantiation of function template specialization 'boost::math::iround<float>' requested here
+*/
+#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
+#endif 
+
 #include "JobInfo.h"
 
 #include "../OrthancException.h"
--- a/Core/SQLite/FunctionContext.cpp	Thu Dec 19 22:16:49 2019 +0100
+++ b/Core/SQLite/FunctionContext.cpp	Thu Dec 19 22:17:24 2019 +0100
@@ -121,7 +121,7 @@
 
     void FunctionContext::SetStringResult(const std::string& str)
     {
-      sqlite3_result_text(context_, str.data(), str.size(), SQLITE_TRANSIENT);
+      sqlite3_result_text(context_, str.data(), static_cast<int>(str.size()), SQLITE_TRANSIENT);
     }
   }
 }
--- a/Core/SQLite/Statement.cpp	Thu Dec 19 22:16:49 2019 +0100
+++ b/Core/SQLite/Statement.cpp	Thu Dec 19 22:17:24 2019 +0100
@@ -218,7 +218,7 @@
       CheckOk(sqlite3_bind_text(GetStatement(),
                                 col + 1,
                                 val.data(),
-                                val.size(),
+                                static_cast<int>(val.size()),
                                 SQLITE_TRANSIENT),
               ErrorCode_BadParameterType);
     }
--- a/INSTALL	Thu Dec 19 22:16:49 2019 +0100
+++ b/INSTALL	Thu Dec 19 22:17:24 2019 +0100
@@ -123,7 +123,21 @@
 The option "-T host=x64" is necessary to prevent error "C1060:
 compiler is out of heap space" when compiling Orthanc with ICU.
 
+Native 64-bit Windows build with Microsoft Visual Studio 2017 (msbuild)
+-----------------------------------------------------------------------
+# cd [...]\OrthancBuild
+# cmake -G "Visual Studio 15 2017 Win64" -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\Orthanc
 
+Instructions to include support for Asian encodings:
+# cmake -G "Visual Studio 15 2017 Win64" -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\Orthanc
+
+Native 64-bit Windows build with Microsoft Visual Studio 2019 (msbuild)
+-----------------------------------------------------------------------
+# cd [...]\OrthancBuild
+# cmake -G "Visual Studio 16 2019" -A x64 -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\Orthanc
+
+Instructions to include support for Asian encodings:
+# cmake -G "Visual Studio 16 2019" -A x64 -T host=x64 -DSTATIC_BUILD=ON -DBOOST_LOCALE_BACKEND=icu -DMSVC_MULTIPLE_PROCESSES=ON -DSTATIC_BUILD=ON -DOPENSSL_NO_CAPIENG=ON -DALLOW_DOWNLOADS=ON [...]\Orthanc
 
 Cross-Compilation for Windows under GNU/Linux
 ---------------------------------------------
--- a/Plugins/Include/orthanc/OrthancCPlugin.h	Thu Dec 19 22:16:49 2019 +0100
+++ b/Plugins/Include/orthanc/OrthancCPlugin.h	Thu Dec 19 22:17:24 2019 +0100
@@ -2886,7 +2886,10 @@
    * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
    * @param instance The instance of interest.
    * @param metadata The metadata of interest.
-   * @return The metadata value if success, NULL if error.
+   * @return The metadata value if success, NULL if error. Please note that the 
+   *         returned string belongs to the instance object and must NOT be 
+   *         deallocated. Please make a copy of the string if you wish to access 
+   *         it later.
    * @ingroup Callbacks
    **/
   ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
--- a/Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py	Thu Dec 19 22:16:49 2019 +0100
+++ b/Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py	Thu Dec 19 22:17:24 2019 +0100
@@ -6,7 +6,7 @@
 SOURCE = '/home/jodogne/Downloads/dcmtk-3.6.0/dcmwlm/data/wlistdb/OFFIS/'
 TARGET = os.path.abspath(os.path.dirname(__file__))
 
-for f in os.listdir(SOURCE):
+for f in sorted(os.listdir(SOURCE)):
     ext = os.path.splitext(f)
 
     if ext[1].lower() == '.dump':
--- a/Plugins/Samples/WebSkeleton/Framework/EmbedResources.py	Thu Dec 19 22:16:49 2019 +0100
+++ b/Plugins/Samples/WebSkeleton/Framework/EmbedResources.py	Thu Dec 19 22:17:24 2019 +0100
@@ -74,6 +74,8 @@
         # The resource is a directory: Recursively explore its files
         content = {}
         for root, dirs, files in os.walk(pathName):
+            dirs.sort()
+            files.sort()
             base = os.path.relpath(root, pathName)
             for f in files:
                 if f.find('~') == -1:  # Ignore Emacs backup files
--- a/Resources/EmbedResources.py	Thu Dec 19 22:16:49 2019 +0100
+++ b/Resources/EmbedResources.py	Thu Dec 19 22:17:24 2019 +0100
@@ -101,6 +101,8 @@
         # The resource is a directory: Recursively explore its files
         content = {}
         for root, dirs, files in os.walk(pathName):
+            dirs.sort()
+            files.sort()
             base = os.path.relpath(root, pathName)
 
             # Fix issue #24 (Build fails on OSX when directory has .DS_Store files):