Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-10-05 02:50:03


Author: eric_niebler
Date: 2007-10-05 02:50:00 EDT (Fri, 05 Oct 2007)
New Revision: 39690
URL: http://svn.boost.org/trac/boost/changeset/39690

Log:
one more try at getting tru64 tests to pass
Text files modified:
   trunk/boost/xpressive/match_results.hpp | 32 ++++++++++----------------------
   1 files changed, 10 insertions(+), 22 deletions(-)

Modified: trunk/boost/xpressive/match_results.hpp
==============================================================================
--- trunk/boost/xpressive/match_results.hpp (original)
+++ trunk/boost/xpressive/match_results.hpp 2007-10-05 02:50:00 EDT (Fri, 05 Oct 2007)
@@ -92,8 +92,8 @@
 ///////////////////////////////////////////////////////////////////////////////
 // transform_op enum
 //
-enum transform_op { None, Upper, Lower };
-enum transform_scope { Next, Rest };
+enum transform_op { None = 0, Upper = 1, Lower = 2 };
+enum transform_scope { Next = 0, Rest = 1 };
 
 ///////////////////////////////////////////////////////////////////////////////
 // case_converting_iterator
@@ -134,6 +134,7 @@
 
     friend bool set_transform(case_converting_iterator &iter, transform_op trans, transform_scope scope)
     {
+ BOOST_ASSERT(scope == Next || scope == Rest);
         if(scope == Next)
             iter.next_ = trans;
         else
@@ -141,36 +142,23 @@
         return true;
     }
 
- case_converting_iterator &operator =(Char const &ch)
+ case_converting_iterator &operator =(Char ch)
     {
- switch(this->next_)
+ switch(this->next_ ? this->next_ : this->rest_)
         {
         case Lower:
- *this->out_ = this->traits_->tolower(ch);
- this->next_ = None;
+ ch = this->traits_->tolower(ch);
             break;
 
         case Upper:
- *this->out_ = this->traits_->toupper(ch);
- this->next_ = None;
+ ch = this->traits_->toupper(ch);
             break;
 
- default:
- switch(this->rest_)
- {
- case Lower:
- *this->out_ = this->traits_->tolower(ch);
- break;
-
- case Upper:
- *this->out_ = this->traits_->toupper(ch);
- break;
-
- default:
- *this->out_ = ch;
- }
+ default:;
         }
 
+ *this->out_ = ch;
+ this->next_ = None;
         return *this;
     }
 


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