Commit cc4316b5 by Benjamin Kosnik Committed by Benjamin Kosnik

locale_facets.h: Tweak.


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

	* bits/locale_facets.h: Tweak.
	* src/locale.cc (codecvt<wchar_t>): Tweak.

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

	* bits/basic_string.h: Move data member up.
	* src/string-inst.cc: Fix instantiations.
	* bits/string.tcc: Fix types.

From-SVN: r34371
parent 3378216a
2000-06-02 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* bits/locale_facets.h: Tweak.
* src/locale.cc (codecvt<wchar_t>): Tweak.
* bits/locale_facets.h (_Format_cache): _S_ecks -> _S_x.
* bits/locale_facets.tcc (num_get<char>::_M_extract): Fix for hex.
* bits/basic_string.h: Move data member up.
* src/string-inst.cc: Fix instantiations.
* bits/string.tcc: Fix types.
2000-06-02 Anthony Williams <anthony@anthonyw.cjb.net>
* testsuite/21_strings/replace.cc (test01): Qualify find with std::.
......
......@@ -97,11 +97,6 @@ namespace std {
typedef reverse_iterator<const_iterator> const_reverse_iterator;
typedef reverse_iterator<iterator> reverse_iterator;
// Data Members:
// NB: This is an unsigned type, and thus represents the maximum
// size that the allocator can hold.
static const size_type npos = static_cast<size_type>(-1);
private:
// _Rep: string representation
// Invariants:
......@@ -222,8 +217,20 @@ namespace std {
_CharT* _M_p; // The actual data.
};
public:
// Data Members (public):
// NB: This is an unsigned type, and thus represents the maximum
// size that the allocator can hold.
static const size_type npos = static_cast<size_type>(-1);
private:
// Data Members (private):
mutable _Alloc_hider _M_dataplus;
// The following storage is init'd to 0 by the linker, resulting
// (carefully) in an empty string with one reference.
static size_type _S_empty_rep_storage[(sizeof(_Rep) + sizeof(_CharT) + sizeof(size_type) - 1)/sizeof(size_type)];
_CharT*
_M_data() const
{ return _M_dataplus._M_p; }
......@@ -299,14 +306,9 @@ namespace std {
void
_M_leak_hard();
// The following storage is init'd to 0 by the linker, resulting
// (carefully) in an empty string with one reference.
static size_type _S_empty_rep_storage[
(sizeof(_Rep) + sizeof(_CharT) + sizeof(size_type)-1)/sizeof(size_type)];
static _Rep&
_S_empty_rep()
{ return *reinterpret_cast<_Rep*> (&_S_empty_rep_storage); }
{ return *reinterpret_cast<_Rep*>(&_S_empty_rep_storage); }
public:
// Construct/copy/destroy:
......@@ -840,7 +842,7 @@ namespace std {
private:
static const _CharT*
_S_find (const _CharT* __beg, const _CharT* __end, _CharT __c);
_S_find(const _CharT* __beg, const _CharT* __end, _CharT __c);
};
......
......@@ -597,7 +597,7 @@ namespace std
// Types:
typedef _InternT intern_type;
typedef _ExternT extern_type;
typedef _StateT state_type;
typedef _StateT state_type;
// Data Members:
static locale::id id;
......@@ -618,8 +618,8 @@ namespace std
{
public:
// Types:
typedef char intern_type;
typedef char extern_type;
typedef char intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
explicit codecvt (size_t __refs = 0);
......@@ -657,8 +657,8 @@ namespace std
{
public:
// Types:
typedef wchar_t intern_type;
typedef char extern_type;
typedef wchar_t intern_type;
typedef char extern_type;
typedef mbstate_t state_type;
explicit codecvt(size_t __refs = 0);
......@@ -774,7 +774,7 @@ namespace std
// A list of valid numeric literals: for the standard "C" locale,
// this would usually be: "-+xX0123456789abcdef0123456789ABCDEF"
static const char _S_literals[];
static const char _S_literals[];
// NB: Code depends on the order of definitions of the names
// these are indices into _S_literals, above.
......
......@@ -399,7 +399,7 @@ namespace std
// Linker sets _S_empty_rep_storage to all 0s (one reference, empty string)
// at static init time (before static ctors are run).
template<typename _CharT, typename _Traits, typename _Alloc>
typename _Alloc::size_type
basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::_S_empty_rep_storage[
(sizeof(_Rep) + sizeof(_CharT) + sizeof(size_type) - 1)/sizeof(size_type)];
......
......@@ -57,9 +57,9 @@ namespace std
#ifdef MAIN
template C S::_Rep::_S_terminal;
// XXX Fix me: 2000-04-18 g++ ICE.
// template S::size_type S::_S_max_size;
// template S::allocator_type::size_type S::S_empty_rep_storage[];
template S::size_type S::_Rep::_S_max_size;
template S::size_type S::_S_empty_rep_storage[];
template S::basic_string(S const&);
template S::_Rep* S::_Rep::_S_create(size_t, S::allocator_type const&);
template void S::_Rep::_M_destroy(S::allocator_type const&) throw();
......
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