diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2002-03-10 23:51:31 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2002-03-10 23:51:31 +0000 |
commit | c15892e05ec3cd0c2d1fe985db27c02107bed438 (patch) | |
tree | ad9fb6c331ee8bfc3c20b50083661d2878b577bd | |
parent | 561c9153eb5c0824bc318f06dbdd4563d064e235 (diff) | |
download | gcc-c15892e05ec3cd0c2d1fe985db27c02107bed438.zip gcc-c15892e05ec3cd0c2d1fe985db27c02107bed438.tar.gz gcc-c15892e05ec3cd0c2d1fe985db27c02107bed438.tar.bz2 |
locale_facets.tcc (time_put::do_put): Consider sizeof(char_type) in allocating the buffer.
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 20 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/locale_facets.tcc | 8 |
2 files changed, 19 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0ed3aa3..7cdebce 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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> diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index 90bb221..37ad6b3 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -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); |