From 23d4fa49c6b844fc4e4ca88708a92456ca865e80 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 15 Aug 2004 19:03:44 +0000 Subject: [PATCH] deque.tcc: Trivial formatting fixes. 2004-08-15 Paolo Carlini * include/bits/deque.tcc: Trivial formatting fixes. * include/bits/locale_facets.tcc (num_get<>::do_get(&bool)): Remove unneded typedef. * include/bits/locale_facets.tcc: Very minor tweaks. * testsuite/22_locale/time_put/put/wchar_t/1.cc: Use proper type for the fill argument. * testsuite/22_locale/time_put/put/wchar_t/10.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/2.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/3.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/4.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/5.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/6.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/7.cc: Likewise. * testsuite/22_locale/time_put/put/wchar_t/8.cc: Likewise. From-SVN: r86026 --- libstdc++-v3/ChangeLog | 20 +++++++++++++++++++ libstdc++-v3/include/bits/deque.tcc | 10 +++++----- libstdc++-v3/include/bits/locale_facets.tcc | 17 +++++++--------- .../22_locale/time_put/put/wchar_t/1.cc | 10 +++++----- .../22_locale/time_put/put/wchar_t/10.cc | 4 ++-- .../22_locale/time_put/put/wchar_t/2.cc | 10 +++++----- .../22_locale/time_put/put/wchar_t/3.cc | 10 +++++----- .../22_locale/time_put/put/wchar_t/4.cc | 10 +++++----- .../22_locale/time_put/put/wchar_t/5.cc | 4 ++-- .../22_locale/time_put/put/wchar_t/6.cc | 4 ++-- .../22_locale/time_put/put/wchar_t/7.cc | 4 ++-- .../22_locale/time_put/put/wchar_t/8.cc | 4 ++-- 12 files changed, 62 insertions(+), 45 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fa495e32ac4..e5b5d659e94 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,23 @@ +2004-08-15 Paolo Carlini + + * include/bits/deque.tcc: Trivial formatting fixes. + + * include/bits/locale_facets.tcc (num_get<>::do_get(&bool)): + Remove unneded typedef. + + * include/bits/locale_facets.tcc: Very minor tweaks. + + * testsuite/22_locale/time_put/put/wchar_t/1.cc: Use proper + type for the fill argument. + * testsuite/22_locale/time_put/put/wchar_t/10.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/2.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/3.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/4.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/5.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/6.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/7.cc: Likewise. + * testsuite/22_locale/time_put/put/wchar_t/8.cc: Likewise. + 2004-08-13 Paolo Carlini * src/debug.cc (_Error_formatter::_M_print_string): Fix thinko, diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc index 6b87c3b6ba6..3fbde412ef6 100644 --- a/libstdc++-v3/include/bits/deque.tcc +++ b/libstdc++-v3/include/bits/deque.tcc @@ -64,8 +64,8 @@ namespace _GLIBCXX_STD { template - deque<_Tp,_Alloc>& - deque<_Tp,_Alloc>:: + deque<_Tp, _Alloc>& + deque<_Tp, _Alloc>:: operator=(const deque& __x) { const size_type __len = size(); @@ -85,7 +85,7 @@ namespace _GLIBCXX_STD } template - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: insert(iterator position, const value_type& __x) { @@ -106,7 +106,7 @@ namespace _GLIBCXX_STD } template - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: erase(iterator __position) { @@ -127,7 +127,7 @@ namespace _GLIBCXX_STD } template - typename deque<_Tp,_Alloc>::iterator + typename deque<_Tp, _Alloc>::iterator deque<_Tp, _Alloc>:: erase(iterator __first, iterator __last) { diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index f5fd21ba796..6a3c808f6c2 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -658,7 +658,6 @@ namespace std else { // Parse bool values as alphanumeric. - typedef char_traits<_CharT> __traits_type; typedef typename numpunct<_CharT>::__cache_type __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); @@ -955,10 +954,9 @@ namespace std __new[0] = __cs[0]; __new[1] = __cs[1]; } - _CharT* __p; - __p = std::__add_grouping(__new + __off, __sep, __grouping, - __grouping_size, __cs + __off, - __cs + __len); + _CharT* __p = std::__add_grouping(__new + __off, __sep, __grouping, + __grouping_size, __cs + __off, + __cs + __len); __len = __p - __new; } @@ -1024,10 +1022,10 @@ namespace std // _GLIBCXX_RESOLVE_LIB_DEFECTS // 282. What types does numpunct grouping refer to? // Add grouping, if necessary. - _CharT* __p2; const int __declen = __p ? __p - __cs : __len; - __p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size, - __cs, __cs + __declen); + _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping, + __grouping_size, + __cs, __cs + __declen); // Tack on decimal part. int __newlen = __p2 - __new; @@ -2278,7 +2276,6 @@ namespace std return std::__write(__s, __res, char_traits::length(__res)); } - // Generic version does nothing. template int @@ -2361,7 +2358,7 @@ namespace std __len = __res + 1; __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __len)); - __res = _M_transform(__c, __p, __res + 1); + __res = _M_transform(__c, __p, __len); } __ret.append(__c, __res); diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc index f9d91de6d37..e9a9e8580d8 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc @@ -48,21 +48,21 @@ void test01() // put(iter_type s, ios_base& str, char_type fill, const tm* t, // char format, char modifier = 0) const; oss.str(empty); - iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); + iterator_type os_it01 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a'); wstring result1 = oss.str(); VERIFY( result1 == L"Sun" ); oss.str(empty); - iterator_type os_it21 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); + iterator_type os_it21 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x'); wstring result21 = oss.str(); // "04/04/71" oss.str(empty); - iterator_type os_it22 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); + iterator_type os_it22 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X'); wstring result22 = oss.str(); // "12:00:00" oss.str(empty); - iterator_type os_it31 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); + iterator_type os_it31 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E'); wstring result31 = oss.str(); // "04/04/71" oss.str(empty); - iterator_type os_it32 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); + iterator_type os_it32 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E'); wstring result32 = oss.str(); // "12:00:00" } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc index c16555f89ee..b0c366d4157 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc @@ -1,6 +1,6 @@ // 2001-09-17 Benjamin Kosnik -// Copyright (C) 2001, 2002, 2003 Free Software Foundation +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation // // 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 @@ -48,7 +48,7 @@ void test10() // 02 char format res = x; - iter_type ret2 = tp.put(res.begin(), oss, ' ', &time_sanity, 'A'); + iter_type ret2 = tp.put(res.begin(), oss, L' ', &time_sanity, 'A'); wstring sanity2(res.begin(), ret2); VERIFY( err == goodbit ); VERIFY( res == L"Tuesdayxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ); diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc index 8c85fdbd65f..a4a696892d7 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc @@ -45,21 +45,21 @@ void test02() oss.imbue(loc_de); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); + iterator_type os_it02 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a'); wstring result2 = oss.str(); VERIFY( result2 == L"Son" || result2 == L"So" ); oss.str(empty); // "%d.%m.%Y" - iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); + iterator_type os_it23 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x'); wstring result23 = oss.str(); // "04.04.1971" oss.str(empty); // "%T" - iterator_type os_it24 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); + iterator_type os_it24 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X'); wstring result24 = oss.str(); // "12:00:00" oss.str(empty); - iterator_type os_it33 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); + iterator_type os_it33 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E'); wstring result33 = oss.str(); // "04.04.1971" oss.str(empty); - iterator_type os_it34 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); + iterator_type os_it34 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E'); wstring result34 = oss.str(); // "12:00:00" } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc index 0aae0e22f4e..a95248ed327 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc @@ -45,21 +45,21 @@ void test03() oss.imbue(loc_hk); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it03 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); + iterator_type os_it03 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a'); wstring result3 = oss.str(); VERIFY( result3 == L"Sun" ); oss.str(empty); // "%A, %B %d, %Y" - iterator_type os_it25 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); + iterator_type os_it25 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x'); wstring result25 = oss.str(); // "Sunday, April 04, 1971" oss.str(empty); // "%I:%M:%S %Z" - iterator_type os_it26 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); + iterator_type os_it26 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X'); wstring result26 = oss.str(); // "12:00:00 PST" oss.str(empty); - iterator_type os_it35 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); + iterator_type os_it35 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E'); wstring result35 = oss.str(); // "Sunday, April 04, 1971" oss.str(empty); - iterator_type os_it36 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); + iterator_type os_it36 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E'); wstring result36 = oss.str(); // "12:00:00 PST" } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc index e65379492a9..84bd7756429 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc @@ -44,21 +44,21 @@ void test04() wostringstream oss; oss.imbue(loc_fr); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it04 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'a'); + iterator_type os_it04 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'a'); wstring result4 = oss.str(); VERIFY( result4 == L"dim" ); oss.str(empty); // "%d.%m.%Y" - iterator_type os_it27 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x'); + iterator_type os_it27 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x'); wstring result27 = oss.str(); // "04.04.1971" oss.str(empty); // "%T" - iterator_type os_it28 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X'); + iterator_type os_it28 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X'); wstring result28 = oss.str(); // "12:00:00" oss.str(empty); - iterator_type os_it37 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'x', 'E'); + iterator_type os_it37 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'x', 'E'); wstring result37 = oss.str(); // "04.04.1971" oss.str(empty); - iterator_type os_it38 = tim_put.put(oss.rdbuf(), oss, '*', &time1, 'X', 'E'); + iterator_type os_it38 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, 'X', 'E'); wstring result38 = oss.str(); // "12:00:00" } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc index 2cc6fd8bc66..efe000ae64c 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc @@ -48,11 +48,11 @@ void test05() // 2 oss.str(empty); - iterator_type os_it05 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it05 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date, date + traits::length(date)); wstring result5 = oss.str(); VERIFY( result5 == L"Sunday, the second of April"); - iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date_ex, date_ex + traits::length(date)); wstring result6 = oss.str(); VERIFY( result6 != result5 ); diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc index f75114fe1e1..c38ea8fc278 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc @@ -48,11 +48,11 @@ void test06() oss.imbue(loc_de); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it07 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it07 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date, date + traits::length(date)); wstring result7 = oss.str(); VERIFY( result7 == L"Sonntag, the second of April"); - iterator_type os_it08 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it08 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date_ex, date_ex + traits::length(date)); wstring result8 = oss.str(); VERIFY( result8 != result7 ); diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc index 6afe4fc7ba5..7d0f63ef51f 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc @@ -48,11 +48,11 @@ void test07() oss.imbue(loc_hk); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it09 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it09 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date, date + traits::length(date)); wstring result9 = oss.str(); VERIFY( result9 == L"Sunday, the second of April"); - iterator_type os_it10 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it10 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date_ex, date_ex + traits::length(date)); wstring result10 = oss.str(); VERIFY( result10 != result9 ); diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc index 10e8da431f8..83f42ae9d72 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc @@ -47,11 +47,11 @@ void test08() wostringstream oss; oss.imbue(loc_fr); const time_put& tim_put = use_facet >(oss.getloc()); - iterator_type os_it11 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it11 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date, date + traits::length(date)); wstring result11 = oss.str(); VERIFY( result11 == L"dimanche, the second of avril"); - iterator_type os_it12 = tim_put.put(oss.rdbuf(), oss, '*', &time1, + iterator_type os_it12 = tim_put.put(oss.rdbuf(), oss, L'*', &time1, date_ex, date_ex + traits::length(date)); wstring result12 = oss.str(); VERIFY( result12 != result11 ); -- 2.30.2