diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-06-03 23:11:46 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-06-03 23:11:46 +0000 |
commit | 445877a9da79aad47e0eb895dd0270fda8a29b85 (patch) | |
tree | eb879b8d32b59d997be9b0c425cc28a80cfcb039 /libstdc++-v3/testsuite | |
parent | bb6c4ac85a9fe189488bbe48541218b61342937f (diff) | |
download | gcc-445877a9da79aad47e0eb895dd0270fda8a29b85.zip gcc-445877a9da79aad47e0eb895dd0270fda8a29b85.tar.gz gcc-445877a9da79aad47e0eb895dd0270fda8a29b85.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3/testsuite')
9 files changed, 32 insertions, 36 deletions
diff --git a/libstdc++-v3/testsuite/18_support/exception/38732.cc b/libstdc++-v3/testsuite/18_support/exception/38732.cc index 43cf5b8..7c70f3a 100644 --- a/libstdc++-v3/testsuite/18_support/exception/38732.cc +++ b/libstdc++-v3/testsuite/18_support/exception/38732.cc @@ -1,4 +1,4 @@ -// 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 // software; you can redistribute it and/or modify it under the @@ -17,7 +17,6 @@ #include <typeinfo> #include <exception> -#include <cstddef> #include "unwind.h" #include <testsuite_hooks.h> @@ -67,21 +66,21 @@ void test01 () throw 0; } catch(...) { __cxa_exception *exc = __cxa_get_globals()->caughtExceptions; - VERIFY ( exc != NULL ); + VERIFY ( exc != 0 ); VERIFY ( typeid(int) == *exc->exceptionType ); } try { throw 0LL; } catch(...) { __cxa_exception *exc = __cxa_get_globals()->caughtExceptions; - VERIFY ( exc != NULL ); + VERIFY ( exc != 0 ); VERIFY ( typeid(long long int) == *exc->exceptionType ); } try { throw 0.0; } catch(...) { __cxa_exception *exc = __cxa_get_globals()->caughtExceptions; - VERIFY ( exc != NULL ); + VERIFY ( exc != 0 ); VERIFY ( typeid(double) == *exc->exceptionType ); } } diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc index 2d92afc..5b882cc 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc @@ -3,7 +3,7 @@ // { dg-options "-pthreads" { target *-*-solaris* } } // { 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 // software; you can redistribute it and/or modify it under the @@ -55,10 +55,10 @@ main() loc[j] = std::locale(j % 2 ? "en_US" : "fr_FR"); 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++) - pthread_join(tid[i], NULL); + pthread_join(tid[i], 0); return 0; } diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc index 159b8f1..1298fa9 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc @@ -1,4 +1,4 @@ -// 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 // software; you can redistribute it and/or modify it under the @@ -45,7 +45,7 @@ void test01() bool test __attribute__((unused)) = true; wostringstream stream; - time_t tt = time(NULL); + time_t tt = time(0); const wchar_t* fmt = L"%c"; diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc index 515c998..c231354 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc @@ -1,4 +1,4 @@ -// 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 // software; you can redistribute it and/or modify it under the @@ -42,7 +42,7 @@ void test02() locale loc; const tp_type& tp = use_facet<tp_type>(loc); - time_t tt = time(NULL); + time_t tt = time(0); wostringstream stream; tp.put(tp_type::iter_type(stream), stream, stream.fill(), diff --git a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc index 8127c75..2ec4225 100644 --- a/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc +++ b/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc @@ -1,4 +1,4 @@ -// 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 // software; you can redistribute it and/or modify it under the @@ -44,7 +44,7 @@ void test03() bool test __attribute__((unused)) = true; wostringstream stream; - time_t tt = time(NULL); + time_t tt = time(0); const wchar_t* fmt = L"%c"; diff --git a/libstdc++-v3/testsuite/23_containers/list/pthread1.cc b/libstdc++-v3/testsuite/23_containers/list/pthread1.cc index 7a1de4d..00dc817 100644 --- a/libstdc++-v3/testsuite/23_containers/list/pthread1.cc +++ b/libstdc++-v3/testsuite/23_containers/list/pthread1.cc @@ -31,7 +31,6 @@ #include <list> #include <cstdlib> -#include <cstddef> #include <pthread.h> const int thread_cycles = 10; @@ -46,9 +45,9 @@ class task_queue public: task_queue () { - pthread_mutex_init (&fooLock, NULL); - pthread_cond_init (&fooCond1, NULL); - pthread_cond_init (&fooCond2, NULL); + pthread_mutex_init (&fooLock, 0); + pthread_cond_init (&fooCond1, 0); + pthread_cond_init (&fooCond2, 0); } ~task_queue () { @@ -116,14 +115,14 @@ main() for (int i = 0; i < thread_pairs; i++) { tq[i] = new task_queue; - pthread_create (&prod[i], NULL, produce, static_cast<void*> (tq[i])); - pthread_create (&cons[i], NULL, consume, static_cast<void*> (tq[i])); + pthread_create (&prod[i], 0, produce, static_cast<void*> (tq[i])); + pthread_create (&cons[i], 0, consume, static_cast<void*> (tq[i])); } for (int i = 0; i < thread_pairs; i++) { - pthread_join (prod[i], NULL); - pthread_join (cons[i], NULL); + pthread_join (prod[i], 0); + pthread_join (cons[i], 0); delete tq[i]; } } diff --git a/libstdc++-v3/testsuite/23_containers/map/pthread6.cc b/libstdc++-v3/testsuite/23_containers/map/pthread6.cc index 8680ebb..38c20ed 100644 --- a/libstdc++-v3/testsuite/23_containers/map/pthread6.cc +++ b/libstdc++-v3/testsuite/23_containers/map/pthread6.cc @@ -26,7 +26,6 @@ #include <string> #include <map> #include <vector> -#include <cstddef> #include <pthread.h> const int max_thread_count = 8; @@ -79,10 +78,10 @@ main (void) #endif 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++) - pthread_join (tid[i], NULL); + pthread_join (tid[i], 0); return 0; } diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.cc b/libstdc++-v3/testsuite/util/testsuite_hooks.cc index 5b5b0d5..1ead348 100644 --- a/libstdc++-v3/testsuite/util/testsuite_hooks.cc +++ b/libstdc++-v3/testsuite/util/testsuite_hooks.cc @@ -32,7 +32,6 @@ #include <list> #include <string> #include <stdexcept> -#include <cstddef> #include <clocale> #include <cstdlib> #include <locale> @@ -176,7 +175,7 @@ namespace __gnu_test const func_callback::test_type* tests = l.tests(); for (int i = 0; i < l.size(); ++i) (*tests[i])(); - string postLC_ALL= setlocale(LC_ALL, NULL); + string postLC_ALL= setlocale(LC_ALL, 0); VERIFY( preLC_ALL == postLC_ALL ); } else diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h index ee0c8e6..e7a068d 100644 --- a/libstdc++-v3/testsuite/util/testsuite_iterators.h +++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h @@ -118,7 +118,7 @@ namespace __gnu_test */ template<class T> 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; T* ptr; @@ -179,7 +179,7 @@ namespace __gnu_test */ template<class T> 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: input_iterator_wrapper() @@ -435,7 +435,7 @@ namespace __gnu_test } random_access_iterator_wrapper& - operator+=(ptrdiff_t n) + operator+=(std::ptrdiff_t n) { if(n > 0) { @@ -451,17 +451,17 @@ namespace __gnu_test } random_access_iterator_wrapper& - operator-=(ptrdiff_t n) + operator-=(std::ptrdiff_t n) { return *this += -n; } random_access_iterator_wrapper - operator-(ptrdiff_t n) const + operator-(std::ptrdiff_t n) const { random_access_iterator_wrapper<T> tmp = *this; return tmp -= n; } - ptrdiff_t + std::ptrdiff_t operator-(const random_access_iterator_wrapper<T>& in) const { ITERATOR_VERIFY(this->SharedInfo == in.SharedInfo); @@ -469,7 +469,7 @@ namespace __gnu_test } T& - operator[](ptrdiff_t n) const + operator[](std::ptrdiff_t n) const { return *(*this + n); } bool @@ -500,12 +500,12 @@ namespace __gnu_test template<typename 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; } template<typename 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; } |