Commit eba7452b by Paolo Carlini Committed by Paolo Carlini

locale_facets.tcc (num_get<>::do_get(bool&)): Evaluate __beg == __end the exact…

locale_facets.tcc (num_get<>::do_get(bool&)): Evaluate __beg == __end the exact strict minimum number of times.

2004-11-04  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/locale_facets.tcc (num_get<>::do_get(bool&)):
	Evaluate __beg == __end the exact strict minimum number of times.

From-SVN: r90058
parent ab3d1049
2004-11-04 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_get<>::do_get(bool&)):
Evaluate __beg == __end the exact strict minimum number of times.
2004-11-03 Jonathan Wakely <redi@gcc.gnu.org>
* include/bits/stl_numeric.h (partial_sum, adjacent_difference):
......
......@@ -687,7 +687,8 @@ namespace std
bool __testf = true;
bool __testt = true;
size_t __n;
for (__n = 0; __beg != __end; ++__n, ++__beg)
bool __testeof = __beg == __end;
for (__n = 0; !__testeof; ++__n)
{
const char_type __c = *__beg;
......@@ -705,6 +706,9 @@ namespace std
if (!__testf && !__testt)
break;
if (++__beg == __end)
__testeof = true;
}
if (__testf && __n == __lc->_M_falsename_size)
__v = 0;
......@@ -713,7 +717,7 @@ namespace std
else
__err |= ios_base::failbit;
if (__beg == __end)
if (__testeof)
__err |= ios_base::eofbit;
}
return __beg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment