Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63600 - branches/release/boost/math
From: john_at_[hidden]
Date: 2010-07-04 11:47:55


Author: johnmaddock
Date: 2010-07-04 11:47:54 EDT (Sun, 04 Jul 2010)
New Revision: 63600
URL: http://svn.boost.org/trac/boost/changeset/63600

Log:
Fix warnings emitted when char is unsigned.
Text files modified:
   branches/release/boost/math/common_factor_rt.hpp | 9 ++++++++-
   1 files changed, 8 insertions(+), 1 deletions(-)

Modified: branches/release/boost/math/common_factor_rt.hpp
==============================================================================
--- branches/release/boost/math/common_factor_rt.hpp (original)
+++ branches/release/boost/math/common_factor_rt.hpp 2010-07-04 11:47:54 EDT (Sun, 04 Jul 2010)
@@ -19,6 +19,7 @@
 
 #include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
 #include <boost/limits.hpp> // for std::numeric_limits
+#include <climits> // for CHAR_MIN
 #include <boost/detail/workaround.hpp>
 
 
@@ -312,6 +313,10 @@
     BOOST_PRIVATE_GCD_UF( unsigned __int64 );
 #endif
 
+#if CHAR_MIN == 0
+ BOOST_PRIVATE_GCD_UF( char ); // char is unsigned
+#endif
+
 #undef BOOST_PRIVATE_GCD_UF
 
 #define BOOST_PRIVATE_GCD_SF( St, Ut ) \
@@ -326,7 +331,9 @@
     BOOST_PRIVATE_GCD_SF( int, unsigned );
     BOOST_PRIVATE_GCD_SF( long, unsigned long );
 
- BOOST_PRIVATE_GCD_SF( char, unsigned char ); // should work even if unsigned
+#if CHAR_MIN < 0
+ BOOST_PRIVATE_GCD_SF( char, unsigned char ); // char is signed
+#endif
 
 #ifdef BOOST_HAS_LONG_LONG
     BOOST_PRIVATE_GCD_SF( boost::long_long_type, boost::ulong_long_type );


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