Boost logo

Boost-Commit :

From: zeux_at_[hidden]
Date: 2007-06-12 07:59:01


Author: zeux
Date: 2007-06-12 07:59:00 EDT (Tue, 12 Jun 2007)
New Revision: 6997
URL: http://svn.boost.org/trac/boost/changeset/6997

Log:
Removed last gcc warning, hooray!

Text files modified:
   sandbox/SOC/2007/bigint/boost/bigint/bigint_gmp.hpp | 3 ++-
   sandbox/SOC/2007/bigint/boost/bigint/bigint_util.hpp | 10 ++++++++++
   2 files changed, 12 insertions(+), 1 deletions(-)

Modified: sandbox/SOC/2007/bigint/boost/bigint/bigint_gmp.hpp
==============================================================================
--- sandbox/SOC/2007/bigint/boost/bigint/bigint_gmp.hpp (original)
+++ sandbox/SOC/2007/bigint/boost/bigint/bigint_gmp.hpp 2007-06-12 07:59:00 EDT (Tue, 12 Jun 2007)
@@ -138,7 +138,8 @@
                         
                         for (size_t i = 0; i < d_size; ++i)
                         {
- if (static_cast<int>(*str) < 0 || static_cast<int>(*str) > 127 || digit_value_tab[static_cast<unsigned int>(*str)] >= base)
+ if (!detail::bigint::is_ascii(*str) || digit_value_tab[static_cast<unsigned int>(*str)] >= base
+ )
                                 {
                                         d_size = i;
                                         break;

Modified: sandbox/SOC/2007/bigint/boost/bigint/bigint_util.hpp
==============================================================================
--- sandbox/SOC/2007/bigint/boost/bigint/bigint_util.hpp (original)
+++ sandbox/SOC/2007/bigint/boost/bigint/bigint_util.hpp 2007-06-12 07:59:00 EDT (Tue, 12 Jun 2007)
@@ -35,6 +35,16 @@
                 return ::iswspace(ch) != 0;
         }
 
+ inline bool is_ascii(char ch)
+ {
+ return ch > 0;
+ }
+
+ inline bool is_ascii(wchar_t ch)
+ {
+ return ch > 0 && ch < 128;
+ }
+
         inline size_t length(const char* str)
         {
                 return ::strlen(str);


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