diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-22 10:01:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-27 08:22:09 +0200 |
commit | 862dc17e437f0972223e18555110dc875d2ffa44 (patch) | |
tree | 3b8e33815f337b262b7a42e01af64acae4912b0e /vcl/source/fontsubset/cff.cxx | |
parent | 50af4bf5c67eaac39d02cfe20584906eec058235 (diff) |
loplugin:expressionalwayszero improvements
Change-Id: I00bdbc58d2295a0be30b47c85eae6b9abfec17b2
Reviewed-on: https://gerrit.libreoffice.org/51868
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/fontsubset/cff.cxx')
-rw-r--r-- | vcl/source/fontsubset/cff.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index 3c759cddd067..13ed076d1ff6 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -533,12 +533,10 @@ void CffSubsetterContext::readDictOp() read2push(); } else if( c == 29 ) { // longint ++mpReadPtr; // skip 29 - int nS32 = mpReadPtr[0] << 24; + sal_Int32 nS32 = mpReadPtr[0] << 24; nS32 += mpReadPtr[1] << 16; nS32 += mpReadPtr[2] << 8; nS32 += mpReadPtr[3] << 0; - if( (sizeof(nS32) != 4) && (nS32 & (1U<<31))) - nS32 |= (~0U) << 31; // assuming 2s complement mpReadPtr += 4; ValType nVal = static_cast<ValType>(nS32); push( nVal ); @@ -558,9 +556,7 @@ void CffSubsetterContext::read2push() const U8*& p = mpReadPtr; const U8 c = *p; if( c == 28 ) { - short nS16 = (p[1] << 8) + p[2]; - if( (sizeof(nS16) != 2) && (nS16 & (1<<15))) - nS16 |= (~0U) << 15; // assuming 2s complement + sal_Int16 nS16 = (p[1] << 8) + p[2]; aVal = nS16; p += 3; } else if( c <= 246 ) { // -107..+107 |