diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-04 18:34:27 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-04 18:34:27 +0000 |
commit | 1724ec2f75ad0387f12a4bbd6f935f1b6eee2deb (patch) | |
tree | 19a818a24f648bd274212772f0223efb4727bb56 /libstdc++-v3/config/locale/generic/numeric_members.cc | |
parent | 611e540558f5132bdcee510e0ac6004a5e943b46 (diff) | |
download | ppe42-gcc-1724ec2f75ad0387f12a4bbd6f935f1b6eee2deb.tar.gz ppe42-gcc-1724ec2f75ad0387f12a4bbd6f935f1b6eee2deb.zip |
2004-01-04 Paolo Carlini <pcarlini@suse.de>
* config/locale/generic/numeric_members.cc (_M_initialize_numpunct):
Avoid unnecessarily zero terminating _M_atoms_out and _M_atoms_in;
always use double underscored names.
* config/locale/gnu/numeric_members.cc (_M_initialize_numpunct):
Likewise.
* include/bits/locale_facets.h (struct __numpunct_cache):
Dimension _M_atoms_out and _M_atoms_in one position smaller.
(__numpunct_cache<>::_M_cache): Don't zero terminate _M_atoms_out
and _M_atoms_in.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75393 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/config/locale/generic/numeric_members.cc')
-rw-r--r-- | libstdc++-v3/config/locale/generic/numeric_members.cc | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/libstdc++-v3/config/locale/generic/numeric_members.cc b/libstdc++-v3/config/locale/generic/numeric_members.cc index 09af14703b1..8af127b8644 100644 --- a/libstdc++-v3/config/locale/generic/numeric_members.cc +++ b/libstdc++-v3/config/locale/generic/numeric_members.cc @@ -1,6 +1,6 @@ // std::numpunct implementation details, generic version -*- C++ -*- -// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -51,13 +51,11 @@ namespace std _M_data->_M_decimal_point = '.'; _M_data->_M_thousands_sep = ','; - 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_oend; ++__i) + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; - 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(); + 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_truename = "true"; _M_data->_M_falsename = "false"; @@ -84,19 +82,17 @@ namespace std // Use ctype::widen code without the facet... unsigned char uc; - for (size_t i = 0; i < __num_base::_S_oend; ++i) + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) { - uc = static_cast<unsigned char>(__num_base::_S_atoms_out[i]); - _M_data->_M_atoms_out[i] = btowc(uc); + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]); + _M_data->_M_atoms_out[__i] = btowc(uc); } - _M_data->_M_atoms_out[__num_base::_S_oend] = wchar_t(); - for (size_t i = 0; i < __num_base::_S_iend; ++i) + for (size_t __i = 0; __i < __num_base::_S_iend; ++__i) { - uc = static_cast<unsigned char>(__num_base::_S_atoms_in[i]); - _M_data->_M_atoms_in[i] = btowc(uc); + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__i]); + _M_data->_M_atoms_in[__i] = btowc(uc); } - _M_data->_M_atoms_in[__num_base::_S_iend] = wchar_t(); _M_data->_M_truename = L"true"; _M_data->_M_falsename = L"false"; |