From 67bf8ecc6fb0018bf196bc59df736d2cbda7d053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 2 Apr 2017 15:25:24 +0100 Subject: [PATCH] signed/unsigned comparison warnings Change-Id: Ibc091869529ad290f3af3d87c82a5489ba22cc6f --- filter/source/graphicfilter/icgm/cgm.cxx | 6 +++--- filter/source/graphicfilter/icgm/class1.cxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 6f0d171abfa5..714c4d73757e 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -113,7 +113,7 @@ sal_uInt8 CGM::ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision ) sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision ) { sal_uInt8* pSource = mpSource + mnParaSize; - if (mpEndValidSource - pSource < nPrecision) + if (static_cast(mpEndValidSource - pSource) < nPrecision) throw css::uno::Exception("attempt to read past end of input", nullptr); mnParaSize += nPrecision; switch( nPrecision ) @@ -145,7 +145,7 @@ sal_Int32 CGM::ImplGetI( sal_uInt32 nPrecision ) sal_uInt32 CGM::ImplGetUI( sal_uInt32 nPrecision ) { sal_uInt8* pSource = mpSource + mnParaSize; - if (mpEndValidSource - pSource < nPrecision) + if (static_cast(mpEndValidSource - pSource) < nPrecision) throw css::uno::Exception("attempt to read past end of input", nullptr); mnParaSize += nPrecision; switch( nPrecision ) @@ -200,7 +200,7 @@ double CGM::ImplGetFloat( RealPrecision eRealPrecision, sal_uInt32 nRealSize ) const bool bCompatible = false; #endif - if (mpEndValidSource - (mpSource + mnParaSize) < nRealSize) + if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) < nRealSize) throw css::uno::Exception("attempt to read past end of input", nullptr); if ( bCompatible ) diff --git a/filter/source/graphicfilter/icgm/class1.cxx b/filter/source/graphicfilter/icgm/class1.cxx index 4d41add2448c..0d297bbe0a10 100644 --- a/filter/source/graphicfilter/icgm/class1.cxx +++ b/filter/source/graphicfilter/icgm/class1.cxx @@ -178,7 +178,7 @@ void CGM::ImplDoClass1() { sal_uInt32 nSize = ImplGetUI(1); - if (mpEndValidSource - (mpSource + mnParaSize) < nSize) + if (static_cast(mpEndValidSource - (mpSource + mnParaSize)) < nSize) throw css::uno::Exception("attempt to read past end of input", nullptr); pElement->aFontList.InsertName( mpSource + mnParaSize, nSize );