summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2014-11-30 23:37:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-03 08:01:46 +0000
commitf4aebede2b575f7572acdccbe74873ccf2c8683d (patch)
treeed0ad5c043d05420bdcd4a67f639e9edfc8d8a55 /filter
parent5f1de30c6373ae41480aad13e49876bfac8a2156 (diff)
Fix "result of 32-bit shift implicitly converted to 64 bits" on WNT x64
On Windows x64 long is only 32-bit (while on other x64 platforms it is typically 64-bit), but sal_uLong is not a typedef for unsigned long, but rather for sal_uIntPtr, which in turn is large enough to take recast pointer values (i.e., always 64-bit on 64-bit platforms). sal_uLong was introduced as a "temporary helper type" to ease transition from the old tools/solar.h types ("ULONG" etc.), but in the long run it should be remove from the code base, and places that now use sal_uLong analysed to use more appropriate types. As short term solution, cast to sal_uLong fixes it. Change-Id: I2169b7858517313616007a8fb2acc5c7d0487719 Reviewed-on: https://gerrit.libreoffice.org/13232 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/itiff/itiff.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 719f51d997c2..c778e807d736 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -498,7 +498,7 @@ void TIFFReader::ReadTagData( sal_uInt16 nTagType, sal_uInt32 nDataLen)
case 0x0140: { // Color Map
sal_uInt16 nVal;
sal_uLong i;
- nNumColors= ( 1UL << nBitsPerSample );
+ nNumColors= ( (sal_uLong)1 << nBitsPerSample );
if ( nDataType == 3 && nNumColors <= 256)
{
pColorMap = new sal_uLong[ 256 ];
@@ -1094,7 +1094,7 @@ void TIFFReader::MakePalCol( void )
pColorMap = new sal_uLong[ 256 ];
if ( nPhotometricInterpretation <= 1 )
{
- nNumColors = 1UL << nBitsPerSample;
+ nNumColors = (sal_uLong)1 << nBitsPerSample;
if ( nNumColors > 256 )
nNumColors = 256;
pAcc->SetPaletteEntryCount( (sal_uInt16)nNumColors );