Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49454 - in trunk/boost/spirit/home/support: . char_class
From: hartmut.kaiser_at_[hidden]
Date: 2008-10-25 20:13:20


Author: hkaiser
Date: 2008-10-25 20:13:20 EDT (Sat, 25 Oct 2008)
New Revision: 49454
URL: http://svn.boost.org/trac/boost/changeset/49454

Log:
Spirit: Applied Joel's fix for ISO8859/1 charclass.
Text files modified:
   trunk/boost/spirit/home/support/char_class.hpp | 32 ++++++++++++++++++--------------
   trunk/boost/spirit/home/support/char_class/iso8859_1.hpp | 2 +-
   2 files changed, 19 insertions(+), 15 deletions(-)

Modified: trunk/boost/spirit/home/support/char_class.hpp
==============================================================================
--- trunk/boost/spirit/home/support/char_class.hpp (original)
+++ trunk/boost/spirit/home/support/char_class.hpp 2008-10-25 20:13:20 EDT (Sat, 25 Oct 2008)
@@ -78,88 +78,90 @@
     template <typename CharSet>
     struct classify
     {
+ typedef typename CharSet::char_type char_type;
+
         template <typename Char>
         static bool
         is(tag::alnum, Char ch)
         {
- return CharSet::isalnum(ch);
+ return CharSet::isalnum(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::alpha, Char ch)
         {
- return CharSet::isalpha(ch);
+ return CharSet::isalpha(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::digit, Char ch)
         {
- return CharSet::isdigit(ch);
+ return CharSet::isdigit(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::xdigit, Char ch)
         {
- return CharSet::isxdigit(ch);
+ return CharSet::isxdigit(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::cntrl, Char ch)
         {
- return CharSet::iscntrl(ch);
+ return CharSet::iscntrl(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::graph, Char ch)
         {
- return CharSet::isgraph(ch);
+ return CharSet::isgraph(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::lower, Char ch)
         {
- return CharSet::islower(ch);
+ return CharSet::islower(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::print, Char ch)
         {
- return CharSet::isprint(ch);
+ return CharSet::isprint(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::punct, Char ch)
         {
- return CharSet::ispunct(ch);
+ return CharSet::ispunct(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::space, Char ch)
         {
- return CharSet::isspace(ch);
+ return CharSet::isspace(char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::blank, Char ch)
         {
- return CharSet::isblank BOOST_PREVENT_MACRO_SUBSTITUTION (ch);
+ return CharSet::isblank BOOST_PREVENT_MACRO_SUBSTITUTION (char_type(ch));
         }
 
         template <typename Char>
         static bool
         is(tag::upper, Char ch)
         {
- return CharSet::isupper(ch);
+ return CharSet::isupper(char_type(ch));
         }
     };
 
@@ -167,18 +169,20 @@
     template <typename CharSet>
     struct convert
     {
+ typedef typename CharSet::char_type char_type;
+
         template <typename Char>
         static Char
         to(tag::lower, Char ch)
         {
- return CharSet::tolower(ch);
+ return CharSet::tolower(char_type(ch));
         }
 
         template <typename Char>
         static Char
         to(tag::upper, Char ch)
         {
- return CharSet::toupper(ch);
+ return CharSet::toupper(char_type(ch));
         }
     };
 

Modified: trunk/boost/spirit/home/support/char_class/iso8859_1.hpp
==============================================================================
--- trunk/boost/spirit/home/support/char_class/iso8859_1.hpp (original)
+++ trunk/boost/spirit/home/support/char_class/iso8859_1.hpp 2008-10-25 20:13:20 EDT (Sat, 25 Oct 2008)
@@ -562,7 +562,7 @@
     ///////////////////////////////////////////////////////////////////////////
     struct iso8859_1
     {
- typedef char char_type;
+ typedef unsigned char char_type;
 
         static bool
         is_ascii(int ch)


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