Commit fa4262a4 by Paolo Carlini Committed by Paolo Carlini

PR libstdc++/37958 (cont)

2008-11-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/37958 (cont)
	* include/bits/locale_facets.tcc (num_get<>::do_get(iter_type,
	iter_type, ios_base&, ios_base::iostate&, bool&): Fix again.

From-SVN: r141517
parent 12f681a0
2008-11-01 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/37958 (cont)
* include/bits/locale_facets.tcc (num_get<>::do_get(iter_type,
iter_type, ios_base&, ios_base::iostate&, bool&): Fix again.
2008-11-01 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/shared_ptr.h: Update comparisons to match WP.
......
......@@ -604,58 +604,47 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
const locale& __loc = __io._M_getloc();
const __cache_type* __lc = __uc(__loc);
bool __testf = false;
bool __donef = false;
bool __testt = false;
bool __donet = false;
bool __testf = true;
bool __testt = true;
bool __testeof = false;
size_t __n;
bool __testeof = __beg == __end;
for (__n = 0; !__testeof; ++__n)
{
const char_type __c = *__beg;
if (!__donef)
const size_t __lim = std::max(__lc->_M_falsename_size,
__lc->_M_truename_size);
for (__n = 0; __n < __lim; ++__n, ++__beg)
{
if (__beg == __end)
{
if (__n < __lc->_M_falsename_size)
{
__testf = __c == __lc->_M_falsename[__n];
if (!__testf)
__donef = true;
}
else
__donef = true;
__testeof = true;
break;
}
if (!__donet)
{
if (__n < __lc->_M_truename_size)
{
__testt = __c == __lc->_M_truename[__n];
if (!__testt)
__donet = true;
}
else
__donet = true;
}
const char_type __c = *__beg;
if (__donef && __donet)
if (__testf && __n < __lc->_M_falsename_size)
__testf = __c == __lc->_M_falsename[__n];
if (__testt && __n < __lc->_M_truename_size)
__testt = __c == __lc->_M_truename[__n];
if (!__testt && !__testf)
break;
if (++__beg == __end)
__testeof = true;
}
if (__testf && __n == __lc->_M_falsename_size)
if ((!__testt && __n >= __lc->_M_falsename_size)
|| (!__testf && __n >= __lc->_M_truename_size))
break;
}
if (__testf && __n == __lc->_M_falsename_size && __n)
{
__v = false;
if (__testt && __n == __lc->_M_truename_size)
__err = ios_base::failbit;
else
__err = __donet ? ios_base::goodbit : ios_base::eofbit;
__err = __testeof ? ios_base::eofbit : ios_base::goodbit;
}
else if (__testt && __n == __lc->_M_truename_size)
else if (__testt && __n == __lc->_M_truename_size && __n)
{
__v = true;
__err = __donef ? ios_base::goodbit : ios_base::eofbit;
__err = __testeof ? ios_base::eofbit : ios_base::goodbit;
}
else
{
......@@ -663,10 +652,10 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
// 23. Num_get overflow result.
__v = false;
__err = ios_base::failbit;
if (__testeof && __n)
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