diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 16:21:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 20:27:29 +0100 |
commit | b66c5f77d150056b2de262dae66301fcd7dc38c1 (patch) | |
tree | be6cb75524abff6f1fbfda2c62fd2ce5cb132e2f /dtrans/source | |
parent | 86af52b119eaf57b7c1f8943cc1c6631f2044482 (diff) |
loplugin:unsignedcompare (clang-cl)
Change-Id: I69cc1b352221ca053ccd0c5b78e926480a8c9ccd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87884
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'dtrans/source')
-rw-r--r-- | dtrans/source/win32/dtobj/FmtFilter.cxx | 4 | ||||
-rw-r--r-- | dtrans/source/win32/dtobj/XTDataObject.cxx | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx index 74df67541140..e9c4b42f8b68 100644 --- a/dtrans/source/win32/dtobj/FmtFilter.cxx +++ b/dtrans/source/win32/dtobj/FmtFilter.cxx @@ -20,6 +20,8 @@ #include <string.h> #include "FmtFilter.hxx" + +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> #include <shobjidl.h> @@ -176,7 +178,7 @@ HENHMETAFILE OOMFPictToWinENHMFPict( Sequence< sal_Int8 > const & aOOMetaFilePic Sequence< sal_Int8 > WinDIBToOOBMP( const Sequence< sal_Int8 >& aWinDIB ) { - OSL_ENSURE(sal_uInt32(aWinDIB.getLength()) > sizeof(BITMAPINFOHEADER), "CF_DIBV5/CF_DIB too small (!)"); + OSL_ENSURE(o3tl::make_unsigned(aWinDIB.getLength()) > sizeof(BITMAPINFOHEADER), "CF_DIBV5/CF_DIB too small (!)"); Sequence< sal_Int8 > ooBmpStream; ooBmpStream.realloc(aWinDIB.getLength( ) + sizeof(BITMAPFILEHEADER)); diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index 6df5c9d384c1..01b1ce39fce4 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -19,6 +19,7 @@ #include <osl/diagnose.h> #include <o3tl/char16_t2wchar_t.hxx> +#include <o3tl/safeint.hxx> #include "XTDataObject.hxx" #include <com/sun/star/datatransfer/DataFlavor.hpp> @@ -368,11 +369,11 @@ void CXTDataObject::renderAnyDataAndSetupStgMedium( #ifdef DBG_UTIL if(CF_DIBV5 == fetc.cfFormat) { - OSL_ENSURE(sal_uInt32(clipDataStream.getLength()) > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPV5HEADER)), "Wrong size on CF_DIBV5 data (!)"); + OSL_ENSURE(o3tl::make_unsigned(clipDataStream.getLength()) > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPV5HEADER)), "Wrong size on CF_DIBV5 data (!)"); } else // CF_DIB == fetc.cfFormat { - OSL_ENSURE(sal_uInt32(clipDataStream.getLength()) > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)), "Wrong size on CF_DIB data (!)"); + OSL_ENSURE(o3tl::make_unsigned(clipDataStream.getLength()) > (sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)), "Wrong size on CF_DIB data (!)"); } #endif |