# HG changeset patch # User Alain Mazy # Date 1576790244 -3600 # Node ID a648c2d67a6502fe0cac76e540a11566da6adf27 # Parent eb48adfd931e088d34f2b156c9fb48db04b88620# Parent 76b3228f99b0c9e3a7033b34b1ed893293b9dcd5 merge diff -r eb48adfd931e -r a648c2d67a65 Core/Images/ImageProcessing.cpp --- 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::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' requested here +.../mnt/c/osi/dev/orthanc/Core/Images/ImageProcessing.cpp:1006:9: note: in instantiation of function template specialization 'Orthanc::MultiplyConstantInternal' requested here +*/ +#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion" +#endif + #include #include @@ -1874,7 +1885,7 @@ for (unsigned int x = 0; x < targetWidth; x++) { - int sourceX = std::floor((static_cast(x) + 0.5f) * scaleX); + int sourceX = static_cast(std::floor((static_cast(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(y) + 0.5f) * scaleY); + int sourceY = static_cast(std::floor((static_cast(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( + 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(tmp.GetConstRow(y + k - verticalAnchor)); + rows[k] = reinterpret_cast(tmp.GetConstRow(static_cast(y + k - verticalAnchor))); } } diff -r eb48adfd931e -r a648c2d67a65 Core/JobsEngine/JobInfo.cpp --- 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::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 >' requested here +.../orthanc/Core/JobsEngine/JobInfo.cpp:69:44: note: in instantiation of function template specialization 'boost::math::llround' requested here + +.../boost/math/special_functions/round.hpp:86:12: warning: implicit conversion from 'std::__2::numeric_limits::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 >' requested here +.../orthanc/Core/JobsEngine/JobInfo.cpp:133:39: note: in instantiation of function template specialization 'boost::math::iround' requested here +*/ +#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion" +#endif + #include "JobInfo.h" #include "../OrthancException.h" diff -r eb48adfd931e -r a648c2d67a65 Core/SQLite/FunctionContext.cpp --- 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(str.size()), SQLITE_TRANSIENT); } } } diff -r eb48adfd931e -r a648c2d67a65 Core/SQLite/Statement.cpp --- 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(val.size()), SQLITE_TRANSIENT), ErrorCode_BadParameterType); } diff -r eb48adfd931e -r a648c2d67a65 INSTALL --- 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 --------------------------------------------- diff -r eb48adfd931e -r a648c2d67a65 Plugins/Include/orthanc/OrthancCPlugin.h --- 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( diff -r eb48adfd931e -r a648c2d67a65 Plugins/Samples/ModalityWorklists/WorklistsDatabase/Generate.py --- 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': diff -r eb48adfd931e -r a648c2d67a65 Plugins/Samples/WebSkeleton/Framework/EmbedResources.py --- 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 diff -r eb48adfd931e -r a648c2d67a65 Resources/EmbedResources.py --- 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):