locale_facets.h (_Format_cache): _S_ecks -> _S_x.

2000-06-02  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	* bits/locale_facets.h (_Format_cache): _S_ecks -> _S_x.
	* bits/locale_facets.tcc (num_get<char>::_M_extract): Fix for hex.

From-SVN: r34365
This commit is contained in:
Benjamin Kosnik 2000-06-02 19:41:42 +00:00 committed by Benjamin Kosnik
parent 2f8edb39a1
commit c9b39473f3
3 changed files with 29 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2000-06-02 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/locale_facets.h (_Format_cache): _S_ecks -> _S_x.
* bits/locale_facets.tcc (num_get<char>::_M_extract): Fix for hex.
2000-06-02 Anthony Williams <anthony@anthonyw.cjb.net> 2000-06-02 Anthony Williams <anthony@anthonyw.cjb.net>
* testsuite/21_strings/replace.cc (test01): Qualify find with std::. * testsuite/21_strings/replace.cc (test01): Qualify find with std::.

View File

@ -783,8 +783,8 @@ namespace std
{ {
_S_minus, _S_minus,
_S_plus, _S_plus,
_S_ecks, _S_x,
_S_Ecks, _S_X,
_S_digits, _S_digits,
_S_digits_end = _S_digits + 16, _S_digits_end = _S_digits + 16,
_S_udigits = _S_digits_end, _S_udigits = _S_digits_end,

View File

@ -333,30 +333,42 @@ namespace std
{ {
if (__testEE) if (__testEE)
{ {
if (__testEEsign) break; if (__testEEsign)
break;
__testEEsign = true; __testEEsign = true;
} }
else else
{ {
if (__testsign) break; if (__testsign)
break;
__testsign = true; __testsign = true;
} }
} }
// Check for exponential part and accept if appropriate. // Check for exponential part and accept if appropriate.
else if ((__p == &__lits[__cache_type::_S_ee]) else if ((__p == &__lits[__cache_type::_S_ee])
|| (__p == &__lits[__cache_type::_S_Ee])) || (__p == &__lits[__cache_type::_S_Ee]))
{
if (!__fp || __testEE || !__testsign)
break;
__testEE = true;
}
// Check for hexadecimal base parts.
else if ((__p == &__lits[__cache_type::_S_x])
|| (__p == &__lits[__cache_type::_S_X]))
{ {
if (!__fp || __testEE || !__testsign) break; if (__base != 16
__testEE = true; && __xtrc[__pos - 1] != __lits[__cache_type::_S_digits])
break;
} }
// Check for appropriate digits. If found, too late for a sign // Check for appropriate digits. If found, too late for a sign
else if ((__p >= &__lits[__cache_type::_S_digits] else if ((__p >= &__lits[__cache_type::_S_digits]
&& __p < &__lits[__cache_type::_S_digits+__base]) && __p < &__lits[__cache_type::_S_digits + __base])
|| (__p >= &__lits[__cache_type::_S_udigits] || (__p >= &__lits[__cache_type::_S_udigits]
&& __p < &__lits[__cache_type::_S_udigits+__base])) && __p < &__lits[__cache_type::_S_udigits + __base]))
{ {
__testsign = true; __testsign = true;
if (__testEE) __testEEsign = true; if (__testEE)
__testEEsign = true;
} }
// Nothing else will do // Nothing else will do
else break; else break;
@ -1033,7 +1045,7 @@ namespace std
__sign_end = __front; __sign_end = __front;
if (__flags & ios_base::showbase) if (__flags & ios_base::showbase)
{ {
*--__front = __fmt->_S_literals[__fmt->_S_ecks + *--__front = __fmt->_S_literals[__fmt->_S_x +
((__flags & ios_base::uppercase) ? 1 : 0)]; ((__flags & ios_base::uppercase) ? 1 : 0)];
*--__front = __table[0]; *--__front = __table[0];
} }