From 6aaac1afdebb39de5b5c43760c13bb64b429f1c8 Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Thu, 1 Sep 2016 00:14:50 +0000 Subject: Fix -Wshift-negative-value compiler warnings. The result of shifting negative integer values is undefined, so change the operand to be unsigned. --- basebmp/inc/basebmp/packedpixeliterator.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'basebmp') 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))); } -- cgit