diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-08-29 13:30:44 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-08-29 13:31:22 +0200 |
commit | 616197d8077fa3936b609a41557036184d45367d (patch) | |
tree | 770941bb2f9dcf87bc792a69bbdbec088a749371 /include/basebmp | |
parent | make the tinderbox information more reliable in the about dialog (fdo#58034) (diff) | |
download | core-616197d8077fa3936b609a41557036184d45367d.tar.gz core-616197d8077fa3936b609a41557036184d45367d.zip |
left shift of negative values (Clang -fsanitize=undefined)
Change-Id: I1747959bd51f066b017cbf5d161ebe37f3df02e6
Diffstat (limited to 'include/basebmp')
-rw-r--r-- | include/basebmp/packedpixeliterator.hxx | 2 | ||||
-rw-r--r-- | include/basebmp/polypolygonrenderer.hxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/basebmp/packedpixeliterator.hxx b/include/basebmp/packedpixeliterator.hxx index 89a88506bbcd..55cc1742d4c5 100644 --- a/include/basebmp/packedpixeliterator.hxx +++ b/include/basebmp/packedpixeliterator.hxx @@ -47,7 +47,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/include/basebmp/polypolygonrenderer.hxx b/include/basebmp/polypolygonrenderer.hxx index 80f73ac01279..09bd18adc493 100644 --- a/include/basebmp/polypolygonrenderer.hxx +++ b/include/basebmp/polypolygonrenderer.hxx @@ -39,7 +39,7 @@ namespace basebmp namespace detail { /// convert int32 to 32:32 fixed point - inline sal_Int64 toFractional( sal_Int32 v ) { return (sal_Int64)v << 32; } + inline sal_Int64 toFractional( sal_Int32 v ) { return sal_Int64(sal_uInt64(v) << 32); } /// convert double to 32:32 fixed point inline sal_Int64 toFractional( double v ) { return (sal_Int64)(v*SAL_MAX_UINT32 + (v < 0.0 ? -0.5 : 0.5 )); } /// convert 32:32 fixed point to int32 (truncate) |