diff options
author | Don Lewis <truckman@apache.org> | 2016-09-01 00:14:50 +0000 |
---|---|---|
committer | Don Lewis <truckman@apache.org> | 2016-09-01 00:14:50 +0000 |
commit | 6aaac1afdebb39de5b5c43760c13bb64b429f1c8 (patch) | |
tree | e39f9005cd61802c0316936b120721734d16e31f /basebmp | |
parent | 6e3596887a07e85cf0b821baf748980ba86e7d25 (diff) |
Fix -Wshift-negative-value compiler warnings. The result of shifting
negative integer values is undefined, so change the operand to be
unsigned.
Notes
Notes:
prefer: 9885c35ddb9188e5b1549edf8697f6946232f7d3
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/inc/basebmp/packedpixeliterator.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/basebmp/inc/basebmp/packedpixeliterator.hxx b/basebmp/inc/basebmp/packedpixeliterator.hxx index 18bfaeaed6ec..a06b0921df9a 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))); } |