diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-22 22:12:53 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-23 01:35:14 +0100 |
commit | d37df8fd1a681db758de6f4acfe6479e8e78b2dd (patch) | |
tree | 3427c325ea6de49f7bbdc5e05927ce2ee13b4f56 /extensions/source | |
parent | d7831d30e46a46e253cd6e855dd87eee3cb004a4 (diff) |
Fix warning C4312 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717
Like these:
C:/lo/core/sw/source/ui/dbui/addresslistdialog.cxx(426): warning C4312: 'reinterpret_cast': conversion from 'int' to 'void *' of greater size
Change-Id: Idbfbe8add89c8e219bdabcf28b741e2e31a5e345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163781
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/scanner/scanwin.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/extensions/source/scanner/scanwin.cxx b/extensions/source/scanner/scanwin.cxx index 109f2944a3b5..198b092846cd 100644 --- a/extensions/source/scanner/scanwin.cxx +++ b/extensions/source/scanner/scanwin.cxx @@ -253,9 +253,10 @@ void Twain::ShimListenerThread::execute() ThrowLastError("DuplicateHandle"); // we will not need our copy as soon as shim has its own inherited one ScopedHANDLE hScopedDup(hDup); - DWORD nDup = static_cast<DWORD>(reinterpret_cast<sal_uIntPtr>(hDup)); - if (reinterpret_cast<HANDLE>(nDup) != hDup) - throw std::exception("HANDLE does not fit to 32 bit - cannot pass to shim!"); + sal_uIntPtr nDup = reinterpret_cast<sal_uIntPtr>(hDup); + if constexpr (sizeof(sal_uIntPtr) > 4) + if (nDup > 0xFFFFFFFF) + throw std::exception("HANDLE does not fit to 32 bit - cannot pass to shim!"); // Send this thread handle as the first parameter sCmdLine = "\"" + sCmdLine + "\" " + OUString::number(nDup); |