locale_facets.tcc (time_put::do_put): Consider sizeof(char_type) in allocating the...
authorPaolo Carlini <paolo@gcc.gnu.org>
Sun, 10 Mar 2002 23:51:31 +0000 (23:51 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 10 Mar 2002 23:51:31 +0000 (23:51 +0000)
2002-03-10  Paolo Carlini  <pcarlini@unitus.it>

        * include/bits/locale_facets.tcc (time_put::do_put):
Consider sizeof(char_type) in allocating the buffer.

* include/bits/locale_facets.tcc (collate::do_tranform):
Remove redundant variable.

From-SVN: r50553

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc

index 0ed3aa3116ed8dc70114a2edd1477472b13273e8..7cdebce569f3a8cab5307e69a760f9c888bf1e47 100644 (file)
@@ -1,12 +1,20 @@
+2002-03-10  Paolo Carlini  <pcarlini@unitus.it>
+
+       * include/bits/locale_facets.tcc (time_put::do_put):
+       Consider sizeof(char_type) in allocating the buffer.
+
+       * include/bits/locale_facets.tcc (collate::do_tranform):
+       Remove redundant variable.
+
 2002-03-10  Ulrich Drepper  <drepper@redhat.com>
             Paolo Carlini  <pcarlini@unitus.it>
 
-        * config/locale/generic/collate_members.cc
-        (collate<char,wchar_t>::_M_compare_helper): normalize
-        values returned by strcoll and wcscoll.
-        * config/locale/gnu/collate_members.cc
-        (collate<char,wchar_t>::_M_compare_helper): ditto
-        for __strcoll_l and __wcscoll_l.
+       * config/locale/generic/collate_members.cc
+       (collate<char,wchar_t>::_M_compare_helper): normalize
+       values returned by strcoll and wcscoll.
+       * config/locale/gnu/collate_members.cc
+       (collate<char,wchar_t>::_M_compare_helper): ditto
+       for __strcoll_l and __wcscoll_l.
 
 2002-03-10  Anthony Green  <green@redhat.com>
 
index 90bb221c56ccebd56981ee9a7b9716e4bd0dfa2f..37ad6b348cb0b6e38b6e2bec9c298c81673851a1 100644 (file)
@@ -1795,7 +1795,8 @@ namespace std
       // NB: This size is arbitrary. Should this be a data member,
       // initialized at construction?
       const size_t __maxlen = 64;
-      char_type* __res = static_cast<char_type*>(__builtin_alloca(__maxlen));
+      char_type* __res =
+       static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen));
 
       // NB: In IEE 1003.1-200x, and perhaps other locale models, it
       // is possible that the format character will be longer than one
@@ -1856,14 +1857,15 @@ namespace std
     {
       size_t __len = (__hi - __lo) * 2;
       // First try a buffer perhaps big enough.
-      _CharT* __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len));
+      _CharT* __c =
+       static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len));
       size_t __res = _M_transform_helper(__c, __lo, __len);
       // If the buffer was not large enough, try again with the correct size.
       if (__res >= __len)
        {
          _CharT* __c2 =
            static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * (__res + 1)));
-         size_t __res2 = _M_transform_helper(__c2, __lo, __res + 1);
+         _M_transform_helper(__c2, __lo, __res + 1);
          return string_type(__c2);
        }
       return string_type(__c);