This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Bunch of minor tweaks and formatting fixes
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 15 Aug 2004 21:07:08 +0200
- Subject: [v3] Bunch of minor tweaks and formatting fixes
Hi,
tested x86-linux, committed to mainline.
Paolo.
//////////////
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.
diff -urN libstdc++-v3-orig/include/bits/deque.tcc libstdc++-v3/include/bits/deque.tcc
--- libstdc++-v3-orig/include/bits/deque.tcc 2004-07-28 18:37:17.000000000 +0200
+++ libstdc++-v3/include/bits/deque.tcc 2004-08-15 18:37:48.000000000 +0200
@@ -64,8 +64,8 @@
namespace _GLIBCXX_STD
{
template <typename _Tp, typename _Alloc>
- 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 @@
}
template <typename _Tp, typename _Alloc>
- typename deque<_Tp,_Alloc>::iterator
+ typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
insert(iterator position, const value_type& __x)
{
@@ -106,7 +106,7 @@
}
template <typename _Tp, typename _Alloc>
- typename deque<_Tp,_Alloc>::iterator
+ typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
erase(iterator __position)
{
@@ -127,7 +127,7 @@
}
template <typename _Tp, typename _Alloc>
- typename deque<_Tp,_Alloc>::iterator
+ typename deque<_Tp, _Alloc>::iterator
deque<_Tp, _Alloc>::
erase(iterator __first, iterator __last)
{
diff -urN libstdc++-v3-orig/include/bits/locale_facets.tcc libstdc++-v3/include/bits/locale_facets.tcc
--- libstdc++-v3-orig/include/bits/locale_facets.tcc 2004-08-07 15:48:31.000000000 +0200
+++ libstdc++-v3/include/bits/locale_facets.tcc 2004-08-15 19:22:36.000000000 +0200
@@ -658,7 +658,6 @@
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 @@
__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 @@
// _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 @@
return std::__write(__s, __res, char_traits<char_type>::length(__res));
}
-
// Generic version does nothing.
template<typename _CharT>
int
@@ -2361,7 +2358,7 @@
__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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/1.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/1.cc 2004-04-08 01:14:07.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc 2004-08-15 19:30:34.000000000 +0200
@@ -48,21 +48,21 @@
// 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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/10.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/10.cc 2003-09-23 22:02:37.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc 2004-08-15 19:33:24.000000000 +0200
@@ -1,6 +1,6 @@
// 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
// software; you can redistribute it and/or modify it under the
@@ -48,7 +48,7 @@
// 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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/2.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/2.cc 2004-04-08 01:14:07.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc 2004-08-15 19:31:11.000000000 +0200
@@ -45,21 +45,21 @@
oss.imbue(loc_de);
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();
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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/3.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/3.cc 2004-04-08 01:14:07.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc 2004-08-15 19:31:35.000000000 +0200
@@ -45,21 +45,21 @@
oss.imbue(loc_hk);
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();
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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/4.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/4.cc 2004-04-08 01:14:08.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc 2004-08-15 19:32:02.000000000 +0200
@@ -44,21 +44,21 @@
wostringstream oss;
oss.imbue(loc_fr);
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();
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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/5.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/5.cc 2004-04-08 01:14:08.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc 2004-08-15 19:32:17.000000000 +0200
@@ -48,11 +48,11 @@
// 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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/6.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/6.cc 2004-04-08 01:14:08.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc 2004-08-15 19:32:31.000000000 +0200
@@ -48,11 +48,11 @@
oss.imbue(loc_de);
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));
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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/7.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/7.cc 2004-04-08 01:14:08.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc 2004-08-15 19:32:44.000000000 +0200
@@ -48,11 +48,11 @@
oss.imbue(loc_hk);
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));
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 -urN libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/8.cc libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc
--- libstdc++-v3-orig/testsuite/22_locale/time_put/put/wchar_t/8.cc 2004-04-08 01:14:08.000000000 +0200
+++ libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc 2004-08-15 19:32:57.000000000 +0200
@@ -47,11 +47,11 @@
wostringstream oss;
oss.imbue(loc_fr);
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));
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 );