# HG changeset patch # User Benjamin Golinvaux # Date 1575280780 -3600 # Node ID 113a9643e8bb9cbc1dd2e194d33471604641a7c2 # Parent 75268c1ea3096b6ee7fcecfa38d8b5debd6e1e3c Suppressed a few warnings when building with emscripten (clang) + numeric truncation warnings diff -r 75268c1ea309 -r 113a9643e8bb Core/Images/ImageProcessing.cpp --- a/Core/Images/ImageProcessing.cpp Sun Dec 01 11:12:48 2019 +0100 +++ b/Core/Images/ImageProcessing.cpp Mon Dec 02 10:59:40 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 75268c1ea309 -r 113a9643e8bb Core/JobsEngine/JobInfo.cpp --- a/Core/JobsEngine/JobInfo.cpp Sun Dec 01 11:12:48 2019 +0100 +++ b/Core/JobsEngine/JobInfo.cpp Mon Dec 02 10:59:40 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 75268c1ea309 -r 113a9643e8bb Core/SQLite/FunctionContext.cpp --- a/Core/SQLite/FunctionContext.cpp Sun Dec 01 11:12:48 2019 +0100 +++ b/Core/SQLite/FunctionContext.cpp Mon Dec 02 10:59:40 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 75268c1ea309 -r 113a9643e8bb Core/SQLite/Statement.cpp --- a/Core/SQLite/Statement.cpp Sun Dec 01 11:12:48 2019 +0100 +++ b/Core/SQLite/Statement.cpp Mon Dec 02 10:59:40 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); }