This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] correct type info
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 8 Jul 2003 16:12:58 -0400 (EDT)
- Subject: [v3] correct type info
While working on extending the locale caching I found these bits.
tested x86/linux
2003-07-08 Benjamin Kosnik <bkoz@redhat.com>
* config/locale/generic/numeric_members.cc: Correct type info.
* config/locale/gnu/numeric_members.cc: Same.
* include/bits/locale_facets.h: Same.
* include/bits/char_traits.h: Correct spacing.
* src/locale.cc: Wrap to 80 col.
Index: config/locale/generic/numeric_members.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/generic/numeric_members.cc,v
retrieving revision 1.4
diff -c -p -r1.4 numeric_members.cc
*** config/locale/generic/numeric_members.cc 5 Jul 2003 04:05:30 -0000 1.4
--- config/locale/generic/numeric_members.cc 8 Jul 2003 20:14:11 -0000
*************** namespace std
*** 53,63 ****
for (size_t i = 0; i < __num_base::_S_oend; ++i)
_M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
! _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
for (size_t i = 0; i < __num_base::_S_iend; ++i)
_M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
! _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
_M_data->_M_truename = "true";
_M_data->_M_falsename = "false";
--- 53,63 ----
for (size_t i = 0; i < __num_base::_S_oend; ++i)
_M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
! _M_data->_M_atoms_out[__num_base::_S_oend] = char();
for (size_t i = 0; i < __num_base::_S_iend; ++i)
_M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
! _M_data->_M_atoms_in[__num_base::_S_iend] = char();
_M_data->_M_truename = "true";
_M_data->_M_falsename = "false";
Index: config/locale/gnu/numeric_members.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/gnu/numeric_members.cc,v
retrieving revision 1.8
diff -c -p -r1.8 numeric_members.cc
*** config/locale/gnu/numeric_members.cc 5 Jul 2003 04:05:30 -0000 1.8
--- config/locale/gnu/numeric_members.cc 8 Jul 2003 20:14:11 -0000
*************** namespace std
*** 56,66 ****
for (size_t i = 0; i < __num_base::_S_oend; ++i)
_M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
! _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t();
for (size_t i = 0; i < __num_base::_S_iend; ++i)
_M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
! _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t();
}
else
{
--- 56,66 ----
for (size_t i = 0; i < __num_base::_S_oend; ++i)
_M_data->_M_atoms_out[i] = __num_base::_S_atoms_out[i];
! _M_data->_M_atoms_out[__num_base::_S_oend] = char();
for (size_t i = 0; i < __num_base::_S_iend; ++i)
_M_data->_M_atoms_in[i] = __num_base::_S_atoms_in[i];
! _M_data->_M_atoms_in[__num_base::_S_iend] = char();
}
else
{
Index: include/bits/char_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/char_traits.h,v
retrieving revision 1.16
diff -c -p -r1.16 char_traits.h
*** include/bits/char_traits.h 5 Jul 2003 04:05:34 -0000 1.16
--- include/bits/char_traits.h 8 Jul 2003 20:14:12 -0000
*************** namespace std
*** 152,158 ****
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
! { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
--- 152,158 ----
static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
! { return static_cast<char_type*>(memcpy(__s1, __s2, __n)); }
static char_type*
assign(char_type* __s, size_t __n, char_type __a)
Index: include/bits/locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.59
diff -c -p -r1.59 locale_facets.h
*** include/bits/locale_facets.h 5 Jul 2003 04:05:34 -0000 1.59
--- include/bits/locale_facets.h 8 Jul 2003 20:14:14 -0000
*************** namespace std
*** 591,603 ****
// "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
! _CharT _M_atoms_out[__num_base::_S_oend + 1];
// A list of valid numeric literals for output: in the standard
// "C" locale, this is "0123456789eEabcdfABCDF"
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
! _CharT _M_atoms_in[__num_base::_S_iend + 1];
bool _M_allocated;
--- 591,603 ----
// "C" locale, this is "-+xX0123456789abcdef0123456789ABCDEF".
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
! char_type _M_atoms_out[__num_base::_S_oend + 1];
// A list of valid numeric literals for output: in the standard
// "C" locale, this is "0123456789eEabcdfABCDF"
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
! char_type _M_atoms_in[__num_base::_S_iend + 1];
bool _M_allocated;
*************** namespace std
*** 621,627 ****
string __grouping = __np.grouping();
char* __group = new char[__grouping.length() + 1];
__grouping.copy(__group, __grouping.length());
! __group[__grouping.length()] = _CharT();
_M_grouping = __group;
_M_use_grouping = __grouping.length() != 0 && __grouping.data()[0] != 0;
--- 621,627 ----
string __grouping = __np.grouping();
char* __group = new char[__grouping.length() + 1];
__grouping.copy(__group, __grouping.length());
! __group[__grouping.length()] = char();
_M_grouping = __group;
_M_use_grouping = __grouping.length() != 0 && __grouping.data()[0] != 0;
Index: src/locale.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/locale.cc,v
retrieving revision 1.87
diff -c -p -r1.87 locale.cc
*** src/locale.cc 6 Jul 2003 09:37:11 -0000 1.87
--- src/locale.cc 8 Jul 2003 20:14:15 -0000
*************** namespace std
*** 187,193 ****
// If LC_ALL is set we are done.
if (__env && std::strcmp(__env, "") != 0)
{
! if (std::strcmp(__env, "C") == 0 || std::strcmp(__env, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else
_M_impl = new _Impl(__env, 1);
--- 187,194 ----
// If LC_ALL is set we are done.
if (__env && std::strcmp(__env, "") != 0)
{
! if (std::strcmp(__env, "C") == 0
! || std::strcmp(__env, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else
_M_impl = new _Impl(__env, 1);
*************** namespace std
*** 197,203 ****
char* __res;
// LANG may set a default different from "C".
char* __env = getenv("LANG");
! if (!__env || std::strcmp(__env, "") == 0 || std::strcmp(__env, "C") == 0
|| std::strcmp(__env, "POSIX") == 0)
__res = strdup("C");
else
--- 198,205 ----
char* __res;
// LANG may set a default different from "C".
char* __env = getenv("LANG");
! if (!__env || std::strcmp(__env, "") == 0
! || std::strcmp(__env, "C") == 0
|| std::strcmp(__env, "POSIX") == 0)
__res = strdup("C");
else
*************** namespace std
*** 481,487 ****
}
#endif
! // Definitions for static const data members of time_base
template<>
const char*
__timepunct<char>::_S_timezones[14] =
--- 483,489 ----
}
#endif
! // Definitions for static const data members of time_base.
template<>
const char*
__timepunct<char>::_S_timezones[14] =
*************** namespace std
*** 500,506 ****
};
#endif
! // Definitions for static const data members of money_base
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };
--- 502,508 ----
};
#endif
! // Definitions for static const data members of money_base.
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };