Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82755 - trunk/boost/gil
From: chhenning_at_[hidden]
Date: 2013-02-06 20:26:22


Author: chhenning
Date: 2013-02-05 20:35:03 EST (Tue, 05 Feb 2013)
New Revision: 82755
URL: http://svn.boost.org/trac/boost/changeset/82755

Log:
#7920
Text files modified:
   trunk/boost/gil/channel_algorithm.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/boost/gil/channel_algorithm.hpp
==============================================================================
--- trunk/boost/gil/channel_algorithm.hpp (original)
+++ trunk/boost/gil/channel_algorithm.hpp 2013-02-05 20:35:03 EST (Tue, 05 Feb 2013)
@@ -29,6 +29,7 @@
 #include <boost/mpl/integral_c.hpp>
 #include <boost/mpl/greater.hpp>
 #include <boost/type_traits.hpp>
+#include <boost/integer_traits.hpp>
 
 namespace boost { namespace gil {
 
@@ -51,8 +52,7 @@
 
 
 template <typename UnsignedIntegralChannel>
-//struct unsigned_integral_max_value : public mpl::integral_c<UnsignedIntegralChannel,std::numeric_limits<UnsignedIntegralChannel>::max()> {};
-struct unsigned_integral_max_value : public mpl::integral_c<UnsignedIntegralChannel,UnsignedIntegralChannel(-1)> {};
+struct unsigned_integral_max_value : public mpl::integral_c<UnsignedIntegralChannel,integer_traits< UnsignedIntegralChannel>::const_max> {};
 
 template <>
 struct unsigned_integral_max_value<uint8_t> : public mpl::integral_c<uint32_t,0xFF> {};
@@ -64,7 +64,9 @@
 
 template <int K>
 struct unsigned_integral_max_value<packed_channel_value<K> >
- : public mpl::integral_c<typename packed_channel_value<K>::integer_t, (1<<K)-1> {};
+ : public mpl::integral_c<typename packed_channel_value<K>::integer_t, (uint64_t(1)<<K)-1> {};
+
+
 
 //////////////////////////////////////
 //// unsigned_integral_num_bits - given an unsigned integral channel type, returns the minimum number of bits needed to represent it


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