Commit 445877a9 by Paolo Carlini Committed by Paolo Carlini

testsuite_iterators.h: Don't include <cstddef>, don't use NULL, use std::size_t and std::ptrdiff_t.

2010-06-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/util/testsuite_iterators.h: Don't include <cstddef>,
	don't use NULL, use std::size_t and std::ptrdiff_t.
	* testsuite/18_support/exception/38732.cc: Likewise.
	* testsuite/22_locale/time_put/put/wchar_t/12439_1.cc: Likewise.
	* testsuite/22_locale/time_put/put/wchar_t/12439_2.cc: Likewise.
	* testsuite/22_locale/time_put/put/wchar_t/12439_3.cc: Likewise.
	* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
	* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
	* testsuite/23_containers/list/pthread1.cc: Likewise.
	* testsuite/23_containers/map/pthread6.cc: Likewise.
	* testsuite/util/testsuite_hooks.cc: Likewise.
	* config/locale/gnu/codecvt_members.cc: Likewise.
	* config/locale/gnu/messages_members.cc: Likewise.
	* config/locale/gnu/c_locale.h: Likewise.
	* config/locale/gnu/messages_members.h: Likewise.
	* config/locale/gnu/monetary_members.cc: Likewise.
	* config/locale/gnu/time_members.cc: Likewise.
	* config/locale/gnu/time_members.h: Likewise.
	* config/locale/generic/c_locale.cc: Likewise.
	* config/locale/generic/codecvt_members.cc: Likewise.
	* config/locale/generic/c_locale.h: Likewise.
	* config/locale/generic/time_members.cc: Likewise.
	* config/locale/generic/time_members.h: Likewise.

