locale_facets.tcc (num_get<>::do_get(iter_type, ios_base&, ios_base::iostate&, void...
authorPaolo Carlini <pcarlini@suse.de>
Wed, 11 Apr 2007 15:19:15 +0000 (15:19 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 11 Apr 2007 15:19:15 +0000 (15:19 +0000)
2007-04-11  Paolo Carlini  <pcarlini@suse.de>

* include/bits/locale_facets.tcc (num_get<>::do_get(iter_type,
ios_base&, ios_base::iostate&, void*&)): Fix for sizeof(void*)
> sizeof(unsigned long).

* testsuite/22_locale/num_get/get/char/1.cc: Fix void* test.
* testsuite/22_locale/num_get/get/wchar_t/1.cc: Likewise.

* testsuite/22_locale/num_put/put/char/1.cc: Tweak comment.
* testsuite/22_locale/num_put/put/wchar_t/1.cc: Likewise.

From-SVN: r123716

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc
libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc
libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc
libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc

index 31564dddf12b62a62df243273613a08178ad752a..aac7748114385ccd41ddc812656c9dd16d2cc73b 100644 (file)
@@ -1,3 +1,15 @@
+2007-04-11  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/locale_facets.tcc (num_get<>::do_get(iter_type,
+       ios_base&, ios_base::iostate&, void*&)): Fix for sizeof(void*)
+       > sizeof(unsigned long).
+
+       * testsuite/22_locale/num_get/get/char/1.cc: Fix void* test.
+       * testsuite/22_locale/num_get/get/wchar_t/1.cc: Likewise.
+
+       * testsuite/22_locale/num_put/put/char/1.cc: Tweak comment.
+       * testsuite/22_locale/num_put/put/wchar_t/1.cc: Likewise.
+
 2007-04-11  Zack Weinberg  <zack@mrtock.ucsd.edu>
 
        * include/std/iosfwd: Do not include <bits/c++locale.h> and
index fa3ce4e3b1401ccac8b84d7f76215e92ff58a87a..64f148513bfb5ff5e0148a82d2b9dab8e0cdb553 100644 (file)
@@ -890,7 +890,11 @@ _GLIBCXX_BEGIN_LDBL_NAMESPACE
       const fmtflags __fmt = __io.flags();
       __io.flags((__fmt & ~ios_base::basefield) | ios_base::hex);
 
-      unsigned long __ul;
+      typedef __gnu_cxx::__conditional_type<(sizeof(void*)
+                                            <= sizeof(unsigned long)),
+       unsigned long, unsigned long long>::__type _UIntPtrType;       
+
+      _UIntPtrType __ul;
       __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
 
       // Reset from hex formatted input.
index 8ff9852c61645fda04fad48e722ba63607b46e16..266388fcc2dc0809c0600e786d9eb751a8ad6d26 100644 (file)
@@ -2,7 +2,8 @@
 
 // 2001-11-21 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -51,8 +52,7 @@ void test01()
   double d;
   long double ld1 = 6.630025e+4;
   long double ld;
-  void* v;
-  const void* cv = &ul2;
+  void* v = 0;
 
   // cache the num_get facet
   istringstream iss;
@@ -125,12 +125,12 @@ void test01()
   VERIFY( ld == 0 );
   VERIFY( err == goodbit );
 
-  // const void
+  // void*
   iss.str("0xbffff74c,");
   iss.clear();
   err = goodbit;
   ng.get(iss.rdbuf(), 0, iss, err, v);
-  VERIFY( &v != &cv );
+  VERIFY( v != 0 );
   VERIFY( err == goodbit );
 
 #ifdef _GLIBCXX_USE_LONG_LONG
index 4e54397db13795df5e974d9ae68a5b031018b23e..43cfa93df3cf0963793e5a5cbfc48c035149a4a6 100644 (file)
@@ -2,7 +2,8 @@
 
 // 2001-11-21 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -52,7 +53,6 @@ void test01()
   long double ld1 = 6.630025e+4;
   long double ld;
   void* v;
-  const void* cv = &ul2;
 
   // cache the num_get facet
   wistringstream iss;
@@ -124,12 +124,12 @@ void test01()
   VERIFY( ld == 0 );
   VERIFY( err == goodbit );
 
-  // const void
+  // void*
   iss.str(L"0xbffff74c,");
   iss.clear();
   err = goodbit;
   ng.get(iss.rdbuf(), 0, iss, err, v);
-  VERIFY( &v != &cv );
+  VERIFY( v != 0 );
   VERIFY( err == goodbit );
 
 #ifdef _GLIBCXX_USE_LONG_LONG
index 1ea37764835ff5c8a30261da74ec76bb412430df..36c6307bbb06adc28213a8bb37ec3afcd3571705 100644 (file)
@@ -65,7 +65,6 @@ void test01()
   iterator_type os_it01 = np.put(os_it00, oss, '+', b1);
   result1 = oss.str();
   VERIFY( result1 == "1" );
-  //  VERIFY( os_it00 != os_it01 );
 
   oss.str(empty);
   np.put(oss.rdbuf(), oss, '+', b0);
@@ -134,7 +133,7 @@ void test01()
   result1 = oss.str();
   VERIFY( result1 == "0" );
 
-  // const void
+  // const void*
   oss.str(empty);
   oss.clear();
   np.put(oss.rdbuf(), oss, '+', cv);
index 9ff25d5ef86c37d27923fde828ad1bed4c7ad454..f588df3497a576c1ab423b74ec5f4955066d08d9 100644 (file)
@@ -2,7 +2,8 @@
 
 // 2001-11-19 Benjamin Kosnik  <bkoz@redhat.com>
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// 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
@@ -65,7 +66,6 @@ void test01()
   iterator_type os_it01 = np.put(os_it00, oss, L'+', b1);
   result1 = oss.str();
   VERIFY( result1 == L"1" );
-  //  VERIFY( os_it00 != os_it01 );
 
   oss.str(empty);
   np.put(oss.rdbuf(), oss, L'+', b0);
@@ -134,7 +134,7 @@ void test01()
   result1 = oss.str();
   VERIFY( result1 == L"0" );
 
-  // const void
+  // const void*
   oss.str(empty);
   oss.clear();
   np.put(oss.rdbuf(), oss, L'+', cv);