Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53540 - branches/release/boost/spirit/home/qi/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-06-01 10:56:11


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

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

Modified: branches/release/boost/spirit/home/qi/detail/string_parse.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/detail/string_parse.hpp (original)
+++ branches/release/boost/spirit/home/qi/detail/string_parse.hpp 2009-06-01 10:56:10 EDT (Mon, 01 Jun 2009)
@@ -17,11 +17,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