|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63496 - trunk/boost/math
From: john_at_[hidden]
Date: 2010-07-02 14:54:38
Author: johnmaddock
Date: 2010-07-01 13:47:51 EDT (Thu, 01 Jul 2010)
New Revision: 63496
URL: http://svn.boost.org/trac/boost/changeset/63496
Log:
Fix signed/unsigned comparison warnings when char is unsigned.
Text files modified:
trunk/boost/math/common_factor_rt.hpp | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
Modified: trunk/boost/math/common_factor_rt.hpp
==============================================================================
--- trunk/boost/math/common_factor_rt.hpp (original)
+++ trunk/boost/math/common_factor_rt.hpp 2010-07-01 13:47:51 EDT (Thu, 01 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