diff --git a/include/boost/gil/channel_algorithm.hpp b/include/boost/gil/channel_algorithm.hpp index 8f112ca8a..20f53dde1 100644 --- a/include/boost/gil/channel_algorithm.hpp +++ b/include/boost/gil/channel_algorithm.hpp @@ -329,7 +329,7 @@ template <> struct channel_convert_to_unsigned : public std::unary_func template <> struct channel_convert_to_unsigned : public std::unary_function { typedef bits32 type; - type operator()(bits32s x) const { return static_cast(x+(1<<31)); } + type operator()(bits32s x) const { return static_cast(x)+(1u<<31); } }; @@ -352,7 +352,7 @@ template <> struct channel_convert_from_unsigned : public std::unary_fu template <> struct channel_convert_from_unsigned : public std::unary_function { typedef bits32s type; - type operator()(bits32 x) const { return static_cast(x-(1<<31)); } + type operator()(bits32 x) const { return static_cast(x-(1u<<31)); } }; } // namespace detail diff --git a/include/boost/gil/extension/io/formats/bmp/reader_backend.hpp b/include/boost/gil/extension/io/formats/bmp/reader_backend.hpp index f7631d5ce..de294996d 100644 --- a/include/boost/gil/extension/io/formats/bmp/reader_backend.hpp +++ b/include/boost/gil/extension/io/formats/bmp/reader_backend.hpp @@ -189,7 +189,7 @@ public: if( entries == 0 ) { - entries = 1 << this->_info._bits_per_pixel; + entries = 1u << this->_info._bits_per_pixel; } _palette.resize( entries, rgba8_pixel_t(0, 0, 0, 0)); diff --git a/include/boost/gil/extension/io/formats/bmp/scanline_read.hpp b/include/boost/gil/extension/io/formats/bmp/scanline_read.hpp index e500c45d2..eaf761e56 100644 --- a/include/boost/gil/extension/io/formats/bmp/scanline_read.hpp +++ b/include/boost/gil/extension/io/formats/bmp/scanline_read.hpp @@ -289,7 +289,7 @@ private: if( entries == 0 ) { - entries = 1 << this->_info._bits_per_pixel; + entries = 1u << this->_info._bits_per_pixel; } this->_palette.resize( entries, rgba8_pixel_t(0,0,0,0) ); diff --git a/include/boost/gil/extension/io/formats/bmp/write.hpp b/include/boost/gil/extension/io/formats/bmp/write.hpp index 7bdea358c..335dff600 100644 --- a/include/boost/gil/extension/io/formats/bmp/write.hpp +++ b/include/boost/gil/extension/io/formats/bmp/write.hpp @@ -111,7 +111,7 @@ private: /// in this context. if( bpp <= 8 ) { - entries = 1 << bpp; + entries = 1u << bpp; } */ diff --git a/include/boost/gil/extension/io/formats/png/writer_backend.hpp b/include/boost/gil/extension/io/formats/png/writer_backend.hpp index c5934f6f6..f049f5bdd 100644 --- a/include/boost/gil/extension/io/formats/png/writer_backend.hpp +++ b/include/boost/gil/extension/io/formats/png/writer_backend.hpp @@ -355,7 +355,7 @@ protected: if( _info._valid_transparency_factors ) { - int sample_max = ( 1 << _info._bit_depth ); + int sample_max = ( 1u << _info._bit_depth ); /* libpng doesn't reject a tRNS chunk with out-of-range samples */ if( !( ( _info._color_type == PNG_COLOR_TYPE_GRAY