signed/unsigned comparison warnings

Change-Id: Ibc091869529ad290f3af3d87c82a5489ba22cc6f
This commit is contained in:
Caolán McNamara
2017-04-02 15:25:24 +01:00
parent 0e261a6908
commit 67bf8ecc6f
2 changed files with 4 additions and 4 deletions

View File

@@ -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<sal_uIntPtr>(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<sal_uIntPtr>(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<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nRealSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
if ( bCompatible )

View File

@@ -178,7 +178,7 @@ void CGM::ImplDoClass1()
{
sal_uInt32 nSize = ImplGetUI(1);
if (mpEndValidSource - (mpSource + mnParaSize) < nSize)
if (static_cast<sal_uIntPtr>(mpEndValidSource - (mpSource + mnParaSize)) < nSize)
throw css::uno::Exception("attempt to read past end of input", nullptr);
pElement->aFontList.InsertName( mpSource + mnParaSize, nSize );