From 3c21d6e0f7c7b6d02686e24d0967ffffe85b61ad Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 22 Oct 2003 21:53:21 +0000 Subject: [PATCH] locale_facets.tcc (__int_to_char): Remove the const int parameter. 2003-10-22 Paolo Carlini * include/bits/locale_facets.tcc (__int_to_char): Remove the const int parameter. (_M_insert_int): Update caller. * src/locale-inst.cc (__int_to_char): Update instantiations. From-SVN: r72825 --- libstdc++-v3/ChangeLog | 7 +++++ libstdc++-v3/include/bits/locale_facets.tcc | 31 ++++++++++----------- libstdc++-v3/src/locale-inst.cc | 4 +-- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9100bb19a60..218ce7a9047 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2003-10-22 Paolo Carlini + + * include/bits/locale_facets.tcc (__int_to_char): Remove + the const int parameter. + (_M_insert_int): Update caller. + * src/locale-inst.cc (__int_to_char): Update instantiations. + 2003-10-22 Benjamin Kosnik * include/bits/locale_facets.h: Correct byname facets for "C" diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index ad965bab207..0f8d2b5d232 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -666,8 +666,8 @@ namespace std // Forwarding functions to peel signed from unsigned integer types. template inline int - __int_to_char(_CharT* __out, const int __size, long __v, - const _CharT* __lit, ios_base::fmtflags __flags) + __int_to_char(_CharT* __bufend, long __v, const _CharT* __lit, + ios_base::fmtflags __flags) { unsigned long __ul = static_cast(__v); bool __neg = false; @@ -676,20 +676,20 @@ namespace std __ul = -__ul; __neg = true; } - return __int_to_char(__out, __size, __ul, __lit, __flags, __neg); + return __int_to_char(__bufend, __ul, __lit, __flags, __neg); } template inline int - __int_to_char(_CharT* __out, const int __size, unsigned long __v, - const _CharT* __lit, ios_base::fmtflags __flags) - { return __int_to_char(__out, __size, __v, __lit, __flags, false); } + __int_to_char(_CharT* __bufend, unsigned long __v, const _CharT* __lit, + ios_base::fmtflags __flags) + { return __int_to_char(__bufend, __v, __lit, __flags, false); } #ifdef _GLIBCXX_USE_LONG_LONG template inline int - __int_to_char(_CharT* __out, const int __size, long long __v, - const _CharT* __lit, ios_base::fmtflags __flags) + __int_to_char(_CharT* __bufend, long long __v, const _CharT* __lit, + ios_base::fmtflags __flags) { unsigned long long __ull = static_cast(__v); bool __neg = false; @@ -698,25 +698,24 @@ namespace std __ull = -__ull; __neg = true; } - return __int_to_char(__out, __size, __ull, __lit, __flags, __neg); + return __int_to_char(__bufend, __ull, __lit, __flags, __neg); } template inline int - __int_to_char(_CharT* __out, const int __size, unsigned long long __v, - const _CharT* __lit, ios_base::fmtflags __flags) - { return __int_to_char(__out, __size, __v, __lit, __flags, false); } + __int_to_char(_CharT* __bufend, unsigned long long __v, const _CharT* __lit, + ios_base::fmtflags __flags) + { return __int_to_char(__bufend, __v, __lit, __flags, false); } #endif template int - __int_to_char(_CharT* __out, const int __size, _ValueT __v, - const _CharT* __lit, ios_base::fmtflags __flags, bool __neg) + __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit, + ios_base::fmtflags __flags, bool __neg) { // Don't write base if already 0. const bool __showbase = (__flags & ios_base::showbase) && __v; const ios_base::fmtflags __basefield = __flags & ios_base::basefield; - _CharT* const __bufend = __out + __size; _CharT* __buf = __bufend - 1; if (__builtin_expect(__basefield != ios_base::oct && @@ -823,7 +822,7 @@ namespace std // [22.2.2.2.2] Stage 1, numeric conversion to character. // Result is returned right-justified in the buffer. int __len; - __len = __int_to_char(&__cs[0], __ilen, __v, __lit, __io.flags()); + __len = __int_to_char(__cs + __ilen, __v, __lit, __io.flags()); __cs += __ilen - __len; // Add grouping, if necessary. diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc index 27a51f04afb..35140ea7094 100644 --- a/libstdc++-v3/src/locale-inst.cc +++ b/libstdc++-v3/src/locale-inst.cc @@ -239,13 +239,13 @@ namespace std template int - __int_to_char(C*, const int, unsigned long, const C*, + __int_to_char(C*, unsigned long, const C*, ios_base::fmtflags, bool); #ifdef _GLIBCXX_USE_LONG_LONG template int - __int_to_char(C*, const int, unsigned long long, const C*, + __int_to_char(C*, unsigned long long, const C*, ios_base::fmtflags, bool); #endif } // namespace std