aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2014-11-29 22:58:38 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2014-11-29 22:58:38 +0000
commit38dbb2a53f393a9ee895cf6247a900cbb1cc8be2 (patch)
treecaab7574ef5bcb5a0ebfeeea9ae10ca40215b80b
parentbd6757b8d3f5035090b15be64a93427c6534a4da (diff)
downloadgcc-38dbb2a53f393a9ee895cf6247a900cbb1cc8be2.zip
gcc-38dbb2a53f393a9ee895cf6247a900cbb1cc8be2.tar.gz
gcc-38dbb2a53f393a9ee895cf6247a900cbb1cc8be2.tar.bz2
locale_init.cc (locale::_Impl::_Impl(size_t)): Use new-initializer instead of loop.
* src/c++98/locale_init.cc (locale::_Impl::_Impl(size_t)): Use new-initializer instead of loop. * src/c++98/localename.cc (locale::_Impl::_Impl(const char*, size_t)): Likewise. From-SVN: r218184
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/src/c++98/locale_init.cc10
-rw-r--r--libstdc++-v3/src/c++98/localename.cc12
3 files changed, 11 insertions, 16 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5781709..ac4d4a4 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -4,6 +4,11 @@
typedef.
(time_get): Likewise. Fix comments.
+ * src/c++98/locale_init.cc (locale::_Impl::_Impl(size_t)): Use
+ new-initializer instead of loop.
+ * src/c++98/localename.cc (locale::_Impl::_Impl(const char*, size_t)):
+ Likewise.
+
2014-11-26 Jonathan Wakely <jwakely@redhat.com>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
diff --git a/libstdc++-v3/src/c++98/locale_init.cc b/libstdc++-v3/src/c++98/locale_init.cc
index 2c6dfc5..c007648 100644
--- a/libstdc++-v3/src/c++98/locale_init.cc
+++ b/libstdc++-v3/src/c++98/locale_init.cc
@@ -375,17 +375,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: _M_refcount(__refs), _M_facets(0), _M_facets_size(_GLIBCXX_NUM_FACETS),
_M_caches(0), _M_names(0)
{
- _M_facets = new (&facet_vec) const facet*[_M_facets_size];
- _M_caches = new (&cache_vec) const facet*[_M_facets_size];
- for (size_t __i = 0; __i < _M_facets_size; ++__i)
- _M_facets[__i] = _M_caches[__i] = 0;
+ _M_facets = new (&facet_vec) const facet*[_M_facets_size]();
+ _M_caches = new (&cache_vec) const facet*[_M_facets_size]();
// Name the categories.
- _M_names = new (&name_vec) char*[_S_categories_size];
+ _M_names = new (&name_vec) char*[_S_categories_size]();
_M_names[0] = new (&name_c[0]) char[2];
std::memcpy(_M_names[0], locale::facet::_S_get_c_name(), 2);
- for (size_t __j = 1; __j < _S_categories_size; ++__j)
- _M_names[__j] = 0;
// This is needed as presently the C++ version of "C" locales
// != data in the underlying locale model for __timepunct,
diff --git a/libstdc++-v3/src/c++98/localename.cc b/libstdc++-v3/src/c++98/localename.cc
index e93c846..589f8c6 100644
--- a/libstdc++-v3/src/c++98/localename.cc
+++ b/libstdc++-v3/src/c++98/localename.cc
@@ -184,15 +184,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__try
{
- _M_facets = new const facet*[_M_facets_size];
- for (size_t __i = 0; __i < _M_facets_size; ++__i)
- _M_facets[__i] = 0;
- _M_caches = new const facet*[_M_facets_size];
- for (size_t __j = 0; __j < _M_facets_size; ++__j)
- _M_caches[__j] = 0;
- _M_names = new char*[_S_categories_size];
- for (size_t __k = 0; __k < _S_categories_size; ++__k)
- _M_names[__k] = 0;
+ _M_facets = new const facet*[_M_facets_size]();
+ _M_caches = new const facet*[_M_facets_size]();
+ _M_names = new char*[_S_categories_size]();
// Name the categories.
const char* __smon = __s;