[Libreoffice-commits] core.git: Branch 'aoo/trunk' - basebmp/inc formula/inc vcl/source

Don Lewis truckman at apache.org
Thu Sep 1 02:08:08 UTC 2016


 basebmp/inc/basebmp/packedpixeliterator.hxx |    2 +-
 formula/inc/formula/grammar.hxx             |    4 ++--
 vcl/source/gdi/bmpfast.cxx                  |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 6aaac1afdebb39de5b5c43760c13bb64b429f1c8
Author: Don Lewis <truckman at apache.org>
Date:   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.

diff --git a/basebmp/inc/basebmp/packedpixeliterator.hxx b/basebmp/inc/basebmp/packedpixeliterator.hxx
index 18bfaea..a06b092 100644
--- a/basebmp/inc/basebmp/packedpixeliterator.hxx
+++ b/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/formula/inc/formula/grammar.hxx b/formula/inc/formula/grammar.hxx
index 05debbd..65f97fb 100644
--- a/formula/inc/formula/grammar.hxx
+++ b/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/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 5cd4bcf..9d7ea9c 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/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 )


More information about the Libreoffice-commits mailing list