Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56343 - trunk/boost/spirit/home/support/char_encoding
From: hartmut.kaiser_at_[hidden]
Date: 2009-09-21 13:54:35


Author: hkaiser
Date: 2009-09-21 13:54:33 EDT (Mon, 21 Sep 2009)
New Revision: 56343
URL: http://svn.boost.org/trac/boost/changeset/56343

Log:
Spirit: silencing a warning
Text files modified:
   trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp | 13 +++++++++----
   1 files changed, 9 insertions(+), 4 deletions(-)

Modified: trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp
==============================================================================
--- trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp (original)
+++ trunk/boost/spirit/home/support/char_encoding/standard_wide.hpp 2009-09-21 13:54:33 EDT (Mon, 21 Sep 2009)
@@ -60,10 +60,15 @@
         static bool
         ischar(int ch)
         {
- // we have to watch out for sign extensions
- return ( 0 == (ch & ~traits::wchar_t_size<sizeof(wchar_t)>::mask) ||
- ~0 == (ch | traits::wchar_t_size<sizeof(wchar_t)>::mask)) ?
- true : false; // any wchar_t, but no other bits set
+ // we have to watch out for sign extensions (casting is there to
+ // silence certain compilers complaining about signed/unsigned
+ // mismatch)
+ return (
+ std::size_t(0) ==
+ std::size_t(ch & ~traits::wchar_t_size<sizeof(wchar_t)>::mask) ||
+ std::size_t(~0) ==
+ std::size_t(ch | traits::wchar_t_size<sizeof(wchar_t)>::mask)
+ ) ? true : false; // any wchar_t, but no other bits set
         }
 
         static bool


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