Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61496 - trunk/boost/gil
From: hljin_at_[hidden]
Date: 2010-04-22 18:49:16


Author: hljin
Date: 2010-04-22 18:49:14 EDT (Thu, 22 Apr 2010)
New Revision: 61496
URL: http://svn.boost.org/trac/boost/changeset/61496

Log:
GIL: added some explicit static_cast to avoid warnings
Text files modified:
   trunk/boost/gil/channel.hpp | 10 +++++-----
   1 files changed, 5 insertions(+), 5 deletions(-)

Modified: trunk/boost/gil/channel.hpp
==============================================================================
--- trunk/boost/gil/channel.hpp (original)
+++ trunk/boost/gil/channel.hpp 2010-04-22 18:49:14 EDT (Thu, 22 Apr 2010)
@@ -365,7 +365,7 @@
     typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,false>,BitField,NumBits,false> parent_t;
     friend class packed_channel_reference<BitField,FirstBit,NumBits,true>;
 
- static const BitField channel_mask = parent_t::max_val<<FirstBit;
+ static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
     void operator=(const packed_channel_reference&);
 public:
     typedef const packed_channel_reference<BitField,FirstBit,NumBits,false> const_reference;
@@ -389,7 +389,7 @@
     typedef detail::packed_channel_reference_base<packed_channel_reference<BitField,FirstBit,NumBits,true>,BitField,NumBits,true> parent_t;
     friend class packed_channel_reference<BitField,FirstBit,NumBits,false>;
 
- static const BitField channel_mask = parent_t::max_val<<FirstBit;
+ static const BitField channel_mask = static_cast< BitField >( parent_t::max_val ) << FirstBit;
 public:
     typedef const packed_channel_reference<BitField,FirstBit,NumBits,false> const_reference;
     typedef const packed_channel_reference<BitField,FirstBit,NumBits,true> mutable_reference;
@@ -408,7 +408,7 @@
     unsigned first_bit() const { return FirstBit; }
 
     integer_t get() const { return integer_t((this->get_data()&channel_mask) >> FirstBit); }
- void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (value<<FirstBit)); }
+ void set_unsafe(integer_t value) const { this->set_data((this->get_data() & ~channel_mask) | (( static_cast< BitField >( value )<<FirstBit))); }
 private:
     void set_from_reference(const BitField& other_bits) const { this->set_data((this->get_data() & ~channel_mask) | (other_bits & channel_mask)); }
 };
@@ -490,7 +490,7 @@
 
     integer_t get() const {
         const BitField channel_mask = parent_t::max_val<<_first_bit;
- return (this->get_data()&channel_mask) >> _first_bit;
+ return ( static_cast< integer_t >( this->get_data()&channel_mask ) >> _first_bit );
     }
 };
 
@@ -525,7 +525,7 @@
 
     integer_t get() const {
         const BitField channel_mask = parent_t::max_val<<_first_bit;
- return (this->get_data()&channel_mask) >> _first_bit;
+ return ( static_cast< integer_t >( this->get_data()&channel_mask ) >> _first_bit );
     }
     void set_unsafe(integer_t value) const {
         const BitField channel_mask = parent_t::max_val<<_first_bit;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk