deque.tcc: Trivial formatting fixes.

2004-08-15  Paolo Carlini  <pcarlini@suse.de>

	* 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
This commit is contained in:
Paolo Carlini 2004-08-15 19:03:44 +00:00 committed by Paolo Carlini
parent 4a90aeeb51
commit 23d4fa49c6
12 changed files with 62 additions and 45 deletions

View File

@ -1,3 +1,23 @@
2004-08-15 Paolo Carlini <pcarlini@suse.de>
* 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 <pcarlini@suse.de> 2004-08-13 Paolo Carlini <pcarlini@suse.de>
* src/debug.cc (_Error_formatter::_M_print_string): Fix thinko, * src/debug.cc (_Error_formatter::_M_print_string): Fix thinko,

View File

@ -64,8 +64,8 @@
namespace _GLIBCXX_STD namespace _GLIBCXX_STD
{ {
template <typename _Tp, typename _Alloc> template <typename _Tp, typename _Alloc>
deque<_Tp,_Alloc>& deque<_Tp, _Alloc>&
deque<_Tp,_Alloc>:: deque<_Tp, _Alloc>::
operator=(const deque& __x) operator=(const deque& __x)
{ {
const size_type __len = size(); const size_type __len = size();
@ -85,7 +85,7 @@ namespace _GLIBCXX_STD
} }
template <typename _Tp, typename _Alloc> template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>:: deque<_Tp, _Alloc>::
insert(iterator position, const value_type& __x) insert(iterator position, const value_type& __x)
{ {
@ -106,7 +106,7 @@ namespace _GLIBCXX_STD
} }
template <typename _Tp, typename _Alloc> template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>:: deque<_Tp, _Alloc>::
erase(iterator __position) erase(iterator __position)
{ {
@ -127,7 +127,7 @@ namespace _GLIBCXX_STD
} }
template <typename _Tp, typename _Alloc> template <typename _Tp, typename _Alloc>
typename deque<_Tp,_Alloc>::iterator typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>:: deque<_Tp, _Alloc>::
erase(iterator __first, iterator __last) erase(iterator __first, iterator __last)
{ {

View File

@ -658,7 +658,6 @@ namespace std
else else
{ {
// Parse bool values as alphanumeric. // Parse bool values as alphanumeric.
typedef char_traits<_CharT> __traits_type;
typedef typename numpunct<_CharT>::__cache_type __cache_type; typedef typename numpunct<_CharT>::__cache_type __cache_type;
__use_cache<__cache_type> __uc; __use_cache<__cache_type> __uc;
const locale& __loc = __io._M_getloc(); const locale& __loc = __io._M_getloc();
@ -955,10 +954,9 @@ namespace std
__new[0] = __cs[0]; __new[0] = __cs[0];
__new[1] = __cs[1]; __new[1] = __cs[1];
} }
_CharT* __p; _CharT* __p = std::__add_grouping(__new + __off, __sep, __grouping,
__p = std::__add_grouping(__new + __off, __sep, __grouping, __grouping_size, __cs + __off,
__grouping_size, __cs + __off, __cs + __len);
__cs + __len);
__len = __p - __new; __len = __p - __new;
} }
@ -1024,10 +1022,10 @@ namespace std
// _GLIBCXX_RESOLVE_LIB_DEFECTS // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 282. What types does numpunct grouping refer to? // 282. What types does numpunct grouping refer to?
// Add grouping, if necessary. // Add grouping, if necessary.
_CharT* __p2;
const int __declen = __p ? __p - __cs : __len; const int __declen = __p ? __p - __cs : __len;
__p2 = std::__add_grouping(__new, __sep, __grouping, __grouping_size, _CharT* __p2 = std::__add_grouping(__new, __sep, __grouping,
__cs, __cs + __declen); __grouping_size,
__cs, __cs + __declen);
// Tack on decimal part. // Tack on decimal part.
int __newlen = __p2 - __new; int __newlen = __p2 - __new;
@ -2278,7 +2276,6 @@ namespace std
return std::__write(__s, __res, char_traits<char_type>::length(__res)); return std::__write(__s, __res, char_traits<char_type>::length(__res));
} }
// Generic version does nothing. // Generic version does nothing.
template<typename _CharT> template<typename _CharT>
int int
@ -2361,7 +2358,7 @@ namespace std
__len = __res + 1; __len = __res + 1;
__c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) __c = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
* __len)); * __len));
__res = _M_transform(__c, __p, __res + 1); __res = _M_transform(__c, __p, __len);
} }
__ret.append(__c, __res); __ret.append(__c, __res);

View File

@ -48,21 +48,21 @@ void test01()
// put(iter_type s, ios_base& str, char_type fill, const tm* t, // put(iter_type s, ios_base& str, char_type fill, const tm* t,
// char format, char modifier = 0) const; // char format, char modifier = 0) const;
oss.str(empty); 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(); wstring result1 = oss.str();
VERIFY( result1 == L"Sun" ); VERIFY( result1 == L"Sun" );
oss.str(empty); 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" wstring result21 = oss.str(); // "04/04/71"
oss.str(empty); 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" wstring result22 = oss.str(); // "12:00:00"
oss.str(empty); 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" wstring result31 = oss.str(); // "04/04/71"
oss.str(empty); 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" wstring result32 = oss.str(); // "12:00:00"
} }

View File

@ -1,6 +1,6 @@
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com> // 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
// 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 // 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 // software; you can redistribute it and/or modify it under the
@ -48,7 +48,7 @@ void test10()
// 02 char format // 02 char format
res = x; 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); wstring sanity2(res.begin(), ret2);
VERIFY( err == goodbit ); VERIFY( err == goodbit );
VERIFY( res == L"Tuesdayxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ); VERIFY( res == L"Tuesdayxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" );

View File

@ -45,21 +45,21 @@ void test02()
oss.imbue(loc_de); oss.imbue(loc_de);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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(); wstring result2 = oss.str();
VERIFY( result2 == L"Son" || result2 == L"So" ); VERIFY( result2 == L"Son" || result2 == L"So" );
oss.str(empty); // "%d.%m.%Y" 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" wstring result23 = oss.str(); // "04.04.1971"
oss.str(empty); // "%T" 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" wstring result24 = oss.str(); // "12:00:00"
oss.str(empty); 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" wstring result33 = oss.str(); // "04.04.1971"
oss.str(empty); 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" wstring result34 = oss.str(); // "12:00:00"
} }

View File

@ -45,21 +45,21 @@ void test03()
oss.imbue(loc_hk); oss.imbue(loc_hk);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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(); wstring result3 = oss.str();
VERIFY( result3 == L"Sun" ); VERIFY( result3 == L"Sun" );
oss.str(empty); // "%A, %B %d, %Y" 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" wstring result25 = oss.str(); // "Sunday, April 04, 1971"
oss.str(empty); // "%I:%M:%S %Z" 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" wstring result26 = oss.str(); // "12:00:00 PST"
oss.str(empty); 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" wstring result35 = oss.str(); // "Sunday, April 04, 1971"
oss.str(empty); 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" wstring result36 = oss.str(); // "12:00:00 PST"
} }

View File

@ -44,21 +44,21 @@ void test04()
wostringstream oss; wostringstream oss;
oss.imbue(loc_fr); oss.imbue(loc_fr);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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(); wstring result4 = oss.str();
VERIFY( result4 == L"dim" ); VERIFY( result4 == L"dim" );
oss.str(empty); // "%d.%m.%Y" 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" wstring result27 = oss.str(); // "04.04.1971"
oss.str(empty); // "%T" 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" wstring result28 = oss.str(); // "12:00:00"
oss.str(empty); 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" wstring result37 = oss.str(); // "04.04.1971"
oss.str(empty); 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" wstring result38 = oss.str(); // "12:00:00"
} }

View File

@ -48,11 +48,11 @@ void test05()
// 2 // 2
oss.str(empty); 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)); date, date + traits::length(date));
wstring result5 = oss.str(); wstring result5 = oss.str();
VERIFY( result5 == L"Sunday, the second of April"); 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)); date_ex, date_ex + traits::length(date));
wstring result6 = oss.str(); wstring result6 = oss.str();
VERIFY( result6 != result5 ); VERIFY( result6 != result5 );

View File

@ -48,11 +48,11 @@ void test06()
oss.imbue(loc_de); oss.imbue(loc_de);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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)); date, date + traits::length(date));
wstring result7 = oss.str(); wstring result7 = oss.str();
VERIFY( result7 == L"Sonntag, the second of April"); 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)); date_ex, date_ex + traits::length(date));
wstring result8 = oss.str(); wstring result8 = oss.str();
VERIFY( result8 != result7 ); VERIFY( result8 != result7 );

View File

@ -48,11 +48,11 @@ void test07()
oss.imbue(loc_hk); oss.imbue(loc_hk);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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)); date, date + traits::length(date));
wstring result9 = oss.str(); wstring result9 = oss.str();
VERIFY( result9 == L"Sunday, the second of April"); 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)); date_ex, date_ex + traits::length(date));
wstring result10 = oss.str(); wstring result10 = oss.str();
VERIFY( result10 != result9 ); VERIFY( result10 != result9 );

View File

@ -47,11 +47,11 @@ void test08()
wostringstream oss; wostringstream oss;
oss.imbue(loc_fr); oss.imbue(loc_fr);
const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(oss.getloc()); const time_put<wchar_t>& tim_put = use_facet<time_put<wchar_t> >(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)); date, date + traits::length(date));
wstring result11 = oss.str(); wstring result11 = oss.str();
VERIFY( result11 == L"dimanche, the second of avril"); 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)); date_ex, date_ex + traits::length(date));
wstring result12 = oss.str(); wstring result12 = oss.str();
VERIFY( result12 != result11 ); VERIFY( result12 != result11 );