From-SVN: r160238
parent bb6c4ac8
2010-06-03 Paolo Carlini <paolo.carlini@oracle.com> 2010-06-03 Paolo Carlini <paolo.carlini@oracle.com>
* testsuite/util/testsuite_iterators.h: Don't include <cstddef>,
don't use NULL, use std::size_t and std::ptrdiff_t.
* testsuite/18_support/exception/38732.cc: Likewise.
* testsuite/22_locale/time_put/put/wchar_t/12439_1.cc: Likewise.
* testsuite/22_locale/time_put/put/wchar_t/12439_2.cc: Likewise.
* testsuite/22_locale/time_put/put/wchar_t/12439_3.cc: Likewise.
* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
* testsuite/23_containers/list/pthread1.cc: Likewise.
* testsuite/23_containers/map/pthread6.cc: Likewise.
* testsuite/util/testsuite_hooks.cc: Likewise.
* config/locale/gnu/codecvt_members.cc: Likewise.
* config/locale/gnu/messages_members.cc: Likewise.
* config/locale/gnu/c_locale.h: Likewise.
* config/locale/gnu/messages_members.h: Likewise.
* config/locale/gnu/monetary_members.cc: Likewise.
* config/locale/gnu/time_members.cc: Likewise.
* config/locale/gnu/time_members.h: Likewise.
* config/locale/generic/c_locale.cc: Likewise.
* config/locale/generic/codecvt_members.cc: Likewise.
* config/locale/generic/c_locale.h: Likewise.
* config/locale/generic/time_members.cc: Likewise.
* config/locale/generic/time_members.h: Likewise.
2010-06-03 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/c++config (std::size_t, std::ptrdiff_t, * include/bits/c++config (std::size_t, std::ptrdiff_t,
std::nullptr_t): Provide typedefs. std::nullptr_t): Provide typedefs.
* include/c_std/cstddef: Don't provide std::size_t and * include/c_std/cstddef: Don't provide std::size_t and
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <cstdio> #include <cstdio>
#include <locale> #include <locale>
#include <limits> #include <limits>
#include <cstddef>
#ifdef _GLIBCXX_HAVE_IEEEFP_H #ifdef _GLIBCXX_HAVE_IEEEFP_H
#include <ieeefp.h> #include <ieeefp.h>
...@@ -50,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -50,7 +49,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __c_locale&) throw() const __c_locale&) throw()
{ {
// Assumes __s formatted for "C" locale. // Assumes __s formatted for "C" locale.
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __len = strlen(__old) + 1; const size_t __len = strlen(__old) + 1;
char* __sav = new char[__len]; char* __sav = new char[__len];
memcpy(__sav, __old, __len); memcpy(__sav, __old, __len);
...@@ -115,7 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -115,7 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const __c_locale&) throw() const __c_locale&) throw()
{ {
// Assumes __s formatted for "C" locale. // Assumes __s formatted for "C" locale.
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __len = strlen(__old) + 1; const size_t __len = strlen(__old) + 1;
char* __sav = new char[__len]; char* __sav = new char[__len];
memcpy(__sav, __old, __len); memcpy(__sav, __old, __len);
...@@ -160,7 +159,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -160,7 +159,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
ios_base::iostate& __err, const __c_locale&) throw() ios_base::iostate& __err, const __c_locale&) throw()
{ {
// Assumes __s formatted for "C" locale. // Assumes __s formatted for "C" locale.
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __len = strlen(__old) + 1; const size_t __len = strlen(__old) + 1;
char* __sav = new char[__len]; char* __sav = new char[__len];
memcpy(__sav, __old, __len); memcpy(__sav, __old, __len);
...@@ -212,7 +211,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -212,7 +211,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ {
// Currently, the generic model only supports the "C" locale. // Currently, the generic model only supports the "C" locale.
// See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html // See http://gcc.gnu.org/ml/libstdc++/2003-02/msg00345.html
__cloc = NULL; __cloc = 0;
if (strcmp(__s, "C")) if (strcmp(__s, "C"))
__throw_runtime_error(__N("locale::facet::_S_create_c_locale " __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
"name not valid")); "name not valid"));
...@@ -220,7 +219,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -220,7 +219,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
void void
locale::facet::_S_destroy_c_locale(__c_locale& __cloc) locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
{ __cloc = NULL; } { __cloc = 0; }
__c_locale __c_locale
locale::facet::_S_clone_c_locale(__c_locale&) throw() locale::facet::_S_clone_c_locale(__c_locale&) throw()
......
// Wrapper for underlying C-language localization -*- C++ -*- // Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <clocale> #include <clocale>
#include <cstddef>
#define _GLIBCXX_NUM_CATEGORIES 0 #define _GLIBCXX_NUM_CATEGORIES 0
...@@ -57,8 +56,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -57,8 +56,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const int __size __attribute__((__unused__)), const int __size __attribute__((__unused__)),
const char* __fmt, ...) const char* __fmt, ...)
{ {
char* __old = std::setlocale(LC_NUMERIC, NULL); char* __old = std::setlocale(LC_NUMERIC, 0);
char* __sav = NULL; char* __sav = 0;
if (__builtin_strcmp(__old, "C")) if (__builtin_strcmp(__old, "C"))
{ {
const size_t __len = __builtin_strlen(__old) + 1; const size_t __len = __builtin_strlen(__old) + 1;
......
// std::codecvt implementation details, generic version -*- C++ -*- // std::codecvt implementation details, generic version -*- C++ -*-
// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 // Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
while (__from < __end && __max) while (__from < __end && __max)
{ {
size_t __conv = mbrtowc(NULL, __from, __end - __from, &__tmp_state); size_t __conv = mbrtowc(0, __from, __end - __from, &__tmp_state);
if (__conv == static_cast<size_t>(-1)) if (__conv == static_cast<size_t>(-1))
{ {
// Invalid source character // Invalid source character
......
...@@ -42,7 +42,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -42,7 +42,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_put(char* __s, size_t __maxlen, const char* __format, _M_put(char* __s, size_t __maxlen, const char* __format,
const tm* __tm) const throw() const tm* __tm) const throw()
{ {
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
...@@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -127,7 +127,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
const tm* __tm) const throw() const tm* __tm) const throw()
{ {
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
......
// std::time_get, std::time_put implementation, generic version -*- C++ -*- // std::time_get, std::time_put implementation, generic version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
// 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -39,7 +40,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -39,7 +40,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT> template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs) __timepunct<_CharT>::__timepunct(size_t __refs)
: facet(__refs), _M_data(NULL) : facet(__refs), _M_data(0)
{ {
_M_name_timepunct = _S_get_c_name(); _M_name_timepunct = _S_get_c_name();
_M_initialize_timepunct(); _M_initialize_timepunct();
...@@ -56,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -56,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT> template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs) size_t __refs)
: facet(__refs), _M_data(NULL) : facet(__refs), _M_data(0)
{ {
if (__builtin_strcmp(__s, _S_get_c_name()) != 0) if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
{ {
......
// Wrapper for underlying C-language localization -*- C++ -*- // Wrapper for underlying C-language localization -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#pragma GCC system_header #pragma GCC system_header
#include <clocale> #include <clocale>
#include <cstddef>
#define _GLIBCXX_C_LOCALE_GNU 1 #define _GLIBCXX_C_LOCALE_GNU 1
...@@ -71,8 +70,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -71,8 +70,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __gnu_cxx::__uselocale(__cloc); __c_locale __old = __gnu_cxx::__uselocale(__cloc);
#else #else
char* __old = std::setlocale(LC_NUMERIC, NULL); char* __old = std::setlocale(LC_NUMERIC, 0);
char* __sav = NULL; char* __sav = 0;
if (__builtin_strcmp(__old, "C")) if (__builtin_strcmp(__old, "C"))
{ {
const size_t __len = __builtin_strlen(__old) + 1; const size_t __len = __builtin_strlen(__old) + 1;
......
// std::codecvt implementation details, GNU version -*- C++ -*- // std::codecvt implementation details, GNU version -*- C++ -*-
// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 // Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -268,7 +268,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -268,7 +268,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
// mbrtowc. // mbrtowc.
for (__from = __tmp_from;; __from += __conv) for (__from = __tmp_from;; __from += __conv)
{ {
__conv = mbrtowc(NULL, __from, __end - __from, __conv = mbrtowc(0, __from, __end - __from,
&__tmp_state); &__tmp_state);
if (__conv == static_cast<size_t>(-1) if (__conv == static_cast<size_t>(-1)
|| __conv == static_cast<size_t>(-2)) || __conv == static_cast<size_t>(-2))
......
// std::messages implementation details, GNU version -*- C++ -*- // std::messages implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2005, 2009 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2005, 2009, 2010 Free Software Foundation, Inc.
// //
// 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
...@@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -44,7 +44,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__uselocale(__old); __uselocale(__old);
return string(__msg); return string(__msg);
#else #else
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __len = strlen(__old) + 1; const size_t __len = strlen(__old) + 1;
char* __sav = new char[__len]; char* __sav = new char[__len];
memcpy(__sav, __old, __len); memcpy(__sav, __old, __len);
...@@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -67,7 +67,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__uselocale(__old); __uselocale(__old);
return _M_convert_from_char(__msg); return _M_convert_from_char(__msg);
# else # else
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __len = strlen(__old) + 1; const size_t __len = strlen(__old) + 1;
char* __sav = new char[__len]; char* __sav = new char[__len];
memcpy(__sav, __old, __len); memcpy(__sav, __old, __len);
......
// std::messages implementation details, GNU version -*- C++ -*- // std::messages implementation details, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -48,7 +48,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT> template<typename _CharT>
messages<_CharT>::messages(__c_locale __cloc, const char* __s, messages<_CharT>::messages(__c_locale __cloc, const char* __s,
size_t __refs) size_t __refs)
: facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL) : facet(__refs), _M_c_locale_messages(0), _M_name_messages(0)
{ {
if (__builtin_strcmp(__s, _S_get_c_name()) != 0) if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
{ {
......
...@@ -574,7 +574,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -574,7 +574,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__c_locale __old = __uselocale(__cloc); __c_locale __old = __uselocale(__cloc);
#else #else
// Switch to named locale so that mbsrtowcs will work. // Switch to named locale so that mbsrtowcs will work.
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
...@@ -757,7 +757,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -757,7 +757,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__c_locale __old = __uselocale(__cloc); __c_locale __old = __uselocale(__cloc);
#else #else
// Switch to named locale so that mbsrtowcs will work. // Switch to named locale so that mbsrtowcs will work.
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
......
...@@ -45,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -45,7 +45,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
_M_c_locale_timepunct); _M_c_locale_timepunct);
#else #else
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
...@@ -201,7 +201,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -201,7 +201,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
_M_c_locale_timepunct); _M_c_locale_timepunct);
#else #else
char* __old = setlocale(LC_ALL, NULL); char* __old = setlocale(LC_ALL, 0);
const size_t __llen = strlen(__old) + 1; const size_t __llen = strlen(__old) + 1;
char* __sav = new char[__llen]; char* __sav = new char[__llen];
memcpy(__sav, __old, __llen); memcpy(__sav, __old, __llen);
......
// std::time_get, std::time_put implementation, GNU version -*- C++ -*- // std::time_get, std::time_put implementation, GNU version -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
// 2009, 2010
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// 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
...@@ -39,21 +40,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -39,21 +40,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
template<typename _CharT> template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs) __timepunct<_CharT>::__timepunct(size_t __refs)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), : facet(__refs), _M_data(0), _M_c_locale_timepunct(0),
_M_name_timepunct(_S_get_c_name()) _M_name_timepunct(_S_get_c_name())
{ _M_initialize_timepunct(); } { _M_initialize_timepunct(); }
template<typename _CharT> template<typename _CharT>
__timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
: facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(0),
_M_name_timepunct(_S_get_c_name()) _M_name_timepunct(_S_get_c_name())
{ _M_initialize_timepunct(); } { _M_initialize_timepunct(); }
template<typename _CharT> template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs) size_t __refs)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), : facet(__refs), _M_data(0), _M_c_locale_timepunct(0),
_M_name_timepunct(NULL) _M_name_timepunct(0)
{ {
if (__builtin_strcmp(__s, _S_get_c_name()) != 0) if (__builtin_strcmp(__s, _S_get_c_name()) != 0)
{ {
......
// Copyright (C) 2009 Free Software Foundation, Inc. // Copyright (C) 2009, 2010 Free Software Foundation, Inc.
// //
// 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
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <typeinfo> #include <typeinfo>
#include <exception> #include <exception>
#include <cstddef>
#include "unwind.h" #include "unwind.h"
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
...@@ -67,21 +66,21 @@ void test01 () ...@@ -67,21 +66,21 @@ void test01 ()
throw 0; throw 0;
} catch(...) { } catch(...) {
__cxa_exception *exc = __cxa_get_globals()->caughtExceptions; __cxa_exception *exc = __cxa_get_globals()->caughtExceptions;
VERIFY ( exc != NULL ); VERIFY ( exc != 0 );
VERIFY ( typeid(int) == *exc->exceptionType ); VERIFY ( typeid(int) == *exc->exceptionType );
} }
try { try {
throw 0LL; throw 0LL;
} catch(...) { } catch(...) {
__cxa_exception *exc = __cxa_get_globals()->caughtExceptions; __cxa_exception *exc = __cxa_get_globals()->caughtExceptions;
VERIFY ( exc != NULL ); VERIFY ( exc != 0 );
VERIFY ( typeid(long long int) == *exc->exceptionType ); VERIFY ( typeid(long long int) == *exc->exceptionType );
} }
try { try {
throw 0.0; throw 0.0;
} catch(...) { } catch(...) {
__cxa_exception *exc = __cxa_get_globals()->caughtExceptions; __cxa_exception *exc = __cxa_get_globals()->caughtExceptions;
VERIFY ( exc != NULL ); VERIFY ( exc != 0 );
VERIFY ( typeid(double) == *exc->exceptionType ); VERIFY ( typeid(double) == *exc->exceptionType );
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// { dg-options "-pthreads" { target *-*-solaris* } } // { dg-options "-pthreads" { target *-*-solaris* } }
// { dg-require-namedlocale "" } // { dg-require-namedlocale "" }
// Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation // Copyright (C) 2004, 2005, 2007, 2009, 2010 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
...@@ -55,10 +55,10 @@ main() ...@@ -55,10 +55,10 @@ main()
loc[j] = std::locale(j % 2 ? "en_US" : "fr_FR"); loc[j] = std::locale(j % 2 ? "en_US" : "fr_FR");
for (int i = 0; i < max_thread_count; i++) for (int i = 0; i < max_thread_count; i++)
pthread_create(&tid[i], NULL, thread_main, 0); pthread_create(&tid[i], 0, thread_main, 0);
for (int i = 0; i < max_thread_count; i++) for (int i = 0; i < max_thread_count; i++)
pthread_join(tid[i], NULL); pthread_join(tid[i], 0);
return 0; return 0;
} }
// Copyright (C) 2003, 2009 Free Software Foundation // Copyright (C) 2003, 2009, 2010 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
...@@ -45,7 +45,7 @@ void test01() ...@@ -45,7 +45,7 @@ void test01()
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
wostringstream stream; wostringstream stream;
time_t tt = time(NULL); time_t tt = time(0);
const wchar_t* fmt = L"%c"; const wchar_t* fmt = L"%c";
......
// Copyright (C) 2003, 2009 Free Software Foundation // Copyright (C) 2003, 2009, 2010 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
...@@ -42,7 +42,7 @@ void test02() ...@@ -42,7 +42,7 @@ void test02()
locale loc; locale loc;
const tp_type& tp = use_facet<tp_type>(loc); const tp_type& tp = use_facet<tp_type>(loc);
time_t tt = time(NULL); time_t tt = time(0);
wostringstream stream; wostringstream stream;
tp.put(tp_type::iter_type(stream), stream, stream.fill(), tp.put(tp_type::iter_type(stream), stream, stream.fill(),
......
// Copyright (C) 2003, 2009 Free Software Foundation // Copyright (C) 2003, 2009, 2010 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
...@@ -44,7 +44,7 @@ void test03() ...@@ -44,7 +44,7 @@ void test03()
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
wostringstream stream; wostringstream stream;
time_t tt = time(NULL); time_t tt = time(0);
const wchar_t* fmt = L"%c"; const wchar_t* fmt = L"%c";
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#include <list> #include <list>
#include <cstdlib> #include <cstdlib>
#include <cstddef>
#include <pthread.h> #include <pthread.h>
const int thread_cycles = 10; const int thread_cycles = 10;
...@@ -46,9 +45,9 @@ class task_queue ...@@ -46,9 +45,9 @@ class task_queue
public: public:
task_queue () task_queue ()
{ {
pthread_mutex_init (&fooLock, NULL); pthread_mutex_init (&fooLock, 0);
pthread_cond_init (&fooCond1, NULL); pthread_cond_init (&fooCond1, 0);
pthread_cond_init (&fooCond2, NULL); pthread_cond_init (&fooCond2, 0);
} }
~task_queue () ~task_queue ()
{ {
...@@ -116,14 +115,14 @@ main() ...@@ -116,14 +115,14 @@ main()
for (int i = 0; i < thread_pairs; i++) for (int i = 0; i < thread_pairs; i++)
{ {
tq[i] = new task_queue; tq[i] = new task_queue;
pthread_create (&prod[i], NULL, produce, static_cast<void*> (tq[i])); pthread_create (&prod[i], 0, produce, static_cast<void*> (tq[i]));
pthread_create (&cons[i], NULL, consume, static_cast<void*> (tq[i])); pthread_create (&cons[i], 0, consume, static_cast<void*> (tq[i]));
} }
for (int i = 0; i < thread_pairs; i++) for (int i = 0; i < thread_pairs; i++)
{ {
pthread_join (prod[i], NULL); pthread_join (prod[i], 0);
pthread_join (cons[i], NULL); pthread_join (cons[i], 0);
delete tq[i]; delete tq[i];
} }
} }
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
#include <cstddef>
#include <pthread.h> #include <pthread.h>
const int max_thread_count = 8; const int max_thread_count = 8;
...@@ -79,10 +78,10 @@ main (void) ...@@ -79,10 +78,10 @@ main (void)
#endif #endif
for (int i = 0; i < max_thread_count; i++) for (int i = 0; i < max_thread_count; i++)
pthread_create (&tid[i], NULL, thread_main, 0); pthread_create (&tid[i], 0, thread_main, 0);
for (int i = 0; i < max_thread_count; i++) for (int i = 0; i < max_thread_count; i++)
pthread_join (tid[i], NULL); pthread_join (tid[i], 0);
return 0; return 0;
} }
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include <list> #include <list>
#include <string> #include <string>
#include <stdexcept> #include <stdexcept>
#include <cstddef>
#include <clocale> #include <clocale>
#include <cstdlib> #include <cstdlib>
#include <locale> #include <locale>
...@@ -176,7 +175,7 @@ namespace __gnu_test ...@@ -176,7 +175,7 @@ namespace __gnu_test
const func_callback::test_type* tests = l.tests(); const func_callback::test_type* tests = l.tests();
for (int i = 0; i < l.size(); ++i) for (int i = 0; i < l.size(); ++i)
(*tests[i])(); (*tests[i])();
string postLC_ALL= setlocale(LC_ALL, NULL); string postLC_ALL= setlocale(LC_ALL, 0);
VERIFY( preLC_ALL == postLC_ALL ); VERIFY( preLC_ALL == postLC_ALL );
} }
else else
......
...@@ -118,7 +118,7 @@ namespace __gnu_test ...@@ -118,7 +118,7 @@ namespace __gnu_test
*/ */
template<class T> template<class T>
struct output_iterator_wrapper struct output_iterator_wrapper
: public std::iterator<std::output_iterator_tag, T, ptrdiff_t, T*, T&> : public std::iterator<std::output_iterator_tag, T, std::ptrdiff_t, T*, T&>
{ {
typedef OutputContainer<T> ContainerType; typedef OutputContainer<T> ContainerType;
T* ptr; T* ptr;
...@@ -179,7 +179,7 @@ namespace __gnu_test ...@@ -179,7 +179,7 @@ namespace __gnu_test
*/ */
template<class T> template<class T>
class input_iterator_wrapper class input_iterator_wrapper
: public std::iterator<std::input_iterator_tag, T, ptrdiff_t, T*, T&> : public std::iterator<std::input_iterator_tag, T, std::ptrdiff_t, T*, T&>
{ {
protected: protected:
input_iterator_wrapper() input_iterator_wrapper()
...@@ -435,7 +435,7 @@ namespace __gnu_test ...@@ -435,7 +435,7 @@ namespace __gnu_test
} }
random_access_iterator_wrapper& random_access_iterator_wrapper&
operator+=(ptrdiff_t n) operator+=(std::ptrdiff_t n)
{ {
if(n > 0) if(n > 0)
{ {
...@@ -451,17 +451,17 @@ namespace __gnu_test ...@@ -451,17 +451,17 @@ namespace __gnu_test
} }
random_access_iterator_wrapper& random_access_iterator_wrapper&
operator-=(ptrdiff_t n) operator-=(std::ptrdiff_t n)
{ return *this += -n; } { return *this += -n; }
random_access_iterator_wrapper random_access_iterator_wrapper
operator-(ptrdiff_t n) const operator-(std::ptrdiff_t n) const
{ {
random_access_iterator_wrapper<T> tmp = *this; random_access_iterator_wrapper<T> tmp = *this;
return tmp -= n; return tmp -= n;
} }
ptrdiff_t std::ptrdiff_t
operator-(const random_access_iterator_wrapper<T>& in) const operator-(const random_access_iterator_wrapper<T>& in) const
{ {
ITERATOR_VERIFY(this->SharedInfo == in.SharedInfo); ITERATOR_VERIFY(this->SharedInfo == in.SharedInfo);
...@@ -469,7 +469,7 @@ namespace __gnu_test ...@@ -469,7 +469,7 @@ namespace __gnu_test
} }
T& T&
operator[](ptrdiff_t n) const operator[](std::ptrdiff_t n) const
{ return *(*this + n); } { return *(*this + n); }
bool bool
...@@ -500,12 +500,12 @@ namespace __gnu_test ...@@ -500,12 +500,12 @@ namespace __gnu_test
template<typename T> template<typename T>
random_access_iterator_wrapper<T> random_access_iterator_wrapper<T>
operator+(random_access_iterator_wrapper<T> it, ptrdiff_t n) operator+(random_access_iterator_wrapper<T> it, std::ptrdiff_t n)
{ return it += n; } { return it += n; }
template<typename T> template<typename T>
random_access_iterator_wrapper<T> random_access_iterator_wrapper<T>
operator+(ptrdiff_t n, random_access_iterator_wrapper<T> it) operator+(std::ptrdiff_t n, random_access_iterator_wrapper<T> it)
{ return it += n; } { return it += n; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment