diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-01-31 10:05:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-01-31 21:01:49 +0100 |
commit | 7a42f3966378d5a43193e3d6db6f27bc319c3616 (patch) | |
tree | e2b8c953f99ca3090dddde78e66b715a74cfbb19 /basic/source | |
parent | bca11ff008b53764cf248eff485bdb24c41b6fa3 (diff) |
basic: MSVC: pragma warning: make more specific, remove obsolete
Change-Id: I9e157f7b27eab831c5c15f6c22b9ffb20207b593
Reviewed-on: https://gerrit.libreoffice.org/48947
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/comp/codegen.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 8b7a0a8142e4..bcab0d0a0f95 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -468,19 +468,13 @@ public: virtual void end() override {} S offset() { + typedef decltype(T(1) + S(1)) larger_t; // type capable to hold both value ranges of T and S T result = 0 ; static const S max = std::numeric_limits< S >::max(); result = m_nNumOp0 + ( ( sizeof(S) + 1 ) * m_nNumSingleParams ) + ( (( sizeof(S) * 2 )+ 1 ) * m_nNumDoubleParams ); -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning( disable : 4309) -#endif - return std::min(static_cast<T>(max), result); -#ifdef _MSC_VER -#pragma warning(push) -#endif + return std::min<larger_t>(max, result); } - virtual bool processParams() override { return false; } + virtual bool processParams() override { return false; } }; |