This is an automated email from the ASF dual-hosted git repository.

arielch pushed a commit to branch AOO418
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit a529b01c2d1a87a60a38458297ce61ce4b693866
Author: truckman <truckman@13f79535-47bb-0310-9956-ffa450edef68>
AuthorDate: Thu Sep 1 00:14:50 2016 +0000

    Fix -Wshift-negative-value compiler warnings.  The result of shifting
    negative integer values is undefined, so change the operand to be
    unsigned.
    
    
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1758692 
13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit b296461cbb97e87a3394616aaf6cc6e89aafbd4c)
---
 main/basebmp/inc/basebmp/packedpixeliterator.hxx | 2 +-
 main/formula/inc/formula/grammar.hxx             | 4 ++--
 main/vcl/source/gdi/bmpfast.cxx                  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/main/basebmp/inc/basebmp/packedpixeliterator.hxx 
b/main/basebmp/inc/basebmp/packedpixeliterator.hxx
index d345fab..58a119f 100644
--- a/main/basebmp/inc/basebmp/packedpixeliterator.hxx
+++ b/main/basebmp/inc/basebmp/packedpixeliterator.hxx
@@ -51,7 +51,7 @@ inline value_type get_mask( difference_type d )
     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)));
 }
diff --git a/main/formula/inc/formula/grammar.hxx 
b/main/formula/inc/formula/grammar.hxx
index acd4682..b53fdcf 100644
--- a/main/formula/inc/formula/grammar.hxx
+++ b/main/formula/inc/formula/grammar.hxx
@@ -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
diff --git a/main/vcl/source/gdi/bmpfast.cxx b/main/vcl/source/gdi/bmpfast.cxx
index 77deb1e..5278673 100644
--- a/main/vcl/source/gdi/bmpfast.cxx
+++ b/main/vcl/source/gdi/bmpfast.cxx
@@ -354,7 +354,7 @@ inline void ImplBlendPixels( const 
TrueColorPixelPtr<DSTFMT>& rDst,
 {
     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