OSDN Git Service

2004-08-15 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Aug 2004 19:03:44 +0000 (19:03 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Aug 2004 19:03:44 +0000 (19:03 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86026 138bc75d-0d04-0410-961f-82ee72b054a4

12 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/deque.tcc
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc
libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc

index fa495e3..e5b5d65 100644 (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>
        
        * src/debug.cc (_Error_formatter::_M_print_string): Fix thinko,
index 6b87c3b..3fbde41 100644 (file)
@@ -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 @@ namespace _GLIBCXX_STD
     }
 
   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 @@ namespace _GLIBCXX_STD
     }
 
   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 @@ namespace _GLIBCXX_STD
     }
 
   template <typename _Tp, typename _Alloc>
-    typename deque<_Tp,_Alloc>::iterator
+    typename deque<_Tp, _Alloc>::iterator
     deque<_Tp, _Alloc>::
     erase(iterator __first, iterator __last)
     {
index f5fd21b..6a3c808 100644 (file)
@@ -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<char_type>::length(__res));
     }
 
-
   // Generic version does nothing.
   template<typename _CharT>
     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);
index f9d91de..e9a9e85 100644 (file)
@@ -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"
 }
 
index c16555f..b0c366d 100644 (file)
@@ -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 @@ 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" );
index 8c85fdb..a4a6968 100644 (file)
@@ -45,21 +45,21 @@ void test02()
   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"
 }
 
index 0aae0e2..a95248e 100644 (file)
@@ -45,21 +45,21 @@ void test03()
   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"
 }
 
index e653794..84bd775 100644 (file)
@@ -44,21 +44,21 @@ void test04()
   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"
 }
 
index 2cc6fd8..efe000a 100644 (file)
@@ -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 );
index f75114f..c38ea8f 100644 (file)
@@ -48,11 +48,11 @@ void test06()
   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 );
index 6afe4fc..7d0f63e 100644 (file)
@@ -48,11 +48,11 @@ void test07()
   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 );
index 10e8da4..83f42ae 100644 (file)
@@ -47,11 +47,11 @@ void test08()
   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 );