Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53539 - trunk/boost/spirit/home/qi/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-06-01 10:55:03


Author: hkaiser
Date: 2009-06-01 10:55:02 EDT (Mon, 01 Jun 2009)
New Revision: 53539
URL: http://svn.boost.org/trac/boost/changeset/53539

Log:
Spirit: refactored loop to avoid warning about assignment in conditional expression
Text files modified:
   trunk/boost/spirit/home/qi/detail/string_parse.hpp | 8 ++++++--
   1 files changed, 6 insertions(+), 2 deletions(-)

Modified: trunk/boost/spirit/home/qi/detail/string_parse.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/detail/string_parse.hpp (original)
+++ trunk/boost/spirit/home/qi/detail/string_parse.hpp 2009-06-01 10:55:02 EDT (Mon, 01 Jun 2009)
@@ -21,11 +21,15 @@
       , Iterator& first, Iterator const& last, Attribute& attr)
     {
         Iterator i = first;
- Char ch;
+ Char ch = *str;
 
- for (; !!(ch = *str); ++str, ++i)
+ for (; !!ch; ++str, ++i)
+ {
             if (i == last || (ch != *i))
                 return false;
+ ch = *str;
+ }
+
         detail::assign_to(first, i, attr);
         first = i;
         return true;


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