Author: truckman
Date: Thu Sep  1 00:14:50 2016
New Revision: 1758692

URL: http://svn.apache.org/viewvc?rev=1758692&view=rev
Log:
Fix -Wshift-negative-value compiler warnings.  The result of shifting
negative integer values is undefined, so change the operand to be
unsigned.


Modified:
    openoffice/trunk/main/basebmp/inc/basebmp/packedpixeliterator.hxx
    openoffice/trunk/main/formula/inc/formula/grammar.hxx
    openoffice/trunk/main/vcl/source/gdi/bmpfast.cxx

Modified: openoffice/trunk/main/basebmp/inc/basebmp/packedpixeliterator.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/basebmp/inc/basebmp/packedpixeliterator.hxx?rev=1758692&r1=1758691&r2=1758692&view=diff
==============================================================================
--- openoffice/trunk/main/basebmp/inc/basebmp/packedpixeliterator.hxx (original)
+++ openoffice/trunk/main/basebmp/inc/basebmp/packedpixeliterator.hxx Thu Sep  
1 00:14:50 2016
@@ -51,7 +51,7 @@ inline value_type get_mask( difference_t
     const unsigned int nIntraWordPositions( sizeof(value_type)*8 / 
bits_per_pixel );
 
     //      create bits_per_pixel 1s      shift to intra-word position
-    return ((~(~0 << bits_per_pixel)) << bits_per_pixel*(MsbFirst ? 
+    return ((~(~0u << bits_per_pixel)) << bits_per_pixel*(MsbFirst ? 
                                                          
(nIntraWordPositions-1 - (d % nIntraWordPositions)) : 
                                                          (d % 
nIntraWordPositions)));
 }

Modified: openoffice/trunk/main/formula/inc/formula/grammar.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/formula/inc/formula/grammar.hxx?rev=1758692&r1=1758691&r2=1758692&view=diff
==============================================================================
--- openoffice/trunk/main/formula/inc/formula/grammar.hxx (original)
+++ openoffice/trunk/main/formula/inc/formula/grammar.hxx Thu Sep  1 00:14:50 
2016
@@ -56,9 +56,9 @@ public:
     // Room for 32k hypothetical languages plus EXTERNAL.
     static const int kConventionShift  = 16;
     // Room for 256 reference conventions.
-    static const int kEnglishBit       = (1 << (kConventionShift + 8));
+    static const int kEnglishBit       = (1u << (kConventionShift + 8));
     // Mask off all non-language bits.
-    static const int kFlagMask         = ~((~int(0)) << kConventionShift);
+    static const int kFlagMask         = ~((~0u) << kConventionShift);
 
     /** Values encoding the formula language plus address reference convention
         plus English parsing/formatting

Modified: openoffice/trunk/main/vcl/source/gdi/bmpfast.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/vcl/source/gdi/bmpfast.cxx?rev=1758692&r1=1758691&r2=1758692&view=diff
==============================================================================
--- openoffice/trunk/main/vcl/source/gdi/bmpfast.cxx (original)
+++ openoffice/trunk/main/vcl/source/gdi/bmpfast.cxx Thu Sep  1 00:14:50 2016
@@ -354,7 +354,7 @@ inline void ImplBlendPixels( const TrueC
 {
     if( !nAlphaVal )
         ImplConvertPixel( rDst, rSrc );
-    else if( nAlphaVal != ~(~0 << ALPHABITS) )
+    else if( nAlphaVal != ~(~0u << ALPHABITS) )
     {
         static const unsigned nAlphaShift = (ALPHABITS > 8) ? 8 : ALPHABITS;
         if( ALPHABITS > nAlphaShift )


Reply via email to