diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-01 22:22:57 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-01 22:22:57 +0000 |
commit | 9e169c4bf36a38689550c059570c57efbf00a6fb (patch) | |
tree | 95e6800f7ac2a49ff7f799d96f04172320e70ac0 /libstdc++-v3/include/ext | |
parent | 6170dfb6edfb7b19f8ae5209b8f948fe0076a4ad (diff) | |
download | gcc-vect256.tar.gz |
Merged trunk at revision 161680 into branch.vect256
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/vect256@161681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext')
139 files changed, 689 insertions, 676 deletions
diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm index 5956e24bcd0..cac4ff70e8e 100644 --- a/libstdc++-v3/include/ext/algorithm +++ b/libstdc++-v3/include/ext/algorithm @@ -123,8 +123,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) __glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, typename iterator_traits<_InputIterator>::value_type>) - return __copy_n(__first, __count, __result, - std::__iterator_category(__first)); + return __gnu_cxx::__copy_n(__first, __count, __result, + std::__iterator_category(__first)); } template<typename _InputIterator1, typename _InputIterator2> diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h index 36f15fe936c..ca4d0d19b01 100644 --- a/libstdc++-v3/include/ext/array_allocator.h +++ b/libstdc++-v3/include/ext/array_allocator.h @@ -30,7 +30,7 @@ #ifndef _ARRAY_ALLOCATOR_H #define _ARRAY_ALLOCATOR_H 1 -#include <cstddef> +#include <bits/c++config.h> #include <new> #include <bits/functexcept.h> #include <tr1/array> @@ -114,7 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) struct rebind { typedef array_allocator<_Tp1, _Array1> other; }; - array_allocator(array_type* __array = NULL) throw() + array_allocator(array_type* __array = 0) throw() : _M_array(__array), _M_used(size_type()) { } array_allocator(const array_allocator& __o) throw() @@ -122,7 +122,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) template<typename _Tp1, typename _Array1> array_allocator(const array_allocator<_Tp1, _Array1>&) throw() - : _M_array(NULL), _M_used(size_type()) { } + : _M_array(0), _M_used(size_type()) { } ~array_allocator() throw() { } diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h index 05285f548cc..2aa08706c9d 100644 --- a/libstdc++-v3/include/ext/bitmap_allocator.h +++ b/libstdc++-v3/include/ext/bitmap_allocator.h @@ -30,9 +30,8 @@ #ifndef _BITMAP_ALLOCATOR_H #define _BITMAP_ALLOCATOR_H 1 -#include <cstddef> // For std::size_t, and ptrdiff_t. -#include <bits/functexcept.h> // For __throw_bad_alloc(). #include <utility> // For std::pair. +#include <bits/functexcept.h> // For __throw_bad_alloc(). #include <functional> // For greater_equal, and less_equal. #include <new> // For operator new. #include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT diff --git a/libstdc++-v3/include/ext/codecvt_specializations.h b/libstdc++-v3/include/ext/codecvt_specializations.h index 89adb3f20d4..53295891bac 100644 --- a/libstdc++-v3/include/ext/codecvt_specializations.h +++ b/libstdc++-v3/include/ext/codecvt_specializations.h @@ -1,7 +1,8 @@ // Locale support (codecvt) -*- C++ -*- -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 -// Free Software Foundation, Inc. +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +// 2008, 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 @@ -381,7 +382,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) // Argument list for iconv specifies a byte sequence. Thus, // all to/from arrays must be brutally casted to char*. char* __cto = reinterpret_cast<char*>(__to); - size_t __conv = __iconv_adaptor(iconv,__desc, NULL, NULL, + size_t __conv = __iconv_adaptor(iconv,__desc, 0, 0, &__cto, &__tlen); if (__conv != size_t(-1)) diff --git a/libstdc++-v3/include/ext/functional b/libstdc++-v3/include/ext/functional index 546b9c68d6c..7cf6a45a0a3 100644 --- a/libstdc++-v3/include/ext/functional +++ b/libstdc++-v3/include/ext/functional @@ -1,6 +1,6 @@ // Functional extensions -*- C++ -*- -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -60,7 +60,6 @@ #pragma GCC system_header #include <functional> -#include <cstddef> _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h index 8fdb2f6393b..1f6561db464 100644 --- a/libstdc++-v3/include/ext/mt_allocator.h +++ b/libstdc++-v3/include/ext/mt_allocator.h @@ -154,11 +154,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) explicit __pool_base() - : _M_options(_Tune()), _M_binmap(NULL), _M_init(false) { } + : _M_options(_Tune()), _M_binmap(0), _M_init(false) { } explicit __pool_base(const _Tune& __options) - : _M_options(__options), _M_binmap(NULL), _M_init(false) { } + : _M_options(__options), _M_binmap(0), _M_init(false) { } private: explicit @@ -235,10 +235,10 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { } explicit __pool() - : _M_bin(NULL), _M_bin_size(1) { } + : _M_bin(0), _M_bin_size(1) { } explicit __pool(const __pool_base::_Tune& __tune) - : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1) { } + : __pool_base(__tune), _M_bin(0), _M_bin_size(1) { } private: // An "array" of bin_records each of which represents a specific @@ -358,12 +358,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _M_get_thread_id(); explicit __pool() - : _M_bin(NULL), _M_bin_size(1), _M_thread_freelist(NULL) + : _M_bin(0), _M_bin_size(1), _M_thread_freelist(0) { } explicit __pool(const __pool_base::_Tune& __tune) - : __pool_base(__tune), _M_bin(NULL), _M_bin_size(1), - _M_thread_freelist(NULL) + : __pool_base(__tune), _M_bin(0), _M_bin_size(1), + _M_thread_freelist(0) { } private: diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h index beaddddf9ee..54505654207 100644 --- a/libstdc++-v3/include/ext/new_allocator.h +++ b/libstdc++-v3/include/ext/new_allocator.h @@ -30,6 +30,7 @@ #ifndef _NEW_ALLOCATOR_H #define _NEW_ALLOCATOR_H 1 +#include <bits/c++config.h> #include <new> #include <bits/functexcept.h> #include <bits/move.h> diff --git a/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp b/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp index dca953b4911..9cec3b72c54 100644 --- a/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp +++ b/libstdc++-v3/include/ext/pb_ds/assoc_container.hpp @@ -41,6 +41,7 @@ #ifndef PB_DS_ASSOC_CNTNR_HPP #define PB_DS_ASSOC_CNTNR_HPP +#include <bits/c++config.h> #include <ext/typelist.h> #include <ext/pb_ds/tag_and_trait.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> diff --git a/libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp b/libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp index 757b90956de..d9cc2dbfc44 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp @@ -38,8 +38,8 @@ * Contains an implementation class for tree-like classes. */ -#ifndef PB_DS_NULL_NODE_METADATA_HPP -#define PB_DS_NULL_NODE_METADATA_HPP +#ifndef PB_DS_0_NODE_METADATA_HPP +#define PB_DS_0_NODE_METADATA_HPP #include <ext/pb_ds/detail/types_traits.hpp> diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp index 925d204dc6b..b9f80e960aa 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp @@ -92,7 +92,7 @@ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) : __try { m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent); - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) m_p_head->m_p_parent->m_p_parent = m_p_head; m_size = other.m_size; initialize_min_max(); @@ -142,7 +142,7 @@ void PB_DS_CLASS_C_DEC:: initialize() { - m_p_head->m_p_parent = NULL; + m_p_head->m_p_parent = 0; m_p_head->m_p_left = m_p_head; m_p_head->m_p_right = m_p_head; m_size = 0; @@ -153,8 +153,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: recursive_copy_node(const node_pointer p_nd) { - if (p_nd == NULL) - return (NULL); + if (p_nd == 0) + return (0); node_pointer p_ret = s_node_allocator.allocate(1); __try @@ -167,7 +167,7 @@ recursive_copy_node(const node_pointer p_nd) __throw_exception_again; } - p_ret->m_p_left = p_ret->m_p_right = NULL; + p_ret->m_p_left = p_ret->m_p_right = 0; __try { @@ -180,10 +180,10 @@ recursive_copy_node(const node_pointer p_nd) __throw_exception_again; } - if (p_ret->m_p_left != NULL) + if (p_ret->m_p_left != 0) p_ret->m_p_left->m_p_parent = p_ret; - if (p_ret->m_p_right != NULL) + if (p_ret->m_p_right != 0) p_ret->m_p_right->m_p_parent = p_ret; _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_ret);) @@ -195,7 +195,7 @@ void PB_DS_CLASS_C_DEC:: initialize_min_max() { - if (m_p_head->m_p_parent == NULL) + if (m_p_head->m_p_parent == 0) { m_p_head->m_p_left = m_p_head->m_p_right = m_p_head; return; @@ -203,14 +203,14 @@ initialize_min_max() { node_pointer p_min = m_p_head->m_p_parent; - while (p_min->m_p_left != NULL) + while (p_min->m_p_left != 0) p_min = p_min->m_p_left; m_p_head->m_p_left = p_min; } { node_pointer p_max = m_p_head->m_p_parent; - while (p_max->m_p_right != NULL) + while (p_max->m_p_right != 0) p_max = p_max->m_p_right; m_p_head->m_p_right = p_max; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp index e3447bd4bec..e1013e78f1b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp @@ -49,7 +49,7 @@ assert_valid() const assert_consistent_with_debug_base(); assert_size(); assert_iterators(); - if (m_p_head->m_p_parent == NULL) + if (m_p_head->m_p_parent == 0) { _GLIBCXX_DEBUG_ASSERT(m_size == 0); } @@ -64,8 +64,8 @@ void PB_DS_CLASS_C_DEC:: structure_only_assert_valid() const { - _GLIBCXX_DEBUG_ASSERT(m_p_head != NULL); - if (m_p_head->m_p_parent == NULL) + _GLIBCXX_DEBUG_ASSERT(m_p_head != 0); + if (m_p_head->m_p_parent == 0) { _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head); _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head); @@ -77,7 +77,7 @@ structure_only_assert_valid() const _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right != m_p_head); } - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) assert_node_consistent(m_p_head->m_p_parent); assert_min(); assert_max(); @@ -96,8 +96,8 @@ typename PB_DS_CLASS_C_DEC::node_consistent_t PB_DS_CLASS_C_DEC:: assert_node_consistent_(const node_pointer p_nd) const { - if (p_nd == NULL) - return (std::make_pair((const_pointer)NULL,(const_pointer)NULL)); + if (p_nd == 0) + return (std::make_pair((const_pointer)0,(const_pointer)0)); assert_node_consistent_with_left(p_nd); assert_node_consistent_with_right(p_nd); @@ -105,18 +105,18 @@ assert_node_consistent_(const node_pointer p_nd) const const std::pair<const_pointer, const_pointer> l_range = assert_node_consistent_(p_nd->m_p_left); - if (l_range.second != NULL) + if (l_range.second != 0) _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(*l_range.second), PB_DS_V2F(p_nd->m_value))); const std::pair<const_pointer, const_pointer> r_range = assert_node_consistent_(p_nd->m_p_right); - if (r_range.first != NULL) + if (r_range.first != 0) _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), PB_DS_V2F(*r_range.first))); - return (std::make_pair((l_range.first != NULL)? l_range.first :& p_nd->m_value,(r_range.second != NULL)? r_range.second :& p_nd->m_value)); + return (std::make_pair((l_range.first != 0)? l_range.first :& p_nd->m_value,(r_range.second != 0)? r_range.second :& p_nd->m_value)); } PB_DS_CLASS_T_DEC @@ -124,7 +124,7 @@ void PB_DS_CLASS_C_DEC:: assert_node_consistent_with_left(const node_pointer p_nd) const { - if (p_nd->m_p_left == NULL) + if (p_nd->m_p_left == 0) return; _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left->m_p_parent == p_nd); _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), @@ -136,7 +136,7 @@ void PB_DS_CLASS_C_DEC:: assert_node_consistent_with_right(const node_pointer p_nd) const { - if (p_nd->m_p_right == NULL) + if (p_nd->m_p_right == 0) return; _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right->m_p_parent == p_nd); _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_p_right->m_value), @@ -156,13 +156,13 @@ void PB_DS_CLASS_C_DEC:: assert_min_imp(const node_pointer p_nd) const { - if (p_nd == NULL) + if (p_nd == 0) { _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_left == m_p_head); return; } - if (p_nd->m_p_left == NULL) + if (p_nd->m_p_left == 0) { _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_left); return; @@ -183,13 +183,13 @@ void PB_DS_CLASS_C_DEC:: assert_max_imp(const node_pointer p_nd) const { - if (p_nd == NULL) + if (p_nd == 0) { _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_right == m_p_head); return; } - if (p_nd->m_p_right == NULL) + if (p_nd->m_p_right == 0) { _GLIBCXX_DEBUG_ASSERT(p_nd == m_p_head->m_p_right); return; @@ -254,7 +254,7 @@ void PB_DS_CLASS_C_DEC:: assert_consistent_with_debug_base(const node_pointer p_nd) const { - if (p_nd == NULL) + if (p_nd == 0) return; debug_base::check_key_exists(PB_DS_V2F(p_nd->m_value)); assert_consistent_with_debug_base(p_nd->m_p_left); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp index a000c744cc3..a050a4be7b1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp @@ -106,7 +106,7 @@ void PB_DS_CLASS_C_DEC:: clear_imp(node_pointer p_nd) { - if (p_nd == NULL) + if (p_nd == 0) return; clear_imp(p_nd->m_p_left); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp index 413304b80a0..74af48a7327 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp @@ -46,7 +46,7 @@ lower_bound(const_key_reference r_key) const node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (Cmp_Fn::operator()( PB_DS_V2F(p_nd->m_value), r_key)) @@ -69,7 +69,7 @@ lower_bound(const_key_reference r_key) node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (Cmp_Fn::operator()( PB_DS_V2F(p_nd->m_value), r_key)) @@ -92,7 +92,7 @@ upper_bound(const_key_reference r_key) const node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value))) { @@ -114,7 +114,7 @@ upper_bound(const_key_reference r_key) node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value))) { @@ -138,7 +138,7 @@ find(const_key_reference r_key) node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key)) { p_pot = p_nd; @@ -164,7 +164,7 @@ find(const_key_reference r_key) const node_pointer p_pot = m_p_head; node_pointer p_nd = m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key)) { p_pot = p_nd; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp index 3abf0a08d3c..6714c6f10be 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp @@ -53,7 +53,7 @@ insert_leaf(const_reference r_value) node_pointer p_nd = m_p_head->m_p_parent; node_pointer p_pot = m_p_head; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()( PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value))) @@ -86,12 +86,12 @@ insert_leaf(const_reference r_value) PB_DS_V2F(r_value))); p_nd = p_pot->m_p_left; - if (p_nd == NULL) + if (p_nd == 0) return (std::make_pair( insert_leaf_new(r_value, p_pot, true), true)); - while (p_nd->m_p_right != NULL) + while (p_nd->m_p_right != 0) p_nd = p_nd->m_p_right; return (std::make_pair( @@ -109,7 +109,7 @@ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd) if (left_nd) { - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_left == 0); _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()( PB_DS_V2F(r_value), PB_DS_V2F(p_nd->m_value))); @@ -121,7 +121,7 @@ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd) } else { - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right == NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_right == 0); _GLIBCXX_DEBUG_ASSERT(Cmp_Fn::operator()( PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value))); @@ -134,7 +134,7 @@ insert_leaf_new(const_reference r_value, node_pointer p_nd, bool left_nd) p_new_nd->m_p_parent = p_nd; - p_new_nd->m_p_left = p_new_nd->m_p_right = NULL; + p_new_nd->m_p_left = p_new_nd->m_p_right = 0; _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_nd)); @@ -159,7 +159,7 @@ insert_imp_empty(const_reference r_value) p_new_node->m_p_parent = m_p_head; - p_new_node->m_p_left = p_new_node->m_p_right = NULL; + p_new_node->m_p_left = p_new_node->m_p_right = 0; _GLIBCXX_DEBUG_ONLY(debug_base::insert_new( PB_DS_V2F(r_value))); @@ -184,7 +184,7 @@ get_new_node_for_leaf_insert(const_reference r_val, false_type) cond.set_no_action(); - p_new_nd->m_p_left = p_new_nd->m_p_right = NULL; + p_new_nd->m_p_left = p_new_nd->m_p_right = 0; ++m_size; @@ -202,7 +202,7 @@ get_new_node_for_leaf_insert(const_reference r_val, true_type) static_cast<const void* >(&p_new_nd->m_value))) typename node::value_type(r_val); - p_new_nd->m_p_left = p_new_nd->m_p_right = NULL; + p_new_nd->m_p_left = p_new_nd->m_p_right = 0; ++m_size; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp index ed7f1b172c8..e20a4134a8b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp @@ -123,7 +123,7 @@ inline typename PB_DS_CLASS_C_DEC::const_node_iterator PB_DS_CLASS_C_DEC:: node_end() const { - return (const_node_iterator(NULL)); + return (const_node_iterator(0)); } PB_DS_CLASS_T_DEC @@ -131,6 +131,6 @@ inline typename PB_DS_CLASS_C_DEC::node_iterator PB_DS_CLASS_C_DEC:: node_end() { - return (node_iterator(NULL)); + return (node_iterator(0)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp index 365f02b6ef8..284c0e9bcc9 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp @@ -105,7 +105,7 @@ namespace __gnu_pbds */ inline - bin_search_tree_const_node_it_(const node_pointer p_nd = NULL) : m_p_nd(const_cast<node_pointer>(p_nd)) + bin_search_tree_const_node_it_(const node_pointer p_nd = 0) : m_p_nd(const_cast<node_pointer>(p_nd)) { } // Access. @@ -197,7 +197,7 @@ namespace __gnu_pbds */ inline - bin_search_tree_node_it_(const node_pointer p_nd = NULL) : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC( + bin_search_tree_node_it_(const node_pointer p_nd = 0) : PB_DS_TREE_CONST_NODE_ITERATOR_CLASS_C_DEC( const_cast<node_pointer>(p_nd)) { } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp index bb249e07057..5bf3f229f5d 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp @@ -124,7 +124,7 @@ namespace __gnu_pbds public: inline - bin_search_tree_const_it_(const Node_Pointer p_nd = NULL) + bin_search_tree_const_it_(const Node_Pointer p_nd = 0) : m_p_nd(const_cast<Node_Pointer>(p_nd)) { } @@ -152,14 +152,14 @@ namespace __gnu_pbds inline const_pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_nd != 0); return &m_p_nd->m_value; } inline const_reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_nd != 0); return m_p_nd->m_value; } @@ -182,7 +182,7 @@ namespace __gnu_pbds inline PB_DS_TREE_CONST_IT_C_DEC& operator++() { - _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_nd != 0); inc(integral_constant<int,Is_Forward_Iterator>()); return *this; } @@ -225,10 +225,10 @@ namespace __gnu_pbds return; } - if (m_p_nd->m_p_right != NULL) + if (m_p_nd->m_p_right != 0) { m_p_nd = m_p_nd->m_p_right; - while (m_p_nd->m_p_left != NULL) + while (m_p_nd->m_p_left != 0) m_p_nd = m_p_nd->m_p_left; return; } @@ -257,10 +257,10 @@ namespace __gnu_pbds return; } - if (m_p_nd->m_p_left != NULL) + if (m_p_nd->m_p_left != 0) { Node_Pointer p_y = m_p_nd->m_p_left; - while (p_y->m_p_right != NULL) + while (p_y->m_p_right != 0) p_y = p_y->m_p_right; m_p_nd = p_y; return; @@ -297,7 +297,7 @@ namespace __gnu_pbds public: inline - bin_search_tree_it_(const Node_Pointer p_nd = NULL) + bin_search_tree_it_(const Node_Pointer p_nd = 0) : PB_DS_TREE_CONST_IT_C_DEC((Node_Pointer)p_nd) { } @@ -325,14 +325,14 @@ namespace __gnu_pbds inline typename PB_DS_TREE_CONST_IT_C_DEC::pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != 0); return &base_it_type::m_p_nd->m_value; } inline typename PB_DS_TREE_CONST_IT_C_DEC::reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(base_it_type::m_p_nd != 0); return base_it_type::m_p_nd->m_value; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp index 667ef84704f..76c543f149a 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp @@ -106,7 +106,7 @@ void PB_DS_CLASS_C_DEC:: clear_imp(node_pointer p_nd) { - if (p_nd == NULL) + if (p_nd == 0) return; clear_imp(p_nd->m_p_left); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp index 0598657fe04..b21e98102df 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp @@ -47,7 +47,7 @@ rotate_left(node_pointer p_x) p_x->m_p_right = p_y->m_p_left; - if (p_y->m_p_left != NULL) + if (p_y->m_p_left != 0) p_y->m_p_left->m_p_parent = p_x; p_y->m_p_parent = p_x->m_p_parent; @@ -78,7 +78,7 @@ rotate_right(node_pointer p_x) p_x->m_p_left = p_y->m_p_right; - if (p_y->m_p_right != NULL) + if (p_y->m_p_right != 0) p_y->m_p_right->m_p_parent = p_x; p_y->m_p_parent = p_x->m_p_parent; @@ -131,7 +131,7 @@ apply_update(node_pointer p_nd, Node_Update_* /*p_update*/) { node_update::operator()( node_iterator(p_nd), - const_node_iterator(static_cast<node_pointer>(NULL))); + const_node_iterator(static_cast<node_pointer>(0))); } PB_DS_CLASS_T_DEC diff --git a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp index 9d2bd6d742d..2c027f6ab98 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp @@ -139,7 +139,7 @@ typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: recursive_count(node_pointer p) const { - if (p == NULL) + if (p == 0) return 0; return 1 + recursive_count(p->m_p_left) + recursive_count(p->m_p_right); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp index 9cb13f99cca..76cf80bd544 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_iterator.hpp @@ -125,7 +125,7 @@ namespace __gnu_pbds inline PB_DS_CLASS_C_DEC& operator++() { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_e != 0); inc(); return *this; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp index d4013db16fe..ab5efe2bb64 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp @@ -92,7 +92,7 @@ namespace __gnu_pbds // Default constructor. inline - binary_heap_const_point_iterator_() : m_p_e(NULL) { } + binary_heap_const_point_iterator_() : m_p_e(0) { } // Copy constructor. inline @@ -104,7 +104,7 @@ namespace __gnu_pbds inline const_pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_e != 0); return to_ptr(integral_constant<int, Simple>()); } @@ -112,7 +112,7 @@ namespace __gnu_pbds inline const_reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(m_p_e != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_e != 0); return *to_ptr(integral_constant<int, Simple>()); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp index 04b7d548f2e..dfceb689132 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp @@ -68,8 +68,8 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) const size_type other_actual_size = other.get_new_size_for_arbitrary(ersd); - entry_pointer a_entries = NULL; - entry_pointer a_other_entries = NULL; + entry_pointer a_entries = 0; + entry_pointer a_other_entries = 0; __try { @@ -79,10 +79,10 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) } __catch(...) { - if (a_entries != NULL) + if (a_entries != 0) s_entry_allocator.deallocate(a_entries, actual_size); - if (a_other_entries != NULL) + if (a_other_entries != 0) s_entry_allocator.deallocate(a_other_entries, other_actual_size); __throw_exception_again; @@ -128,8 +128,8 @@ join(PB_DS_CLASS_C_DEC& other) const size_type len = m_size + other.m_size; const size_type actual_size = resize_policy::get_new_size_for_arbitrary(len); - entry_pointer a_entries = NULL; - entry_pointer a_other_entries = NULL; + entry_pointer a_entries = 0; + entry_pointer a_other_entries = 0; __try { @@ -138,10 +138,10 @@ join(PB_DS_CLASS_C_DEC& other) } __catch(...) { - if (a_entries != NULL) + if (a_entries != 0) s_entry_allocator.deallocate(a_entries, actual_size); - if (a_other_entries != NULL) + if (a_other_entries != 0) s_entry_allocator.deallocate(a_other_entries, resize_policy::min_size); __throw_exception_again; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp index 274c93378fd..983df099dd7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp @@ -53,7 +53,7 @@ copy_from_range(It first_it, It last_it) PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: binomial_heap_base_() : - m_p_max(NULL) + m_p_max(0) { _GLIBCXX_DEBUG_ONLY(assert_valid(false);) } @@ -62,7 +62,7 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: binomial_heap_base_(const Cmp_Fn& r_cmp_fn) : PB_DS_BASE_C_DEC(r_cmp_fn), - m_p_max(NULL) + m_p_max(0) { _GLIBCXX_DEBUG_ONLY(assert_valid(false);) } @@ -71,7 +71,7 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: binomial_heap_base_(const PB_DS_CLASS_C_DEC& other) : PB_DS_BASE_C_DEC(other), - m_p_max(NULL) + m_p_max(0) { _GLIBCXX_DEBUG_ONLY(assert_valid(false);) } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp index 9a07f0e7d51..1ccee551402 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp @@ -55,9 +55,9 @@ void PB_DS_CLASS_C_DEC:: assert_max() const { - if (m_p_max == NULL) + if (m_p_max == 0) return; - _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == 0); for (const_iterator it = base_type::begin(); it != base_type::end(); ++it) _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value, it.m_p_nd->m_value)); @@ -71,14 +71,14 @@ assert_node_consistent(const_node_pointer p_nd, bool strictly_binomial, { _GLIBCXX_DEBUG_ASSERT(increasing || strictly_binomial); base_type::assert_node_consistent(p_nd, false); - if (p_nd == NULL) + if (p_nd == 0) return; _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == base_type::degree(p_nd)); _GLIBCXX_DEBUG_ASSERT(base_type::size_under_node(p_nd) == static_cast<size_type>(1 << p_nd->m_metadata)); assert_node_consistent(p_nd->m_p_next_sibling, strictly_binomial, increasing); assert_node_consistent(p_nd->m_p_l_child, true, false); - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) { if (increasing) { diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp index a4cf90c20f1..d6ead1e51c3 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp @@ -46,10 +46,10 @@ pop() _GLIBCXX_DEBUG_ONLY(assert_valid(true);) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); - if (m_p_max == NULL) + if (m_p_max == 0) find_max(); - _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_max != 0); node_pointer p_nd = m_p_max; @@ -57,7 +57,7 @@ pop() base_type::actual_erase_node(p_nd); - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) } @@ -67,33 +67,33 @@ void PB_DS_CLASS_C_DEC:: remove_parentless_node(node_pointer p_nd) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - _GLIBCXX_DEBUG_ASSERT(base_type::parent(p_nd) == NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + _GLIBCXX_DEBUG_ASSERT(base_type::parent(p_nd) == 0); node_pointer p_cur_root = p_nd == base_type::m_p_root? p_nd->m_p_next_sibling : base_type::m_p_root; - if (p_cur_root != NULL) - p_cur_root->m_p_prev_or_parent = NULL; + if (p_cur_root != 0) + p_cur_root->m_p_prev_or_parent = 0; - if (p_nd->m_p_prev_or_parent != NULL) + if (p_nd->m_p_prev_or_parent != 0) p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling; - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; node_pointer p_child = p_nd->m_p_l_child; - if (p_child != NULL) + if (p_child != 0) { - p_child->m_p_prev_or_parent = NULL; + p_child->m_p_prev_or_parent = 0; - while (p_child->m_p_next_sibling != NULL) + while (p_child->m_p_next_sibling != 0) p_child = p_child->m_p_next_sibling; } - m_p_max = NULL; + m_p_max = 0; base_type::m_p_root = join(p_cur_root, p_child); } @@ -105,7 +105,7 @@ clear() { base_type::clear(); - m_p_max = NULL; + m_p_max = 0; } PB_DS_CLASS_T_DEC @@ -122,7 +122,7 @@ erase(point_iterator it) base_type::actual_erase_node(it.m_p_nd); - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) } @@ -148,7 +148,7 @@ erase_if(Pred pred) size_type ersd = 0; - while (p_out != NULL) + while (p_out != 0) { ++ersd; @@ -161,19 +161,19 @@ erase_if(Pred pred) node_pointer p_cur = base_type::m_p_root; - base_type::m_p_root = NULL; + base_type::m_p_root = 0; - while (p_cur != NULL) + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; - p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL; + p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = 0; p_cur->m_metadata = 0; p_cur->m_p_next_sibling = base_type::m_p_root; - if (base_type::m_p_root != NULL) + if (base_type::m_p_root != 0) base_type::m_p_root->m_p_prev_or_parent = p_cur; base_type::m_p_root = p_cur; @@ -183,7 +183,7 @@ erase_if(Pred pred) p_cur = p_next; } - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp index ad7f65129ba..3c8ff109def 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp @@ -46,10 +46,10 @@ top() const _GLIBCXX_DEBUG_ONLY(assert_valid(false);) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); - if (m_p_max == NULL) + if (m_p_max == 0) const_cast<PB_DS_CLASS_C_DEC* >(this)->find_max(); - _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_max != 0); return m_p_max->m_value; } @@ -62,7 +62,7 @@ find_max() m_p_max = p_cur; - while (p_cur != NULL) + while (p_cur != 0) { if (Cmp_Fn::operator()(m_p_max->m_value, p_cur->m_value)) m_p_max = p_cur; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp index e67d0df148f..735bddbb71a 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp @@ -49,7 +49,7 @@ push(const_reference r_val) insert_node(p_nd); - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) @@ -61,10 +61,10 @@ inline void PB_DS_CLASS_C_DEC:: insert_node(node_pointer p_nd) { - if (base_type::m_p_root == NULL) + if (base_type::m_p_root == 0) { p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = - p_nd->m_p_l_child = NULL; + p_nd->m_p_l_child = 0; p_nd->m_metadata = 0; @@ -75,7 +75,7 @@ insert_node(node_pointer p_nd) if (base_type::m_p_root->m_metadata > 0) { - p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL; + p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = 0; p_nd->m_p_next_sibling = base_type::m_p_root; @@ -92,7 +92,7 @@ insert_node(node_pointer p_nd) { p_nd->m_p_next_sibling = base_type::m_p_root->m_p_next_sibling; - p_nd->m_p_prev_or_parent = NULL; + p_nd->m_p_prev_or_parent = 0; p_nd->m_metadata = 1; @@ -100,15 +100,15 @@ insert_node(node_pointer p_nd) base_type::m_p_root->m_p_prev_or_parent = p_nd; - base_type::m_p_root->m_p_next_sibling = NULL; + base_type::m_p_root->m_p_next_sibling = 0; base_type::m_p_root = p_nd; } else { - p_nd->m_p_next_sibling = NULL; + p_nd->m_p_next_sibling = 0; - p_nd->m_p_l_child = NULL; + p_nd->m_p_l_child = 0; p_nd->m_p_prev_or_parent = base_type::m_p_root; @@ -128,7 +128,7 @@ inline typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: fix(node_pointer p_nd) const { - while (p_nd->m_p_next_sibling != NULL&& + while (p_nd->m_p_next_sibling != 0&& p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata) { node_pointer p_next = p_nd->m_p_next_sibling; @@ -138,7 +138,7 @@ fix(node_pointer p_nd) const p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; - if (p_nd->m_p_prev_or_parent != NULL) + if (p_nd->m_p_prev_or_parent != 0) p_nd->m_p_prev_or_parent->m_p_next_sibling = p_next; base_type::make_child_of(p_nd, p_next); @@ -151,8 +151,8 @@ fix(node_pointer p_nd) const { p_nd->m_p_next_sibling = p_next->m_p_next_sibling; - if (p_nd->m_p_next_sibling != NULL) - p_next->m_p_next_sibling = NULL; + if (p_nd->m_p_next_sibling != 0) + p_next->m_p_next_sibling = 0; base_type::make_child_of(p_next, p_nd); @@ -160,7 +160,7 @@ fix(node_pointer p_nd) const } } - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd; return p_nd; @@ -174,7 +174,7 @@ modify(point_iterator it, const_reference r_new_val) _GLIBCXX_DEBUG_ONLY(assert_valid(true);) node_pointer p_nd = it.m_p_nd; - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false);) const bool bubble_up = Cmp_Fn::operator()(p_nd->m_value, r_new_val); @@ -185,7 +185,7 @@ modify(point_iterator it, const_reference r_new_val) { node_pointer p_parent = base_type::parent(p_nd); - while (p_parent != NULL&& + while (p_parent != 0&& Cmp_Fn::operator()(p_parent->m_value, p_nd->m_value)) { base_type::swap_with_parent(p_nd, p_parent); @@ -193,10 +193,10 @@ modify(point_iterator it, const_reference r_new_val) p_parent = base_type::parent(p_nd); } - if (p_nd->m_p_prev_or_parent == NULL) + if (p_nd->m_p_prev_or_parent == 0) base_type::m_p_root = p_nd; - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) @@ -209,7 +209,7 @@ modify(point_iterator it, const_reference r_new_val) insert_node(p_nd); - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp index a701937cb99..2a96236fb9e 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp @@ -61,7 +61,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_out = base_type::prune(pred); - while (p_out != NULL) + while (p_out != 0) { _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0); --base_type::m_size; @@ -70,13 +70,13 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_next = p_out->m_p_next_sibling; - p_out->m_p_l_child = p_out->m_p_prev_or_parent = NULL; + p_out->m_p_l_child = p_out->m_p_prev_or_parent = 0; p_out->m_metadata = 0; p_out->m_p_next_sibling = other.m_p_root; - if (other.m_p_root != NULL) + if (other.m_p_root != 0) other.m_p_root->m_p_prev_or_parent = p_out; other.m_p_root = p_out; @@ -90,19 +90,19 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_cur = base_type::m_p_root; - base_type::m_p_root = NULL; + base_type::m_p_root = 0; - while (p_cur != NULL) + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; - p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = NULL; + p_cur->m_p_l_child = p_cur->m_p_prev_or_parent = 0; p_cur->m_metadata = 0; p_cur->m_p_next_sibling = base_type::m_p_root; - if (base_type::m_p_root != NULL) + if (base_type::m_p_root != 0) base_type::m_p_root->m_p_prev_or_parent = p_cur; base_type::m_p_root = p_cur; @@ -112,7 +112,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) p_cur = p_next; } - m_p_max = NULL; + m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);) @@ -128,7 +128,7 @@ join(PB_DS_CLASS_C_DEC& other) node_pointer p_other = other.m_p_root; - if (p_other != NULL) + if (p_other != 0) do { node_pointer p_next = p_other->m_p_next_sibling; @@ -137,15 +137,15 @@ join(PB_DS_CLASS_C_DEC& other) p_other = p_next; } - while (p_other != NULL); + while (p_other != 0); base_type::m_p_root = join(base_type::m_p_root, other.m_p_root); base_type::m_size += other.m_size; - m_p_max = NULL; + m_p_max = 0; - other.m_p_root = NULL; + other.m_p_root = 0; other.m_size = 0; - other.m_p_max = NULL; + other.m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid(true);) _GLIBCXX_DEBUG_ONLY(other.assert_valid(true);) @@ -156,15 +156,15 @@ inline typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: join(node_pointer p_lhs, node_pointer p_rhs) const { - node_pointer p_ret = NULL; + node_pointer p_ret = 0; - node_pointer p_cur = NULL; + node_pointer p_cur = 0; - while (p_lhs != NULL || p_rhs != NULL) + while (p_lhs != 0 || p_rhs != 0) { - if (p_rhs == NULL) + if (p_rhs == 0) { - if (p_cur == NULL) + if (p_cur == 0) p_ret = p_cur = p_lhs; else { @@ -173,11 +173,11 @@ join(node_pointer p_lhs, node_pointer p_rhs) const p_lhs->m_p_prev_or_parent = p_cur; } - p_cur = p_lhs = NULL; + p_cur = p_lhs = 0; } - else if (p_lhs == NULL || p_rhs->m_metadata < p_lhs->m_metadata) + else if (p_lhs == 0 || p_rhs->m_metadata < p_lhs->m_metadata) { - if (p_cur == NULL) + if (p_cur == 0) { p_ret = p_cur = p_rhs; @@ -196,7 +196,7 @@ join(node_pointer p_lhs, node_pointer p_rhs) const } else if (p_lhs->m_metadata < p_rhs->m_metadata) { - if (p_cur == NULL) + if (p_cur == 0) p_ret = p_cur = p_lhs; else { @@ -221,11 +221,11 @@ join(node_pointer p_lhs, node_pointer p_rhs) const } } - if (p_cur != NULL) - p_cur->m_p_next_sibling = NULL; + if (p_cur != 0) + p_cur->m_p_next_sibling = 0; - if (p_ret != NULL) - p_ret->m_p_prev_or_parent = NULL; + if (p_ret != 0) + p_ret->m_p_prev_or_parent = 0; return p_ret; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp index f5efabe0840..2bace9c5ebd 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp @@ -374,7 +374,7 @@ namespace __gnu_pbds entry_pointer p_e = m_entries[pos]; resize_base::notify_insert_search_start(); - while (p_e != NULL + while (p_e != 0 && !hash_eq_fn_base::operator()(p_e->m_value.first, r_key)) { resize_base::notify_insert_search_collision(); @@ -382,7 +382,7 @@ namespace __gnu_pbds } resize_base::notify_insert_search_end(); - if (p_e != NULL) + if (p_e != 0) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);) return (p_e->m_value.second); @@ -399,7 +399,7 @@ namespace __gnu_pbds comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key); entry_pointer p_e = m_entries[pos_hash_pair.first]; resize_base::notify_insert_search_start(); - while (p_e != NULL && + while (p_e != 0 && !hash_eq_fn_base::operator()(p_e->m_value.first, p_e->m_hash, r_key, pos_hash_pair.second)) { resize_base::notify_insert_search_collision(); @@ -407,7 +407,7 @@ namespace __gnu_pbds } resize_base::notify_insert_search_end(); - if (p_e != NULL) + if (p_e != 0) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);) return p_e->m_value.second; @@ -468,7 +468,7 @@ namespace __gnu_pbds { entry_pointer p_e = m_entries[ranged_hash_fn_base::operator()(r_key)]; resize_base::notify_find_search_start(); - while (p_e != NULL && + while (p_e != 0 && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key)) { resize_base::notify_find_search_collision(); @@ -478,7 +478,7 @@ namespace __gnu_pbds resize_base::notify_find_search_end(); #ifdef _GLIBCXX_DEBUG - if (p_e == NULL) + if (p_e == 0) debug_base::check_key_does_not_exist(r_key); else debug_base::check_key_exists(r_key); @@ -492,7 +492,7 @@ namespace __gnu_pbds comp_hash pos_hash_pair = ranged_hash_fn_base::operator()(r_key); entry_pointer p_e = m_entries[pos_hash_pair.first]; resize_base::notify_find_search_start(); - while (p_e != NULL && + while (p_e != 0 && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash, r_key, pos_hash_pair.second)) @@ -504,7 +504,7 @@ namespace __gnu_pbds resize_base::notify_find_search_end(); #ifdef _GLIBCXX_DEBUG - if (p_e == NULL) + if (p_e == 0) debug_base::check_key_does_not_exist(r_key); else debug_base::check_key_exists(r_key); @@ -534,22 +534,22 @@ namespace __gnu_pbds inc_it_state(const_pointer& r_p_value, std::pair<entry_pointer, size_type>& r_pos) const { - _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(r_p_value != 0); r_pos.first = r_pos.first->m_p_next; - if (r_pos.first != NULL) + if (r_pos.first != 0) { r_p_value = &r_pos.first->m_value; return; } for (++r_pos.second; r_pos.second < m_num_e; ++r_pos.second) - if (m_entries[r_pos.second] != NULL) + if (m_entries[r_pos.second] != 0) { r_pos.first = m_entries[r_pos.second]; r_p_value = &r_pos.first->m_value; return; } - r_p_value = NULL; + r_p_value = 0; } void @@ -557,13 +557,13 @@ namespace __gnu_pbds std::pair<entry_pointer, size_type>& r_pos) const { for (r_pos.second = 0; r_pos.second < m_num_e; ++r_pos.second) - if (m_entries[r_pos.second] != NULL) + if (m_entries[r_pos.second] != 0) { r_pos.first = m_entries[r_pos.second]; r_p_value = &r_pos.first->m_value; return; } - r_p_value = NULL; + r_p_value = 0; } #ifdef _GLIBCXX_DEBUG diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp index 1a61893d105..c5268447232 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp @@ -64,7 +64,7 @@ cmp_with_other(const Other_Map_Type& other) const const_cast<PB_DS_CLASS_C_DEC& >(*this). find_key_pointer(r_key, traits_base::m_store_extra_indicator); - if (p_mapped_value == NULL) + if (p_mapped_value == 0) return false; #ifdef PB_DS_DATA_TRUE_INDICATOR diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp index 24294ad9135..f67254169b7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp @@ -87,7 +87,7 @@ PB_DS_CLASS_NAME(const Hash_Fn& r_hash_fn, const Eq_Fn& r_eq_fn) : m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0), m_entries(s_entry_pointer_allocator.allocate(m_num_e)) { - std::fill(m_entries, m_entries + m_num_e, (entry_pointer)NULL); + std::fill(m_entries, m_entries + m_num_e, (entry_pointer)0); Resize_Policy::notify_cleared(); ranged_hash_fn_base::notify_resized(m_num_e); _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) @@ -184,7 +184,7 @@ void PB_DS_CLASS_C_DEC:: initialize() { - std::fill(m_entries, m_entries + m_num_e, entry_pointer(NULL)); + std::fill(m_entries, m_entries + m_num_e, entry_pointer(0)); Resize_Policy::notify_resized(m_num_e); Resize_Policy::notify_cleared(); ranged_hash_fn_base::notify_resized(m_num_e); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp index 4219eef3885..81d68e3311e 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp @@ -58,7 +58,7 @@ assert_entry_pointer_array_valid(const entry_pointer_array a_p_entries) const for (size_type pos = 0; pos < m_num_e; ++pos) { entry_pointer p_e = a_p_entries[pos]; - while (p_e != NULL) + while (p_e != 0) { ++iterated_num_used_e; assert_entry_pointer_valid(p_e, traits_base::m_store_extra_indicator); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp index fa09f734843..912535f9390 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp @@ -43,7 +43,7 @@ void PB_DS_CLASS_C_DEC:: deallocate_links_in_list(entry_pointer p_e) { - while (p_e != NULL) + while (p_e != 0) { entry_pointer p_dealloc_e = p_e; p_e = p_e->m_p_next; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp index 9f9178bc911..e1260c0d9bd 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp @@ -61,7 +61,7 @@ erase_if(Pred pred) size_type num_ersd = 0; for (size_type pos = 0; pos < m_num_e; ++pos) { - while (m_entries[pos] != NULL && pred(m_entries[pos]->m_value)) + while (m_entries[pos] != 0 && pred(m_entries[pos]->m_value)) { ++num_ersd; entry_pointer p_next_e = m_entries[pos]->m_p_next; @@ -70,7 +70,7 @@ erase_if(Pred pred) } entry_pointer p_e = m_entries[pos]; - while (p_e != NULL && p_e->m_p_next != NULL) + while (p_e != 0 && p_e->m_p_next != 0) { if (pred(p_e->m_p_next->m_value)) { @@ -92,7 +92,7 @@ PB_DS_CLASS_C_DEC:: clear() { for (size_type pos = 0; pos < m_num_e; ++pos) - while (m_entries[pos] != NULL) + while (m_entries[pos] != 0) erase_entry_pointer(m_entries[pos]); do_resize_if_needed_no_throw(); resize_base::notify_cleared(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp index d24fc31f9dc..1f8fa06bda3 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp @@ -56,7 +56,7 @@ erase_in_pos_imp(const_key_reference r_key, size_type pos) _GLIBCXX_DEBUG_ONLY(assert_valid();) entry_pointer p_e = m_entries[pos]; resize_base::notify_erase_search_start(); - if (p_e == NULL) + if (p_e == 0) { resize_base::notify_erase_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) @@ -77,7 +77,7 @@ erase_in_pos_imp(const_key_reference r_key, size_type pos) while (true) { entry_pointer p_next_e = p_e->m_p_next; - if (p_next_e == NULL) + if (p_next_e == 0) { resize_base::notify_erase_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp index d72df696221..01192b4cefd 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp @@ -47,7 +47,7 @@ erase_in_pos_imp(const_key_reference r_key, const comp_hash& r_pos_hash_pair) _GLIBCXX_DEBUG_ONLY(assert_valid();) entry_pointer p_e = m_entries[r_pos_hash_pair.first]; resize_base::notify_erase_search_start(); - if (p_e == NULL) + if (p_e == 0) { resize_base::notify_erase_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base:: check_key_does_not_exist(r_key);) @@ -69,7 +69,7 @@ erase_in_pos_imp(const_key_reference r_key, const comp_hash& r_pos_hash_pair) while (true) { entry_pointer p_next_e = p_e->m_p_next; - if (p_next_e == NULL) + if (p_next_e == 0) { resize_base::notify_erase_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp index 6ca9a03b4fa..03db9f84f28 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp @@ -61,11 +61,11 @@ PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::point_iterator PB_DS_CLASS_C_DEC:: find_end() -{ return NULL; } +{ return 0; } PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::const_point_iterator PB_DS_CLASS_C_DEC:: find_end() const -{ return NULL; } +{ return 0; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp index dc1519df7b3..5722c775def 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp @@ -81,7 +81,7 @@ cmp_with_other(const Other_Map_Type& other) const const_cast<PB_DS_CLASS_C_DEC& >(*this). find_key_pointer(r_key, traits_base::m_store_extra_indicator); - if (p_mapped_value == NULL) + if (p_mapped_value == 0) return false; #ifdef PB_DS_DATA_TRUE_INDICATOR diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp index 7215ccd86bc..3d23eab5c35 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp @@ -50,7 +50,7 @@ insert_imp(const_reference r_val, false_type) entry_pointer p_e = m_entries[pos]; resize_base::notify_insert_search_start(); - while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), + while (p_e != 0 && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), r_key)) { resize_base::notify_insert_search_collision(); @@ -58,7 +58,7 @@ insert_imp(const_reference r_val, false_type) } resize_base::notify_insert_search_end(); - if (p_e != NULL) + if (p_e != 0) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(r_key);) return std::make_pair(&p_e->m_value, false); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp index fbc284f80b9..b35570690af 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp @@ -50,7 +50,7 @@ insert_imp(const_reference r_val, true_type) entry_pointer p_e = m_entries[pos_hash_pair.first]; resize_base::notify_insert_search_start(); - while (p_e != NULL && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), + while (p_e != 0 && !hash_eq_fn_base::operator()(PB_DS_V2F(p_e->m_value), p_e->m_hash, key, pos_hash_pair.second)) { @@ -59,7 +59,7 @@ insert_imp(const_reference r_val, true_type) } resize_base::notify_insert_search_end(); - if (p_e != NULL) + if (p_e != 0) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(key);) return std::make_pair(&p_e->m_value, false); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp index 66333ec85c2..11e2583bc47 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp @@ -112,12 +112,12 @@ PB_DS_CLASS_C_DEC:: resize_imp_no_exceptions(size_type new_size, entry_pointer_array a_p_entries_resized, size_type old_size) { std::fill(a_p_entries_resized, a_p_entries_resized + m_num_e, - entry_pointer(NULL)); + entry_pointer(0)); for (size_type pos = 0; pos < old_size; ++pos) { entry_pointer p_e = m_entries[pos]; - while (p_e != NULL) + while (p_e != 0) p_e = resize_imp_no_exceptions_reassign_pointer(p_e, a_p_entries_resized, traits_base::m_store_extra_indicator); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp index 6fa5676b9df..77735aeafdd 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp @@ -62,7 +62,7 @@ PB_DS_CLASS_C_DEC:: trace_list(const_entry_pointer p_l) const { size_type iterated_num_used_e = 0; - while (p_l != NULL) + while (p_l != 0) { std::cerr << PB_DS_V2F(p_l->m_value) << " "; p_l = p_l->m_p_next; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp index 69d53763ad5..d39735c5632 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp @@ -60,11 +60,11 @@ PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::point_iterator PB_DS_CLASS_C_DEC:: find_end() -{ return NULL; } +{ return 0; } PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::const_point_iterator PB_DS_CLASS_C_DEC:: find_end() const -{ return NULL; } +{ return 0; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp index 4741afec090..5b2df85a8c2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp @@ -490,7 +490,7 @@ namespace __gnu_pbds resize_base::notify_find_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);) - return NULL; + return 0; } break; case valid_entry_status: @@ -513,7 +513,7 @@ namespace __gnu_pbds _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);) resize_base::notify_find_search_end(); - return NULL; + return 0; } inline pointer @@ -538,7 +538,7 @@ namespace __gnu_pbds resize_base::notify_find_search_end(); _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);) - return NULL; + return 0; } break; case valid_entry_status: @@ -562,7 +562,7 @@ namespace __gnu_pbds _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(key);) resize_base::notify_find_search_end(); - return NULL; + return 0; } inline bool @@ -583,7 +583,7 @@ namespace __gnu_pbds void inc_it_state(const_pointer& r_p_value, size_type& r_pos) const { - _GLIBCXX_DEBUG_ASSERT(r_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(r_p_value != 0); for (++r_pos; r_pos < m_num_e; ++r_pos) { const_entry_pointer p_e =& m_entries[r_pos]; @@ -593,7 +593,7 @@ namespace __gnu_pbds return; } } - r_p_value = NULL; + r_p_value = 0; } void @@ -608,7 +608,7 @@ namespace __gnu_pbds return; } } - r_p_value = NULL; + r_p_value = 0; } void @@ -623,7 +623,7 @@ namespace __gnu_pbds return; } } - r_p_value = NULL; + r_p_value = 0; } #ifdef _GLIBCXX_DEBUG diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp index 0492a47928b..115a8bf0dda 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp @@ -87,7 +87,7 @@ resize_imp(size_type new_size) _GLIBCXX_DEBUG_ONLY(assert_valid();) const size_type old_size = m_num_e; - entry_array a_entries_resized = NULL; + entry_array a_entries_resized = 0; // Following line might throw an exception. a_entries_resized = s_entry_allocator.allocate(new_size); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp index 479725fd51b..dac063927f6 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -60,7 +60,7 @@ namespace __gnu_pbds typedef typename __conditional_type< is_same< - __gnu_pbds::direct_mask_range_hashing<size_t>, + __gnu_pbds::direct_mask_range_hashing<std::size_t>, Comb_Probe_Fn>::value, __gnu_pbds::linear_probe_fn<size_type>, __gnu_pbds::quadratic_probe_fn<size_type> >::__type diff --git a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp index dad6451d06f..7dcd82588c1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -48,7 +48,7 @@ class sample_probe_fn public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; public: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp index 0912e7f27e8..988f111ea20 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -48,7 +48,7 @@ class sample_range_hashing public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; public: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp index 6120231e2e2..8fa04d140e5 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -48,7 +48,7 @@ class sample_ranged_hash_fn public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; public: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp index 915f108df83..2bcfdf51a54 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -48,7 +48,7 @@ class sample_ranged_probe_fn public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; public: @@ -70,7 +70,7 @@ protected: // Transforms the const key reference r_key into the i-th position within the table. This method is called for each collision within the probe sequence. inline size_type - operator()(const_key_reference r_key, size_t hash, size_type i) const; + operator()(const_key_reference r_key, std::size_t hash, size_type i) const; }; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp index 5955df16164..4c085d4c69d 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp @@ -118,7 +118,7 @@ namespace __gnu_pbds inline PB_DS_CLASS_C_DEC& operator++() { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_nd != 0); inc(); return (*this); } @@ -135,10 +135,10 @@ namespace __gnu_pbds void inc() { - if (base_type::m_p_nd->m_p_next_sibling != NULL) + if (base_type::m_p_nd->m_p_next_sibling != 0) { base_type::m_p_nd = base_type::m_p_nd->m_p_next_sibling; - while (base_type::m_p_nd->m_p_l_child != NULL) + while (base_type::m_p_nd->m_p_l_child != 0) base_type::m_p_nd = base_type::m_p_nd->m_p_l_child; return; } @@ -147,7 +147,7 @@ namespace __gnu_pbds { node_pointer p_next = base_type::m_p_nd; base_type::m_p_nd = base_type::m_p_nd->m_p_prev_or_parent; - if (base_type::m_p_nd == NULL || base_type::m_p_nd->m_p_l_child == p_next) + if (base_type::m_p_nd == 0 || base_type::m_p_nd->m_p_l_child == p_next) return; } } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp index 7d682526b4c..8eb1574446b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp @@ -107,7 +107,7 @@ namespace __gnu_pbds // Default constructor. inline - left_child_next_sibling_heap_node_const_point_iterator_() : m_p_nd(NULL) + left_child_next_sibling_heap_node_const_point_iterator_() : m_p_nd(0) { } // Copy constructor. @@ -119,7 +119,7 @@ namespace __gnu_pbds inline const_pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_nd != 0); return &m_p_nd->m_value; } @@ -127,7 +127,7 @@ namespace __gnu_pbds inline const_reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(m_p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_nd != 0); return m_p_nd->m_value; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp index ea0572527c2..536ac66ea4b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp @@ -49,7 +49,7 @@ PB_DS_CLASS_C_DEC::s_no_throw_copies_ind; PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: left_child_next_sibling_heap_() : - m_p_root(NULL), + m_p_root(0), m_size(0) { _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -59,7 +59,7 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn) : Cmp_Fn(r_cmp_fn), - m_p_root(NULL), + m_p_root(0), m_size(0) { _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -68,7 +68,7 @@ left_child_next_sibling_heap_(const Cmp_Fn& r_cmp_fn) : PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: left_child_next_sibling_heap_(const PB_DS_CLASS_C_DEC& other) -: Cmp_Fn(other), m_p_root(NULL), m_size(0) +: Cmp_Fn(other), m_p_root(0), m_size(0) { m_size = other.m_size; _GLIBCXX_DEBUG_ONLY(other.assert_valid();) @@ -111,8 +111,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: recursive_copy_node(const_node_pointer p_nd) { - if (p_nd == NULL) - return (NULL); + if (p_nd == 0) + return (0); node_pointer p_ret = s_node_allocator.allocate(1); @@ -127,7 +127,7 @@ recursive_copy_node(const_node_pointer p_nd) } p_ret->m_p_l_child = p_ret->m_p_next_sibling = - p_ret->m_p_prev_or_parent = NULL; + p_ret->m_p_prev_or_parent = 0; __try { @@ -140,12 +140,12 @@ recursive_copy_node(const_node_pointer p_nd) __throw_exception_again; } - if (p_ret->m_p_l_child != NULL) + if (p_ret->m_p_l_child != 0) p_ret->m_p_l_child->m_p_prev_or_parent = p_ret; - if (p_ret->m_p_next_sibling != NULL) + if (p_ret->m_p_next_sibling != 0) p_ret->m_p_next_sibling->m_p_prev_or_parent = - p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd ? p_ret : NULL; + p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd ? p_ret : 0; return p_ret; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp index 86871ac3817..16b8217bd61 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp @@ -45,9 +45,9 @@ void PB_DS_CLASS_C_DEC:: assert_valid() const { - _GLIBCXX_DEBUG_ASSERT(m_p_root == NULL || m_p_root->m_p_prev_or_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_root == 0 || m_p_root->m_p_prev_or_parent == 0); - if (m_p_root != NULL) + if (m_p_root != 0) assert_node_consistent(m_p_root, Single_Link_Roots); assert_size(); assert_iterators(); @@ -58,22 +58,22 @@ void PB_DS_CLASS_C_DEC:: assert_node_consistent(const_node_pointer p_nd, bool single_link) const { - if (p_nd == NULL) + if (p_nd == 0) return; assert_node_consistent(p_nd->m_p_l_child, false); assert_node_consistent(p_nd->m_p_next_sibling, single_link); if (single_link) - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent == NULL); - else if (p_nd->m_p_next_sibling != NULL) + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent == 0); + else if (p_nd->m_p_next_sibling != 0) _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling->m_p_prev_or_parent == p_nd); - if (p_nd->m_p_l_child == NULL) + if (p_nd->m_p_l_child == 0) return; const_node_pointer p_child = p_nd->m_p_l_child; - while (p_child != NULL) + while (p_child != 0) { const_node_pointer p_next_child = p_child->m_p_next_sibling; _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(p_nd->m_value, p_child->m_value)); @@ -115,7 +115,7 @@ PB_DS_CLASS_C_DEC:: size_from_node(const_node_pointer p_nd) { size_type ret = 0; - while (p_nd != NULL) + while (p_nd != 0) { ret += 1 + size_from_node(p_nd->m_p_l_child); p_nd = p_nd->m_p_next_sibling; @@ -130,7 +130,7 @@ degree(const_node_pointer p_nd) { size_type ret = 0; const_node_pointer p_child = p_nd->m_p_l_child; - while (p_child != NULL) + while (p_child != 0) { ++ret; p_child = p_child->m_p_next_sibling; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp index 9fa09f49bbb..605457fd4cb 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp @@ -45,7 +45,7 @@ clear() { clear_imp(m_p_root); _GLIBCXX_DEBUG_ASSERT(m_size == 0); - m_p_root = NULL; + m_p_root = 0; } PB_DS_CLASS_T_DEC @@ -64,7 +64,7 @@ void PB_DS_CLASS_C_DEC:: clear_imp(node_pointer p_nd) { - while (p_nd != NULL) + while (p_nd != 0) { clear_imp(p_nd->m_p_l_child); node_pointer p_next = p_nd->m_p_next_sibling; @@ -80,8 +80,8 @@ to_linked_list() { _GLIBCXX_DEBUG_ONLY(assert_valid();) node_pointer p_cur = m_p_root; - while (p_cur != NULL) - if (p_cur->m_p_l_child != NULL) + while (p_cur != 0) + if (p_cur->m_p_l_child != 0) { node_pointer p_child_next = p_cur->m_p_l_child->m_p_next_sibling; p_cur->m_p_l_child->m_p_next_sibling = p_cur->m_p_next_sibling; @@ -94,10 +94,10 @@ to_linked_list() #ifdef _GLIBCXX_DEBUG const_node_pointer p_counter = m_p_root; size_type count = 0; - while (p_counter != NULL) + while (p_counter != 0) { ++count; - _GLIBCXX_DEBUG_ASSERT(p_counter->m_p_l_child == NULL); + _GLIBCXX_DEBUG_ASSERT(p_counter->m_p_l_child == 0); p_counter = p_counter->m_p_next_sibling; } _GLIBCXX_DEBUG_ASSERT(count == m_size); @@ -111,22 +111,22 @@ PB_DS_CLASS_C_DEC:: prune(Pred pred) { node_pointer p_cur = m_p_root; - m_p_root = NULL; - node_pointer p_out = NULL; - while (p_cur != NULL) + m_p_root = 0; + node_pointer p_out = 0; + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; if (pred(p_cur->m_value)) { p_cur->m_p_next_sibling = p_out; - if (p_out != NULL) + if (p_out != 0) p_out->m_p_prev_or_parent = p_cur; p_out = p_cur; } else { p_cur->m_p_next_sibling = m_p_root; - if (m_p_root != NULL) + if (m_p_root != 0) m_p_root->m_p_prev_or_parent = p_cur; m_p_root = p_cur; } @@ -141,7 +141,7 @@ PB_DS_CLASS_C_DEC:: bubble_to_top(node_pointer p_nd) { node_pointer p_parent = parent(p_nd); - while (p_parent != NULL) + while (p_parent != 0) { swap_with_parent(p_nd, p_parent); p_parent = parent(p_nd); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp index 926ccd39c22..478abe018b0 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp @@ -87,12 +87,12 @@ inline void PB_DS_CLASS_C_DEC:: make_child_of(node_pointer p_nd, node_pointer p_new_parent) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - _GLIBCXX_DEBUG_ASSERT(p_new_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + _GLIBCXX_DEBUG_ASSERT(p_new_parent != 0); p_nd->m_p_next_sibling = p_new_parent->m_p_l_child; - if (p_new_parent->m_p_l_child != NULL) + if (p_new_parent->m_p_l_child != 0) p_new_parent->m_p_l_child->m_p_prev_or_parent = p_nd; p_nd->m_p_prev_or_parent = p_new_parent; @@ -109,7 +109,7 @@ parent(node_pointer p_nd) { node_pointer p_pot = p_nd->m_p_prev_or_parent; - if (p_pot == NULL || p_pot->m_p_l_child == p_nd) + if (p_pot == 0 || p_pot->m_p_l_child == p_nd) return p_pot; p_nd = p_pot; @@ -124,12 +124,12 @@ swap_with_parent(node_pointer p_nd, node_pointer p_parent) if (p_parent == m_p_root) m_p_root = p_nd; - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - _GLIBCXX_DEBUG_ASSERT(p_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + _GLIBCXX_DEBUG_ASSERT(p_parent != 0); _GLIBCXX_DEBUG_ASSERT(parent(p_nd) == p_parent); const bool nd_direct_child = p_parent->m_p_l_child == p_nd; - const bool parent_root = p_parent->m_p_prev_or_parent == NULL; + const bool parent_root = p_parent->m_p_prev_or_parent == 0; const bool parent_direct_child = !parent_root&& p_parent->m_p_prev_or_parent->m_p_l_child == p_parent; @@ -138,16 +138,16 @@ swap_with_parent(node_pointer p_nd, node_pointer p_parent) std::swap(p_parent->m_p_l_child, p_nd->m_p_l_child); std::swap(p_parent->m_metadata, p_nd->m_metadata); - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child != NULL); - _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child != 0); + _GLIBCXX_DEBUG_ASSERT(p_parent->m_p_prev_or_parent != 0); - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd; - if (p_parent->m_p_next_sibling != NULL) + if (p_parent->m_p_next_sibling != 0) p_parent->m_p_next_sibling->m_p_prev_or_parent = p_parent; - if (p_parent->m_p_l_child != NULL) + if (p_parent->m_p_l_child != 0) p_parent->m_p_l_child->m_p_prev_or_parent = p_parent; if (parent_direct_child) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp index dca70fdd509..b6587e229f2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp @@ -45,10 +45,10 @@ begin() { node_pointer p_nd = m_p_root; - if (p_nd == NULL) - return (iterator(NULL)); + if (p_nd == 0) + return (iterator(0)); - while (p_nd->m_p_l_child != NULL) + while (p_nd->m_p_l_child != 0) p_nd = p_nd->m_p_l_child; return (iterator(p_nd)); @@ -61,10 +61,10 @@ begin() const { node_pointer p_nd = m_p_root; - if (p_nd == NULL) - return (const_iterator(NULL)); + if (p_nd == 0) + return (const_iterator(0)); - while (p_nd->m_p_l_child != NULL) + while (p_nd->m_p_l_child != 0) p_nd = p_nd->m_p_l_child; return (const_iterator(p_nd)); @@ -75,7 +75,7 @@ inline typename PB_DS_CLASS_C_DEC::iterator PB_DS_CLASS_C_DEC:: end() { - return (iterator(NULL)); + return (iterator(0)); } PB_DS_CLASS_T_DEC @@ -83,6 +83,6 @@ inline typename PB_DS_CLASS_C_DEC::const_iterator PB_DS_CLASS_C_DEC:: end() const { - return (const_iterator(NULL)); + return (const_iterator(0)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp index 040466e8e84..7ba4bf6ee8b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp @@ -38,8 +38,8 @@ * Contains an implementation struct for this type of heap's node. */ -#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP -#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP +#ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP +#define PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP namespace __gnu_pbds { @@ -52,4 +52,4 @@ namespace __gnu_pbds } // namespace detail } // namespace __gnu_pbds -#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_NULL_METADATA_HPP +#endif // #ifndef PB_DS_LEFT_CHILD_NEXT_SIBLING_HEAP_0_METADATA_HPP diff --git a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp index 2b90cfa1dc0..8d33baa10ac 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp @@ -57,7 +57,7 @@ void PB_DS_CLASS_C_DEC:: trace_node(const_node_pointer p_nd, size_type level) { - while (p_nd != NULL) + while (p_nd != 0) { for (size_type i = 0; i < level; ++i) std::cerr << ' '; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp index c998c3e67c1..662f40f34e8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp @@ -67,13 +67,13 @@ copy_from_range(It first_it, It last_it) PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: -PB_DS_CLASS_NAME() : m_p_l(NULL) +PB_DS_CLASS_NAME() : m_p_l(0) { _GLIBCXX_DEBUG_ONLY(assert_valid();) } PB_DS_CLASS_T_DEC template<typename It> PB_DS_CLASS_C_DEC:: -PB_DS_CLASS_NAME(It first_it, It last_it) : m_p_l(NULL) +PB_DS_CLASS_NAME(It first_it, It last_it) : m_p_l(0) { copy_from_range(first_it, last_it); _GLIBCXX_DEBUG_ONLY(assert_valid();); @@ -85,7 +85,7 @@ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) : #ifdef _GLIBCXX_DEBUG debug_base(), #endif -m_p_l(NULL) +m_p_l(0) { __try { @@ -125,13 +125,13 @@ PB_DS_CLASS_C_DEC:: deallocate_all() { entry_pointer p_l = m_p_l; - while (p_l != NULL) + while (p_l != 0) { entry_pointer p_next_l = p_l->m_p_next; actual_erase_entry(p_l); p_l = p_next_l; } - m_p_l = NULL; + m_p_l = 0; } PB_DS_CLASS_T_DEC diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp index cdc59208fa3..a7d0fbadf89 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp @@ -44,7 +44,7 @@ PB_DS_CLASS_C_DEC:: erase(const_key_reference r_key) { _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) - if (m_p_l == NULL) + if (m_p_l == 0) return false; if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value))) @@ -56,7 +56,7 @@ erase(const_key_reference r_key) } entry_pointer p_l = m_p_l; - while (p_l->m_p_next != NULL) + while (p_l->m_p_next != 0) if (s_eq_fn(r_key, PB_DS_V2F(p_l->m_p_next->m_value))) { erase_next(p_l); @@ -83,7 +83,7 @@ erase_if(Pred pred) { _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) size_type num_ersd = 0; - while (m_p_l != NULL && pred(m_p_l->m_value)) + while (m_p_l != 0 && pred(m_p_l->m_value)) { entry_pointer p_next = m_p_l->m_p_next; ++num_ersd; @@ -91,11 +91,11 @@ erase_if(Pred pred) m_p_l = p_next; } - if (m_p_l == NULL) + if (m_p_l == 0) return num_ersd; entry_pointer p_l = m_p_l; - while (p_l->m_p_next != NULL) + while (p_l->m_p_next != 0) { if (pred(p_l->m_p_next->m_value)) { @@ -115,9 +115,9 @@ void PB_DS_CLASS_C_DEC:: erase_next(entry_pointer p_l) { - _GLIBCXX_DEBUG_ASSERT(p_l != NULL); + _GLIBCXX_DEBUG_ASSERT(p_l != 0); _GLIBCXX_DEBUG_ASSERT(p_l != m_p_l); - _GLIBCXX_DEBUG_ASSERT(p_l->m_p_next != NULL); + _GLIBCXX_DEBUG_ASSERT(p_l->m_p_next != 0); entry_pointer p_next_l = p_l->m_p_next->m_p_next; actual_erase_entry(p_l->m_p_next); p_l->m_p_next = p_next_l; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp index 50347ac5fca..e7f5ed1d3f8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp @@ -43,8 +43,8 @@ inline typename PB_DS_CLASS_C_DEC::entry_pointer PB_DS_CLASS_C_DEC:: find_imp(const_key_reference r_key) const { - if (m_p_l == NULL) - return NULL; + if (m_p_l == 0) + return 0; if (s_eq_fn(r_key, PB_DS_V2F(m_p_l->m_value))) { apply_update(m_p_l, s_metadata_type_indicator); @@ -53,7 +53,7 @@ find_imp(const_key_reference r_key) const } entry_pointer p_l = m_p_l; - while (p_l->m_p_next != NULL) + while (p_l->m_p_next != 0) { entry_pointer p_next = p_l->m_p_next; if (s_eq_fn(r_key, PB_DS_V2F(p_next->m_value))) @@ -72,7 +72,7 @@ find_imp(const_key_reference r_key) const } _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) - return NULL; + return 0; } PB_DS_CLASS_T_DEC diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp index 5ad39709d5d..1aaaf1edd92 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp @@ -54,4 +54,4 @@ PB_DS_CLASS_T_DEC inline bool PB_DS_CLASS_C_DEC:: empty() const -{ return (m_p_l == NULL); } +{ return (m_p_l == 0); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp index 5efe2a13a66..197cfbc6d18 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp @@ -48,7 +48,7 @@ insert(const_reference r_val) _GLIBCXX_DEBUG_ONLY(assert_valid();) entry_pointer p_l = find_imp(PB_DS_V2F(r_val)); - if (p_l != NULL) + if (p_l != 0) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val));) return std::make_pair(point_iterator(&p_l->m_value), false); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp index e3247c5b080..4d4e0b417c2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp @@ -43,7 +43,7 @@ inline typename PB_DS_CLASS_C_DEC::iterator PB_DS_CLASS_C_DEC:: begin() { - if (m_p_l == NULL) + if (m_p_l == 0) { _GLIBCXX_DEBUG_ASSERT(empty()); return end(); @@ -56,7 +56,7 @@ inline typename PB_DS_CLASS_C_DEC::const_iterator PB_DS_CLASS_C_DEC:: begin() const { - if (m_p_l == NULL) + if (m_p_l == 0) { _GLIBCXX_DEBUG_ASSERT(empty()); return end(); @@ -68,13 +68,13 @@ PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::iterator PB_DS_CLASS_C_DEC:: end() -{ return iterator(NULL, NULL, this); } +{ return iterator(0, 0, this); } PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::const_iterator PB_DS_CLASS_C_DEC:: end() const { - return const_iterator(NULL, NULL, const_cast<PB_DS_CLASS_C_DEC* const>(this)); + return const_iterator(0, 0, const_cast<PB_DS_CLASS_C_DEC* const>(this)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp index 0e9336b57ca..cf43064e504 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/lu_map_.hpp @@ -233,7 +233,7 @@ namespace __gnu_pbds { _GLIBCXX_DEBUG_ONLY(assert_valid();) entry_pointer p_e = find_imp(r_key); - return point_iterator(p_e == NULL ? NULL: &p_e->m_value); + return point_iterator(p_e == 0 ? 0: &p_e->m_value); } inline const_point_iterator @@ -241,7 +241,7 @@ namespace __gnu_pbds { _GLIBCXX_DEBUG_ONLY(assert_valid();) entry_pointer p_e = find_imp(r_key); - return const_point_iterator(p_e == NULL ? NULL: &p_e->m_value); + return const_point_iterator(p_e == 0 ? 0: &p_e->m_value); } inline bool @@ -315,7 +315,7 @@ namespace __gnu_pbds inc_it_state(const_pointer& r_p_value, entry_pointer& r_pos) const { r_pos = r_pos->m_p_next; - r_p_value = (r_pos == NULL) ? NULL : &r_pos->m_value; + r_p_value = (r_pos == 0) ? 0 : &r_pos->m_value; } template<typename Metadata> diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp index 908aacc19cd..7c8defcdf06 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp @@ -47,7 +47,7 @@ trace() const { std::cerr << m_p_l << std::endl << std::endl; const_entry_pointer p_l = m_p_l; - while (p_l != NULL) + while (p_l != 0) { std::cerr << PB_DS_V2F(p_l->m_value) << std::endl; p_l = p_l->m_p_next; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp b/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp index 4ef7fe48a82..8e476cb91b9 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 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 terms @@ -47,7 +47,7 @@ namespace __gnu_pbds // A list-update metadata type that moves elements to the front of // the list based on the counter algorithm. - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class counter_lu_metadata { public: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp index 545b9816293..3245566e39a 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp @@ -49,9 +49,9 @@ PB_DS_CLASS_C_DEC::s_metadata_alloc; PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: PB_DS_OV_TREE_CLASS_NAME() : - m_a_values(NULL), - m_a_metadata(NULL), - m_end_it(NULL), + m_a_values(0), + m_a_metadata(0), + m_end_it(0), m_size(0) { _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) } @@ -59,9 +59,9 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn) : cmp_fn_base(r_cmp_fn), - m_a_values(NULL), - m_a_metadata(NULL), - m_end_it(NULL), + m_a_values(0), + m_a_metadata(0), + m_end_it(0), m_size(0) { _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) } @@ -70,9 +70,9 @@ PB_DS_CLASS_C_DEC:: PB_DS_OV_TREE_CLASS_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) : cmp_fn_base(r_cmp_fn), node_update(r_node_update), - m_a_values(NULL), - m_a_metadata(NULL), - m_end_it(NULL), + m_a_values(0), + m_a_metadata(0), + m_end_it(0), m_size(0) { _GLIBCXX_DEBUG_ONLY(PB_DS_CLASS_C_DEC::assert_valid();) } @@ -87,9 +87,9 @@ PB_DS_OV_TREE_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) : #endif cmp_fn_base(other), node_update(other), - m_a_values(NULL), - m_a_metadata(NULL), - m_end_it(NULL), + m_a_values(0), + m_a_metadata(0), + m_end_it(0), m_size(0) { copy_from_ordered_range(other.begin(), other.end()); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp index c32a8af48c7..9b7011b1ff6 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp @@ -47,8 +47,8 @@ assert_valid() const { std::cout << "av1" << std::endl; - if (m_a_values == NULL || m_end_it == NULL || m_size == 0) - _GLIBCXX_DEBUG_ASSERT(m_a_values == NULL && m_end_it == NULL && m_size == 0); + if (m_a_values == 0 || m_end_it == 0 || m_size == 0) + _GLIBCXX_DEBUG_ASSERT(m_a_values == 0 && m_end_it == 0 && m_size == 0); std::cout << "av2" << std::endl; assert_iterators(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp index 05e7d1a1107..dd24114f490 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp @@ -56,7 +56,7 @@ clear() } _GLIBCXX_DEBUG_ONLY(debug_base::clear();) - m_a_values = NULL; + m_a_values = 0; m_size = 0; m_end_it = m_a_values; _GLIBCXX_DEBUG_ONLY(assert_valid();) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp index 91d277b0cae..08d6bfc2293 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp @@ -50,9 +50,9 @@ void PB_DS_CLASS_C_DEC:: reallocate_metadata(Node_Update_* , size_type new_size) { - metadata_pointer a_new_metadata_vec =(new_size == 0) ? NULL : s_metadata_alloc.allocate(new_size); + metadata_pointer a_new_metadata_vec =(new_size == 0) ? 0 : s_metadata_alloc.allocate(new_size); - if (m_a_metadata != NULL) + if (m_a_metadata != 0) { for (size_type i = 0; i < m_size; ++i) m_a_metadata[i].~metadata_type(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp index 7652c4c2ea2..0417ae1dd9e 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp @@ -69,8 +69,8 @@ PB_DS_node_begin_imp() const { return const_node_iterator(const_cast<pointer>(mid_pointer(begin(), end())), const_cast<pointer>(begin()), - const_cast<pointer>(end()),(m_a_metadata == NULL)? - NULL : + const_cast<pointer>(end()),(m_a_metadata == 0)? + 0 : mid_pointer(m_a_metadata, m_a_metadata + m_size)); } @@ -80,7 +80,7 @@ PB_DS_CLASS_C_DEC:: PB_DS_node_end_imp() const { return const_node_iterator(end(), end(), end(), - (m_a_metadata == NULL) ? NULL : m_a_metadata + m_size); + (m_a_metadata == 0) ? 0 : m_a_metadata + m_size); } PB_DS_CLASS_T_DEC @@ -89,7 +89,7 @@ PB_DS_CLASS_C_DEC:: PB_DS_node_begin_imp() { return node_iterator(mid_pointer(begin(), end()), begin(), end(), - (m_a_metadata == NULL) ? NULL : mid_pointer(m_a_metadata, m_a_metadata + m_size)); + (m_a_metadata == 0) ? 0 : mid_pointer(m_a_metadata, m_a_metadata + m_size)); } PB_DS_CLASS_T_DEC @@ -98,6 +98,6 @@ PB_DS_CLASS_C_DEC:: PB_DS_node_end_imp() { return node_iterator(end(), end(), - end(),(m_a_metadata == NULL) ? NULL : m_a_metadata + m_size); + end(),(m_a_metadata == 0) ? 0 : m_a_metadata + m_size); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp index 68fedc0eb05..1c45c51c1d8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp @@ -118,7 +118,7 @@ namespace __gnu_pbds public: inline - ov_tree_node_const_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : m_p_value(const_cast<pointer>(p_nd)), m_p_begin_value(const_cast<pointer>(p_begin_nd)), m_p_end_value(const_cast<pointer>(p_end_nd)), m_p_metadata(p_metadata) + ov_tree_node_const_it_(const_pointer p_nd = 0, const_pointer p_begin_nd = 0, const_pointer p_end_nd = 0, const_metadata_pointer p_metadata = 0) : m_p_value(const_cast<pointer>(p_nd)), m_p_begin_value(const_cast<pointer>(p_begin_nd)), m_p_end_value(const_cast<pointer>(p_end_nd)), m_p_metadata(p_metadata) { } inline const_reference @@ -134,7 +134,7 @@ namespace __gnu_pbds }; PB_DS_STATIC_ASSERT(should_have_metadata, has_metadata); - _GLIBCXX_DEBUG_ASSERT(m_p_metadata != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_metadata != 0); return *m_p_metadata; } @@ -164,8 +164,8 @@ namespace __gnu_pbds return (this_type(mid_pointer(m_p_value + 1, m_p_end_value), m_p_value + 1, - m_p_end_value,(m_p_metadata == NULL) ? - NULL : mid_pointer(m_p_metadata + 1, p_end_metadata))); + m_p_end_value,(m_p_metadata == 0) ? + 0 : mid_pointer(m_p_metadata + 1, p_end_metadata))); } inline bool @@ -241,7 +241,7 @@ namespace __gnu_pbds public: inline - ov_tree_node_it_(const_pointer p_nd = NULL, const_pointer p_begin_nd = NULL, const_pointer p_end_nd = NULL, const_metadata_pointer p_metadata = NULL) : base_type(p_nd, p_begin_nd, p_end_nd, p_metadata) + ov_tree_node_it_(const_pointer p_nd = 0, const_pointer p_begin_nd = 0, const_pointer p_end_nd = 0, const_metadata_pointer p_metadata = 0) : base_type(p_nd, p_begin_nd, p_end_nd, p_metadata) { } // Access. @@ -277,8 +277,8 @@ namespace __gnu_pbds return (this_type(base_type::mid_pointer(base_type::m_p_value + 1, base_type::m_p_end_value), base_type::m_p_value + 1, - base_type::m_p_end_value,(base_type::m_p_metadata == NULL)? - NULL : base_type::mid_pointer(base_type::m_p_metadata + 1, p_end_metadata))); + base_type::m_p_end_value,(base_type::m_p_metadata == 0)? + 0 : base_type::mid_pointer(base_type::m_p_metadata + 1, p_end_metadata))); } }; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp index 7c9fc13456a..51afa4fab92 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp @@ -45,8 +45,8 @@ void PB_DS_CLASS_C_DEC:: assert_valid() const { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root == NULL - || base_type::m_p_root->m_p_next_sibling == NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_root == 0 + || base_type::m_p_root->m_p_next_sibling == 0); base_type::assert_valid(); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp index 905be1098cf..226e9531ada 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp @@ -48,8 +48,8 @@ pop() node_pointer p_new_root = join_node_children(base_type::m_p_root); _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_new_root, false);) - if (p_new_root != NULL) - p_new_root->m_p_prev_or_parent = NULL; + if (p_new_root != 0) + p_new_root->m_p_prev_or_parent = 0; base_type::actual_erase_node(base_type::m_p_root); base_type::m_p_root = p_new_root; @@ -78,27 +78,27 @@ remove_node(node_pointer p_nd) node_pointer p_new_child = join_node_children(p_nd); #ifdef _GLIBCXX_DEBUG - if (p_new_child != NULL) + if (p_new_child != 0) base_type::assert_node_consistent(p_new_child, false); #endif if (p_nd == base_type::m_p_root) { - if (p_new_child != NULL) - p_new_child->m_p_prev_or_parent = NULL; + if (p_new_child != 0) + p_new_child->m_p_prev_or_parent = 0; base_type::m_p_root = p_new_child; _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(base_type::m_p_root, false);) return; } - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_prev_or_parent != 0); if (p_nd->m_p_prev_or_parent->m_p_l_child == p_nd) { - if (p_new_child != NULL) + if (p_new_child != 0) { p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling; - if (p_new_child->m_p_next_sibling != NULL) + if (p_new_child->m_p_next_sibling != 0) p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child; p_nd->m_p_prev_or_parent->m_p_l_child = p_new_child; _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);) @@ -106,17 +106,17 @@ remove_node(node_pointer p_nd) } p_nd->m_p_prev_or_parent->m_p_l_child = p_nd->m_p_next_sibling; - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);) return; } - if (p_new_child != NULL) + if (p_new_child != 0) { p_new_child->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; p_new_child->m_p_next_sibling = p_nd->m_p_next_sibling; - if (p_new_child->m_p_next_sibling != NULL) + if (p_new_child->m_p_next_sibling != 0) p_new_child->m_p_next_sibling->m_p_prev_or_parent = p_new_child; p_new_child->m_p_prev_or_parent->m_p_next_sibling = p_new_child; _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);) @@ -124,7 +124,7 @@ remove_node(node_pointer p_nd) } p_nd->m_p_prev_or_parent->m_p_next_sibling = p_nd->m_p_next_sibling; - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd->m_p_prev_or_parent, false);) } @@ -134,11 +134,11 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: join_node_children(node_pointer p_nd) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); node_pointer p_ret = p_nd->m_p_l_child; - if (p_ret == NULL) - return NULL; - while (p_ret->m_p_next_sibling != NULL) + if (p_ret == 0) + return 0; + while (p_ret->m_p_next_sibling != 0) p_ret = forward_join(p_ret, p_ret->m_p_next_sibling); while (p_ret->m_p_prev_or_parent != p_nd) p_ret = back_join(p_ret->m_p_prev_or_parent, p_ret); @@ -151,17 +151,17 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: forward_join(node_pointer p_nd, node_pointer p_next) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == p_next); if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value)) { p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; base_type::make_child_of(p_nd, p_next); - return p_next->m_p_next_sibling == NULL + return p_next->m_p_next_sibling == 0 ? p_next : p_next->m_p_next_sibling; } - if (p_next->m_p_next_sibling != NULL) + if (p_next->m_p_next_sibling != 0) { p_next->m_p_next_sibling->m_p_prev_or_parent = p_nd; p_nd->m_p_next_sibling = p_next->m_p_next_sibling; @@ -169,7 +169,7 @@ forward_join(node_pointer p_nd, node_pointer p_next) return p_nd->m_p_next_sibling; } - p_nd->m_p_next_sibling = NULL; + p_nd->m_p_next_sibling = 0; base_type::make_child_of(p_next, p_nd); _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false)); return p_nd; @@ -180,8 +180,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: back_join(node_pointer p_nd, node_pointer p_next) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == 0); if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value)) { @@ -191,7 +191,7 @@ back_join(node_pointer p_nd, node_pointer p_next) return p_next; } - p_nd->m_p_next_sibling = NULL; + p_nd->m_p_next_sibling = 0; base_type::make_child_of(p_next, p_nd); _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false)); return p_nd; @@ -212,7 +212,7 @@ erase_if(Pred pred) base_type::to_linked_list(); node_pointer p_out = base_type::prune(pred); size_type ersd = 0; - while (p_out != NULL) + while (p_out != 0) { ++ersd; node_pointer p_next = p_out->m_p_next_sibling; @@ -221,11 +221,11 @@ erase_if(Pred pred) } node_pointer p_cur = base_type::m_p_root; - base_type::m_p_root = NULL; - while (p_cur != NULL) + base_type::m_p_root = 0; + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; - p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL; + p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = 0; push_imp(p_cur); p_cur = p_next; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp index b00e9d13cdf..af929e58131 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp @@ -59,17 +59,17 @@ inline void PB_DS_CLASS_C_DEC:: push_imp(node_pointer p_nd) { - p_nd->m_p_l_child = NULL; + p_nd->m_p_l_child = 0; - if (base_type::m_p_root == NULL) + if (base_type::m_p_root == 0) { - p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL; + p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = 0; base_type::m_p_root = p_nd; } else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, p_nd->m_value)) { - p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = NULL; + p_nd->m_p_next_sibling = p_nd->m_p_prev_or_parent = 0; base_type::make_child_of(base_type::m_p_root, p_nd); _GLIBCXX_DEBUG_ONLY(base_type::assert_node_consistent(p_nd, false)); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp index 85d4ddf074a..12032734f4e 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp @@ -61,7 +61,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_out = base_type::prune(pred); - while (p_out != NULL) + while (p_out != 0) { _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0); --base_type::m_size; @@ -70,7 +70,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_next = p_out->m_p_next_sibling; - p_out->m_p_l_child = p_out->m_p_next_sibling = p_out->m_p_prev_or_parent = NULL; + p_out->m_p_l_child = p_out->m_p_next_sibling = p_out->m_p_prev_or_parent = 0; other.push_imp(p_out); @@ -81,13 +81,13 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_cur = base_type::m_p_root; - base_type::m_p_root = NULL; + base_type::m_p_root = 0; - while (p_cur != NULL) + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; - p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = NULL; + p_cur->m_p_l_child = p_cur->m_p_next_sibling = p_cur->m_p_prev_or_parent = 0; push_imp(p_cur); @@ -106,7 +106,7 @@ join(PB_DS_CLASS_C_DEC& other) _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(other.assert_valid();) - if (other.m_p_root == NULL) + if (other.m_p_root == 0) { _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(other.assert_valid();) @@ -114,7 +114,7 @@ join(PB_DS_CLASS_C_DEC& other) return; } - if (base_type::m_p_root == NULL) + if (base_type::m_p_root == 0) base_type::m_p_root = other.m_p_root; else if (Cmp_Fn::operator()(base_type::m_p_root->m_value, other.m_p_root->m_value)) { @@ -131,7 +131,7 @@ join(PB_DS_CLASS_C_DEC& other) base_type::m_size += other.m_size; - other.m_p_root = NULL; + other.m_p_root = 0; other.m_size = 0; _GLIBCXX_DEBUG_ONLY(assert_valid();) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp index 15f349efbed..8decad5a7f0 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/child_iterator.hpp @@ -48,8 +48,8 @@ public: typedef node_pointer_reference reference; inline - iterator(node_pointer_pointer p_p_cur = NULL, - node_pointer_pointer p_p_end = NULL) + iterator(node_pointer_pointer p_p_cur = 0, + node_pointer_pointer p_p_end = 0) : const_iterator(p_p_cur, p_p_end) { } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp index bc349cf2dbd..5cc9c2234c6 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp @@ -53,8 +53,8 @@ public: public: inline - const_iterator(node_pointer_pointer p_p_cur = NULL, - node_pointer_pointer p_p_end = NULL) + const_iterator(node_pointer_pointer p_p_cur = 0, + node_pointer_pointer p_p_end = 0) : m_p_p_cur(p_p_cur), m_p_p_end(p_p_end) { } @@ -71,7 +71,7 @@ public: { do ++m_p_p_cur; - while (m_p_p_cur != m_p_p_end&& * m_p_p_cur == NULL); + while (m_p_p_cur != m_p_p_end&& * m_p_p_cur == 0); return *this; } @@ -101,7 +101,7 @@ protected: #ifdef _GLIBCXX_DEBUG void assert_referencible() const - { _GLIBCXX_DEBUG_ASSERT(m_p_p_cur != m_p_p_end&& * m_p_p_cur != NULL); } + { _GLIBCXX_DEBUG_ASSERT(m_p_p_cur != m_p_p_end&& * m_p_p_cur != 0); } #endif public: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp index ca38f932a62..4d4b52a55eb 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp @@ -85,7 +85,7 @@ PB_DS_CLASS_NAME(const PB_DS_CLASS_C_DEC& other) : initialize(); m_size = other.m_size; _GLIBCXX_DEBUG_ONLY(other.assert_valid();) - if (other.m_p_head->m_p_parent == NULL) + if (other.m_p_head->m_p_parent == 0) { _GLIBCXX_DEBUG_ONLY(assert_valid();) return; @@ -143,7 +143,7 @@ PB_DS_CLASS_C_DEC:: initialize() { new (m_p_head) head(); - m_p_head->m_p_parent = NULL; + m_p_head->m_p_parent = 0; m_p_head->m_p_min = m_p_head; m_p_head->m_p_max = m_p_head; m_size = 0; @@ -164,7 +164,7 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: recursive_copy_node(const_node_pointer p_other_nd) { - _GLIBCXX_DEBUG_ASSERT(p_other_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_other_nd != 0); if (p_other_nd->m_type == pat_trie_leaf_node_type) { const_leaf_pointer p_other_leaf = static_cast<const_leaf_pointer>(p_other_nd); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp index de75657881b..664206499b2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp @@ -45,11 +45,11 @@ void PB_DS_CLASS_C_DEC:: assert_valid() const { - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) m_p_head->m_p_parent->assert_valid(this); assert_iterators(); assert_reverse_iterators(); - if (m_p_head->m_p_parent == NULL) + if (m_p_head->m_p_parent == 0) { _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_min == m_p_head); _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_max == m_p_head); @@ -99,7 +99,7 @@ typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: recursive_count_leafs(const_node_pointer p_nd) { - if (p_nd == NULL) + if (p_nd == 0) return (0); if (p_nd->m_type == pat_trie_leaf_node_type) return (1); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp index 90988184a8d..57e998981a8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp @@ -44,7 +44,7 @@ PB_DS_CLASS_C_DEC:: erase(const_key_reference r_key) { node_pointer p_nd = find_imp(r_key); - if (p_nd == NULL || p_nd->m_type == pat_trie_internal_node_type) + if (p_nd == 0 || p_nd->m_type == pat_trie_internal_node_type) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key)); return false; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp index 2552ead8bc5..f53af256339 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp @@ -46,7 +46,7 @@ find(const_key_reference r_key) _GLIBCXX_DEBUG_ONLY(assert_valid();) node_pointer p_nd = find_imp(r_key); - if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type) + if (p_nd == 0 || p_nd->m_type != pat_trie_leaf_node_type) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) return end(); @@ -71,7 +71,7 @@ find(const_key_reference r_key) const const_node_pointer p_nd = const_cast<PB_DS_CLASS_C_DEC* >(this)->find_imp(r_key); - if (p_nd == NULL || p_nd->m_type != pat_trie_leaf_node_type) + if (p_nd == 0 || p_nd->m_type != pat_trie_leaf_node_type) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_does_not_exist(r_key);) return end(); @@ -93,7 +93,7 @@ PB_DS_CLASS_C_DEC:: find_imp(const_key_reference r_key) { if (empty()) - return (NULL); + return (0); typename synth_e_access_traits::const_iterator b_it = synth_e_access_traits::begin(r_key); @@ -101,14 +101,14 @@ find_imp(const_key_reference r_key) synth_e_access_traits::end(r_key); node_pointer p_nd = m_p_head->m_p_parent; - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); while (p_nd->m_type != pat_trie_leaf_node_type) { _GLIBCXX_DEBUG_ASSERT(p_nd->m_type == pat_trie_internal_node_type); node_pointer p_next_nd = static_cast<internal_node_pointer>(p_nd)->get_child_node(b_it, e_it, this); - if (p_next_nd == NULL) + if (p_next_nd == 0) return p_nd; p_nd = p_next_nd; } @@ -124,7 +124,7 @@ lower_bound_imp(const_key_reference r_key) return (m_p_head); node_pointer p_nd = m_p_head->m_p_parent; - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); typename PB_DS_CLASS_C_DEC::const_e_iterator b_it = synth_e_access_traits::begin(r_key); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp index e6049743f61..de3cb35276b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp @@ -165,7 +165,7 @@ rec_join_prep(const_internal_node_pointer p_l, const_internal_node_pointer p_r, it != p_r->end(); ++ it) { const_node_pointer p_l_join_child = p_l->get_join_child(*it, this); - if (p_l_join_child != NULL) + if (p_l_join_child != 0) rec_join_prep(p_l_join_child, * it, r_bag); } return; @@ -175,7 +175,7 @@ rec_join_prep(const_internal_node_pointer p_l, const_internal_node_pointer p_r, p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this)) { const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this); - if (p_r_join_child != NULL) + if (p_r_join_child != 0) rec_join_prep(p_r_join_child, p_l, r_bag); return; } @@ -184,7 +184,7 @@ rec_join_prep(const_internal_node_pointer p_l, const_internal_node_pointer p_r, p_r->should_be_mine(p_l->pref_b_it(), p_l->pref_e_it(), 0, this)) { const_node_pointer p_r_join_child = p_r->get_join_child(p_l, this); - if (p_r_join_child != NULL) + if (p_r_join_child != 0) rec_join_prep(p_r_join_child, p_l, r_bag); return; } @@ -196,8 +196,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: rec_join(node_pointer p_l, node_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag) { - _GLIBCXX_DEBUG_ASSERT(p_r != NULL); - if (p_l == NULL) + _GLIBCXX_DEBUG_ASSERT(p_r != 0); + if (p_l == 0) { apply_update(p_r, (node_update* )this); return (p_r); @@ -245,8 +245,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: rec_join(leaf_pointer p_l, leaf_pointer p_r, split_join_branch_bag& r_bag) { - _GLIBCXX_DEBUG_ASSERT(p_r != NULL); - if (p_l == NULL) + _GLIBCXX_DEBUG_ASSERT(p_r != 0); + if (p_l == 0) return (p_r); node_pointer p_ret = insert_branch(p_l, p_r, r_bag); _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == 2); @@ -264,7 +264,7 @@ rec_join(leaf_pointer p_l, internal_node_pointer p_r, size_type checked_ind, const size_type rhs_leafs = recursive_count_leafs(p_r); #endif - _GLIBCXX_DEBUG_ASSERT(p_r != NULL); + _GLIBCXX_DEBUG_ASSERT(p_r != 0); node_pointer p_ret = rec_join(p_r, p_l, checked_ind, r_bag); _GLIBCXX_DEBUG_ASSERT(recursive_count_leafs(p_ret) == lhs_leafs + rhs_leafs); return p_ret; @@ -275,8 +275,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: rec_join(internal_node_pointer p_l, leaf_pointer p_r, size_type checked_ind, split_join_branch_bag& r_bag) { - _GLIBCXX_DEBUG_ASSERT(p_l != NULL); - _GLIBCXX_DEBUG_ASSERT(p_r != NULL); + _GLIBCXX_DEBUG_ASSERT(p_l != 0); + _GLIBCXX_DEBUG_ASSERT(p_r != 0); #ifdef _GLIBCXX_DEBUG const size_type lhs_leafs = recursive_count_leafs(p_l); @@ -313,8 +313,8 @@ typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: rec_join(internal_node_pointer p_l, internal_node_pointer p_r, split_join_branch_bag& r_bag) { - _GLIBCXX_DEBUG_ASSERT(p_l != NULL); - _GLIBCXX_DEBUG_ASSERT(p_r != NULL); + _GLIBCXX_DEBUG_ASSERT(p_l != 0); + _GLIBCXX_DEBUG_ASSERT(p_r != 0); #ifdef _GLIBCXX_DEBUG const size_type lhs_leafs = recursive_count_leafs(p_l); @@ -378,7 +378,7 @@ PB_DS_CLASS_C_DEC:: insert(const_reference r_val) { node_pointer p_lf = find_imp(PB_DS_V2F(r_val)); - if (p_lf != NULL && p_lf->m_type == pat_trie_leaf_node_type && + if (p_lf != 0 && p_lf->m_type == pat_trie_leaf_node_type && synth_e_access_traits::equal_keys(PB_DS_V2F(static_cast<leaf_pointer>(p_lf)->value()), PB_DS_V2F(r_val))) { _GLIBCXX_DEBUG_ONLY(debug_base::check_key_exists(PB_DS_V2F(r_val))); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp index bf2f42916dd..56cf1330497 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/internal_node.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 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 terms @@ -226,7 +226,7 @@ namespace __gnu_pbds get_pref_pos(const_e_iterator b_it, const_e_iterator e_it, const_e_access_traits_pointer p_traits) const { - if (static_cast<size_t>(std::distance(b_it, e_it)) <= m_e_ind) + if (static_cast<std::size_t>(std::distance(b_it, e_it)) <= m_e_ind) return 0; std::advance(b_it, m_e_ind); return 1 + p_traits->e_pos(*b_it); @@ -240,7 +240,7 @@ namespace __gnu_pbds { std::advance(m_pref_e_it, m_e_ind); std::fill(m_a_p_children, m_a_p_children + arr_size, - static_cast<node_pointer>(NULL)); + static_cast<node_pointer>(0)); } PB_DS_CLASS_T_DEC @@ -317,7 +317,7 @@ namespace __gnu_pbds { const size_type i = get_pref_pos(b_it, e_it, p_traits); _GLIBCXX_DEBUG_ASSERT(i < arr_size); - _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i] != NULL); + _GLIBCXX_DEBUG_ASSERT(m_a_p_children[i] != 0); return iterator(m_a_p_children + i, m_a_p_children + i); } @@ -345,11 +345,11 @@ namespace __gnu_pbds size_type i = get_pref_pos(b_it, e_it, p_traits); _GLIBCXX_DEBUG_ASSERT(i < arr_size); - if (m_a_p_children[i] != NULL) + if (m_a_p_children[i] != 0) return m_a_p_children[i]; while (++i < arr_size) - if (m_a_p_children[i] != NULL) + if (m_a_p_children[i] != 0) { if (m_a_p_children[i]->m_type == pat_trie_leaf_node_type) return m_a_p_children[i]; @@ -370,7 +370,7 @@ namespace __gnu_pbds { const size_type i = get_pref_pos(b_it, e_it, p_traits); _GLIBCXX_DEBUG_ASSERT(i < arr_size); - if (m_a_p_children[i] == NULL) + if (m_a_p_children[i] == 0) { m_a_p_children[i] = p_nd; p_nd->m_p_parent = this; @@ -423,7 +423,7 @@ namespace __gnu_pbds for (; i < arr_size; ++i) if (m_a_p_children[i] == p_nd) { - m_a_p_children[i] = NULL; + m_a_p_children[i] = 0; return; } _GLIBCXX_DEBUG_ASSERT(i != arr_size); @@ -436,7 +436,7 @@ namespace __gnu_pbds { iterator ret = it; ++ret; - * it.m_p_p_cur = NULL; + * it.m_p_p_cur = 0; return ret; } @@ -558,7 +558,7 @@ namespace __gnu_pbds get_begin_pos() const { size_type i; - for (i = 0; i < arr_size && m_a_p_children[i] == NULL; ++i) + for (i = 0; i < arr_size && m_a_p_children[i] == 0; ++i) ; return i; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp index 9902d96dbb1..893a762056d 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp @@ -110,11 +110,11 @@ PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::const_node_iterator PB_DS_CLASS_C_DEC:: node_end() const -{ return const_node_iterator(NULL, this); } +{ return const_node_iterator(0, this); } PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::node_iterator PB_DS_CLASS_C_DEC:: node_end() -{ return node_iterator(NULL, this); } +{ return node_iterator(0, this); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp index 37250091d00..eb5e0002b9f 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/node_iterators.hpp @@ -180,8 +180,8 @@ namespace __gnu_pbds pat_trie_const_node_it_() */ inline - pat_trie_const_node_it_(node_pointer p_nd = NULL, - const_e_access_traits_pointer p_traits = NULL) + pat_trie_const_node_it_(node_pointer p_nd = 0, + const_e_access_traits_pointer p_traits = 0) : m_p_nd(const_cast<node_pointer>(p_nd)), m_p_traits(p_traits) { } @@ -299,7 +299,7 @@ namespace __gnu_pbds */ inline - pat_trie_node_it_(node_pointer p_nd = NULL, const_e_access_traits_pointer p_traits = NULL) : base_type(p_nd, p_traits) + pat_trie_node_it_(node_pointer p_nd = 0, const_e_access_traits_pointer p_traits = 0) : base_type(p_nd, p_traits) { } // Access; returns the iterator* associated with the current leaf. diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp index cada9071c51..0a142478eb8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/point_iterators.hpp @@ -145,7 +145,7 @@ namespace __gnu_pbds public: inline - pat_trie_const_it_(node_pointer p_nd = NULL) : m_p_nd(p_nd) + pat_trie_const_it_(node_pointer p_nd = 0) : m_p_nd(p_nd) { } inline @@ -245,7 +245,7 @@ namespace __gnu_pbds node_pointer p_y = m_p_nd->m_p_parent; while (p_y->m_type != pat_trie_head_node_type && - get_larger_sibling(m_p_nd) == NULL) + get_larger_sibling(m_p_nd) == 0) { m_p_nd = p_y; p_y = p_y->m_p_parent; @@ -274,7 +274,7 @@ namespace __gnu_pbds node_pointer p_y = m_p_nd->m_p_parent; while (p_y->m_type != pat_trie_head_node_type && - get_smaller_sibling(m_p_nd) == NULL) + get_smaller_sibling(m_p_nd) == 0) { m_p_nd = p_y; p_y = p_y->m_p_parent; @@ -300,7 +300,7 @@ namespace __gnu_pbds typename Internal_Node::iterator next_it = it; ++next_it; - return ((next_it == p_parent->end())? NULL :* next_it); + return ((next_it == p_parent->end())? 0 :* next_it); } inline static node_pointer @@ -312,7 +312,7 @@ namespace __gnu_pbds typename Internal_Node::iterator it = p_parent->begin(); if (*it == p_nd) - return (NULL); + return (0); typename Internal_Node::iterator prev_it; do { @@ -324,7 +324,7 @@ namespace __gnu_pbds while (true); _GLIBCXX_DEBUG_ASSERT(false); - return (NULL); + return (0); } inline static leaf_pointer @@ -397,7 +397,7 @@ namespace __gnu_pbds typedef typename Type_Traits::reference reference; inline - pat_trie_it_(node_pointer p_nd = NULL) : PB_DS_CONST_IT_C_DEC((node_pointer)p_nd) + pat_trie_it_(node_pointer p_nd = 0) : PB_DS_CONST_IT_C_DEC((node_pointer)p_nd) { } inline diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp index 52edf250635..bfb456392b2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp @@ -93,7 +93,7 @@ void PB_DS_CLASS_C_DEC:: clear_imp(node_pointer p_nd) { - if (p_nd == NULL) + if (p_nd == 0) return; clear_imp(p_nd->m_p_left); clear_imp(p_nd->m_p_right); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp index c0809fa48bc..40dc38c71b4 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp @@ -46,7 +46,7 @@ rotate_left(node_pointer p_x) node_pointer p_y = p_x->m_p_right; p_x->m_p_right = p_y->m_p_left; - if (p_y->m_p_left != NULL) + if (p_y->m_p_left != 0) p_y->m_p_left->m_p_parent = p_x; p_y->m_p_parent = p_x->m_p_parent; @@ -75,7 +75,7 @@ rotate_right(node_pointer p_x) node_pointer p_y = p_x->m_p_left; p_x->m_p_left = p_y->m_p_right; - if (p_y->m_p_right != NULL) + if (p_y->m_p_right != 0) p_y->m_p_right->m_p_parent = p_x; p_y->m_p_parent = p_x->m_p_parent; @@ -122,10 +122,10 @@ inline void PB_DS_CLASS_C_DEC:: apply_update(node_pointer p_nd, Node_Update_* p_update) { - p_update->operator()(& PB_DS_V2F(p_nd->m_value),(p_nd->m_p_left == NULL) ? - NULL : - & PB_DS_V2F(p_nd->m_p_left->m_value),(p_nd->m_p_right == NULL) ? - NULL : + p_update->operator()(& PB_DS_V2F(p_nd->m_value),(p_nd->m_p_left == 0) ? + 0 : + & PB_DS_V2F(p_nd->m_p_left->m_value),(p_nd->m_p_right == 0) ? + 0 : & PB_DS_V2F(p_nd->m_p_right->m_value)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp index 9779a4bcd22..320d32c0667 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp @@ -47,7 +47,7 @@ split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other) _GLIBCXX_DEBUG_ONLY(other.assert_valid();); split_join_branch_bag bag; leaf_pointer p_split_lf = split_prep(r_key, other, bag); - if (p_split_lf == NULL) + if (p_split_lf == 0) { _GLIBCXX_DEBUG_ASSERT(bag.empty()); _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -88,7 +88,7 @@ split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other, split_join_branc other.clear(); _GLIBCXX_DEBUG_ONLY(assert_valid();); _GLIBCXX_DEBUG_ONLY(other.assert_valid();); - return (NULL); + return (0); } if (synth_e_access_traits::cmp_keys(r_key, @@ -98,7 +98,7 @@ split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other, split_join_branc value_swap(other); _GLIBCXX_DEBUG_ONLY(assert_valid();); _GLIBCXX_DEBUG_ONLY(other.assert_valid();); - return (NULL); + return (0); } if (!synth_e_access_traits::cmp_keys(r_key, @@ -106,7 +106,7 @@ split_prep(const_key_reference r_key, PB_DS_CLASS_C_DEC& other, split_join_branc { _GLIBCXX_DEBUG_ONLY(assert_valid();); _GLIBCXX_DEBUG_ONLY(other.assert_valid();); - return (NULL); + return (0); } iterator it = lower_bound(r_key); @@ -134,7 +134,7 @@ rec_split(node_pointer p_nd, const_e_iterator b_it, const_e_iterator e_it, PB_DS { if (p_nd->m_type == pat_trie_leaf_node_type) { - _GLIBCXX_DEBUG_ASSERT(other.m_p_head->m_p_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(other.m_p_head->m_p_parent == 0); return (p_nd); } @@ -202,27 +202,27 @@ PB_DS_CLASS_C_DEC:: split_insert_branch(size_type e_ind, const_e_iterator b_it, typename internal_node::iterator child_b_it, size_type num_children, split_join_branch_bag& r_bag) { #ifdef _GLIBCXX_DEBUG - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) m_p_head->m_p_parent->assert_valid(this); #endif - const size_type total_num_children =((m_p_head->m_p_parent == NULL)? 0 : 1) + num_children; + const size_type total_num_children =((m_p_head->m_p_parent == 0)? 0 : 1) + num_children; if (total_num_children == 0) { - _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == 0); return; } if (total_num_children == 1) { - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) { _GLIBCXX_DEBUG_ONLY(m_p_head->m_p_parent->assert_valid(this);) return; } - _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_head->m_p_parent == 0); m_p_head->m_p_parent =* child_b_it; m_p_head->m_p_parent->m_p_parent = m_p_head; apply_update(m_p_head->m_p_parent, (node_update* )this); @@ -242,7 +242,7 @@ split_insert_branch(size_type e_ind, const_e_iterator b_it, typename internal_no ++child_b_it; } - if (m_p_head->m_p_parent != NULL) + if (m_p_head->m_p_parent != 0) p_new_root->add_child(m_p_head->m_p_parent, pref_begin(m_p_head->m_p_parent), pref_end(m_p_head->m_p_parent), this); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp index e4b20943be6..e6af80413a4 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp @@ -46,7 +46,7 @@ PB_DS_CLASS_C_DEC:: trace() const { std::cerr << std::endl; - if (m_p_head->m_p_parent == NULL) + if (m_p_head->m_p_parent == 0) return; trace_node(m_p_head->m_p_parent, 0); std::cerr << std::endl; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp index 6d275e731d1..1eecdc10990 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp @@ -51,5 +51,5 @@ PB_DS_CLASS_C_DEC:: apply_update(node_pointer p_nd, Node_Update_* /*p_update*/) { Node_Update_::operator()(node_iterator(p_nd, this), - const_node_iterator(NULL, this)); + const_node_iterator(0, this)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp index 18ecc4230ed..7cdadfc5f83 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp @@ -45,7 +45,7 @@ typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: assert_node_consistent(const node_pointer p_nd) const { - if (p_nd == NULL) + if (p_nd == 0) return 1; const size_type l_height = assert_node_consistent(p_nd->m_p_left); @@ -67,7 +67,7 @@ assert_valid() const base_type::assert_valid(); const node_pointer p_head = base_type::m_p_head; _GLIBCXX_DEBUG_ASSERT(p_head->m_red); - if (p_head->m_p_parent != NULL) + if (p_head->m_p_parent != 0) { _GLIBCXX_DEBUG_ASSERT(!p_head->m_p_parent->m_red); assert_node_consistent(p_head->m_p_parent); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp index 685b8a51b6b..2ae4cef072c 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp @@ -123,17 +123,17 @@ remove_node(node_pointer p_z) { update_min_max_for_erased_node(p_z); node_pointer p_y = p_z; - node_pointer p_x = NULL; - node_pointer p_new_x_parent = NULL; + node_pointer p_x = 0; + node_pointer p_new_x_parent = 0; - if (p_y->m_p_left == NULL) + if (p_y->m_p_left == 0) p_x = p_y->m_p_right; - else if (p_y->m_p_right == NULL) + else if (p_y->m_p_right == 0) p_x = p_y->m_p_left; else { p_y = p_y->m_p_right; - while (p_y->m_p_left != NULL) + while (p_y->m_p_left != 0) p_y = p_y->m_p_left; p_x = p_y->m_p_right; } @@ -141,7 +141,7 @@ remove_node(node_pointer p_z) if (p_y == p_z) { p_new_x_parent = p_y->m_p_parent; - if (p_x != NULL) + if (p_x != 0) p_x->m_p_parent = p_y->m_p_parent; if (base_type::m_p_head->m_p_parent == p_z) @@ -153,7 +153,7 @@ remove_node(node_pointer p_z) } else { - p_y->m_p_left = NULL; + p_y->m_p_left = 0; p_z->m_p_parent->m_p_right = p_x; } } @@ -164,7 +164,7 @@ remove_node(node_pointer p_z) if (p_y != p_z->m_p_right) { p_new_x_parent = p_y->m_p_parent; - if (p_x != NULL) + if (p_x != 0) p_x->m_p_parent = p_y->m_p_parent; p_y->m_p_parent->m_p_left = p_x; p_y->m_p_right = p_z->m_p_right; @@ -198,7 +198,7 @@ void PB_DS_CLASS_C_DEC:: remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) { - _GLIBCXX_DEBUG_ASSERT(p_x == NULL || p_x->m_p_parent == p_new_x_parent); + _GLIBCXX_DEBUG_ASSERT(p_x == 0 || p_x->m_p_parent == p_new_x_parent); while (p_x != base_type::m_p_head->m_p_parent && is_effectively_black(p_x)) if (p_x == p_new_x_parent->m_p_left) @@ -223,7 +223,7 @@ remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) { if (is_effectively_black(p_w->m_p_right)) { - if (p_w->m_p_left != NULL) + if (p_w->m_p_left != 0) p_w->m_p_left->m_red = false; p_w->m_red = true; @@ -234,7 +234,7 @@ remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) p_w->m_red = p_new_x_parent->m_red; p_new_x_parent->m_red = false; - if (p_w->m_p_right != NULL) + if (p_w->m_p_right != 0) p_w->m_p_right->m_red = false; base_type::rotate_left(p_new_x_parent); @@ -264,7 +264,7 @@ remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) { if (is_effectively_black(p_w->m_p_left)) { - if (p_w->m_p_right != NULL) + if (p_w->m_p_right != 0) p_w->m_p_right->m_red = false; p_w->m_red = true; @@ -275,7 +275,7 @@ remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) p_w->m_red = p_new_x_parent->m_red; p_new_x_parent->m_red = false; - if (p_w->m_p_left != NULL) + if (p_w->m_p_left != 0) p_w->m_p_left->m_red = false; base_type::rotate_right(p_new_x_parent); @@ -284,6 +284,6 @@ remove_fixup(node_pointer p_x, node_pointer p_new_x_parent) } } - if (p_x != NULL) + if (p_x != 0) p_x->m_red = false; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp index 6b43b1a994c..97eba22f6f8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp @@ -42,5 +42,5 @@ PB_DS_CLASS_T_DEC inline bool PB_DS_CLASS_C_DEC:: is_effectively_black(const node_pointer p_nd) -{ return (p_nd == NULL || !p_nd->m_red); } +{ return (p_nd == 0 || !p_nd->m_red); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp index 16a5d1edb29..a6a60160cca 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp @@ -67,7 +67,7 @@ insert_fixup(node_pointer p_nd) if (p_nd->m_p_parent == p_nd->m_p_parent->m_p_parent->m_p_left) { node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_right; - if (p_y != NULL && p_y->m_red) + if (p_y != 0 && p_y->m_red) { p_nd->m_p_parent->m_red = false; p_y->m_red = false; @@ -89,7 +89,7 @@ insert_fixup(node_pointer p_nd) else { node_pointer p_y = p_nd->m_p_parent->m_p_parent->m_p_left; - if (p_y != NULL && p_y->m_red) + if (p_y != 0 && p_y->m_red) { p_nd->m_p_parent->m_red = false; p_y->m_red = false; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp index 9776a8d9a34..96280564dd2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp @@ -67,8 +67,8 @@ void PB_DS_CLASS_C_DEC:: join_imp(node_pointer p_x, node_pointer p_r) { - _GLIBCXX_DEBUG_ASSERT(p_x != NULL); - if (p_r != NULL) + _GLIBCXX_DEBUG_ASSERT(p_x != 0); + if (p_r != 0) p_r->m_red = false; const size_type h = black_height(base_type::m_p_head->m_p_parent); @@ -88,7 +88,7 @@ join_imp(node_pointer p_x, node_pointer p_r) { p_x_l = base_type::m_p_head->m_p_parent; base_type::m_p_head->m_p_parent = p_r; - if (p_r != NULL) + if (p_r != 0) p_r->m_p_parent = base_type::m_p_head; join_pos = find_join_pos_left(base_type::m_p_head->m_p_parent, @@ -112,11 +112,11 @@ join_imp(node_pointer p_x, node_pointer p_r) } p_x->m_p_left = p_x_l; - if (p_x_l != NULL) + if (p_x_l != 0) p_x_l->m_p_parent = p_x; p_x->m_p_right = p_x_r; - if (p_x_r != NULL) + if (p_x_r != 0) p_x_r->m_p_parent = p_x; p_x->m_red = true; @@ -153,8 +153,8 @@ find_join_pos_right(node_pointer p_l, size_type h_l, size_type h_r) { _GLIBCXX_DEBUG_ASSERT(h_l >= h_r); - if (base_type::m_p_head->m_p_parent == NULL) - return (std::make_pair((node_pointer)NULL, base_type::m_p_head)); + if (base_type::m_p_head->m_p_parent == 0) + return (std::make_pair((node_pointer)0, base_type::m_p_head)); node_pointer p_l_parent = base_type::m_p_head; while (h_l > h_r) @@ -177,7 +177,7 @@ find_join_pos_right(node_pointer p_l, size_type h_l, size_type h_r) _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_l)); _GLIBCXX_DEBUG_ASSERT(black_height(p_l) == h_r); - _GLIBCXX_DEBUG_ASSERT(p_l == NULL || p_l->m_p_parent == p_l_parent); + _GLIBCXX_DEBUG_ASSERT(p_l == 0 || p_l->m_p_parent == p_l_parent); return std::make_pair(p_l, p_l_parent); } @@ -189,8 +189,8 @@ PB_DS_CLASS_C_DEC:: find_join_pos_left(node_pointer p_r, size_type h_l, size_type h_r) { _GLIBCXX_DEBUG_ASSERT(h_r > h_l); - if (base_type::m_p_head->m_p_parent == NULL) - return (std::make_pair((node_pointer)NULL, + if (base_type::m_p_head->m_p_parent == 0) + return (std::make_pair((node_pointer)0, base_type::m_p_head)); node_pointer p_r_parent = base_type::m_p_head; while (h_r > h_l) @@ -213,7 +213,7 @@ find_join_pos_left(node_pointer p_r, size_type h_l, size_type h_r) _GLIBCXX_DEBUG_ASSERT(is_effectively_black(p_r)); _GLIBCXX_DEBUG_ASSERT(black_height(p_r) == h_l); - _GLIBCXX_DEBUG_ASSERT(p_r == NULL || p_r->m_p_parent == p_r_parent); + _GLIBCXX_DEBUG_ASSERT(p_r == 0 || p_r->m_p_parent == p_r_parent); return std::make_pair(p_r, p_r_parent); } @@ -223,7 +223,7 @@ PB_DS_CLASS_C_DEC:: black_height(node_pointer p_nd) { size_type h = 1; - while (p_nd != NULL) + while (p_nd != 0) { if (p_nd->m_red == false) ++h; @@ -275,7 +275,7 @@ void PB_DS_CLASS_C_DEC:: split_at_node(node_pointer p_nd, PB_DS_CLASS_C_DEC& other) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); node_pointer p_l = p_nd->m_p_left; node_pointer p_r = p_nd->m_p_right; @@ -283,7 +283,7 @@ split_at_node(node_pointer p_nd, PB_DS_CLASS_C_DEC& other) if (p_parent == base_type::m_p_head) { base_type::m_p_head->m_p_parent = p_l; - if (p_l != NULL) + if (p_l != 0) { p_l->m_p_parent = base_type::m_p_head; p_l->m_red = false; @@ -296,7 +296,7 @@ split_at_node(node_pointer p_nd, PB_DS_CLASS_C_DEC& other) else p_parent->m_p_right = p_l; - if (p_l != NULL) + if (p_l != 0) p_l->m_p_parent = p_parent; update_to_top(p_parent, (node_update* )this); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp index 0194905c4c7..4b8878ee84c 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp @@ -48,7 +48,7 @@ assert_valid() const base_type::assert_valid(false); if (!base_type::empty()) { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_max != NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_max != 0); base_type::assert_max(); } @@ -57,7 +57,7 @@ assert_valid() const if (m_rc.empty()) { base_type::assert_valid(true); - _GLIBCXX_DEBUG_ASSERT(next_2_pointer(base_type::m_p_root) == NULL); + _GLIBCXX_DEBUG_ASSERT(next_2_pointer(base_type::m_p_root) == 0); return; } @@ -65,13 +65,13 @@ assert_valid() const typename rc_t::const_iterator it = m_rc.end(); --it; - while (p_nd != NULL) + while (p_nd != 0) { _GLIBCXX_DEBUG_ASSERT(*it == p_nd); const_node_pointer p_next = p_nd->m_p_next_sibling; - _GLIBCXX_DEBUG_ASSERT(p_next != NULL); + _GLIBCXX_DEBUG_ASSERT(p_next != 0); _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_next->m_metadata); - _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == NULL || + _GLIBCXX_DEBUG_ASSERT(p_next->m_p_next_sibling == 0 || p_next->m_metadata < p_next->m_p_next_sibling->m_metadata); --it; @@ -85,13 +85,13 @@ typename PB_DS_CLASS_C_DEC::const_node_pointer PB_DS_CLASS_C_DEC:: next_2_pointer(const_node_pointer p_nd) { - if (p_nd == NULL) - return NULL; + if (p_nd == 0) + return 0; node_pointer p_next = p_nd->m_p_next_sibling; - if (p_next == NULL) - return NULL; + if (p_next == 0) + return 0; if (p_nd->m_metadata == p_next->m_metadata) return p_nd; @@ -104,13 +104,13 @@ typename PB_DS_CLASS_C_DEC::const_node_pointer PB_DS_CLASS_C_DEC:: next_after_0_pointer(const_node_pointer p_nd) { - if (p_nd == NULL) - return NULL; + if (p_nd == 0) + return 0; node_pointer p_next = p_nd->m_p_next_sibling; - if (p_next == NULL) - return NULL; + if (p_next == 0) + return 0; if (p_nd->m_metadata < p_next->m_metadata) return p_next; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp index 1113ffa6669..1f187a55749 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp @@ -64,10 +64,10 @@ PB_DS_CLASS_C_DEC:: make_binomial_heap() { node_pointer p_nd = base_type::m_p_root; - while (p_nd != NULL) + while (p_nd != 0) { node_pointer p_next = p_nd->m_p_next_sibling; - if (p_next == NULL) + if (p_next == 0) p_nd = p_next; else if (p_nd->m_metadata == p_next->m_metadata) p_nd = link_with_next_sibling(p_nd); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp index aef4b928e16..2a3badccb5b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp @@ -51,20 +51,20 @@ push(const_reference r_val) node_pointer p_nd = base_type::get_new_node_for_insert(r_val); - p_nd->m_p_l_child = p_nd->m_p_prev_or_parent = NULL; + p_nd->m_p_l_child = p_nd->m_p_prev_or_parent = 0; p_nd->m_metadata = 0; - if (base_type::m_p_max == NULL || Cmp_Fn::operator()(base_type::m_p_max->m_value, r_val)) + if (base_type::m_p_max == 0 || Cmp_Fn::operator()(base_type::m_p_max->m_value, r_val)) base_type::m_p_max = p_nd; p_nd->m_p_next_sibling = base_type::m_p_root; - if (base_type::m_p_root != NULL) + if (base_type::m_p_root != 0) base_type::m_p_root->m_p_prev_or_parent = p_nd; base_type::m_p_root = p_nd; - if (p_nd->m_p_next_sibling != NULL&& p_nd->m_p_next_sibling->m_metadata == 0) + if (p_nd->m_p_next_sibling != 0&& p_nd->m_p_next_sibling->m_metadata == 0) m_rc.push(p_nd); _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -95,14 +95,14 @@ link_with_next_sibling(node_pointer p_nd) { node_pointer p_next = p_nd->m_p_next_sibling; - _GLIBCXX_DEBUG_ASSERT(p_next != NULL); + _GLIBCXX_DEBUG_ASSERT(p_next != 0); _GLIBCXX_DEBUG_ASSERT(p_next->m_p_prev_or_parent == p_nd); if (Cmp_Fn::operator()(p_nd->m_value, p_next->m_value)) { p_next->m_p_prev_or_parent = p_nd->m_p_prev_or_parent; - if (p_next->m_p_prev_or_parent == NULL) + if (p_next->m_p_prev_or_parent == 0) base_type::m_p_root = p_next; else p_next->m_p_prev_or_parent->m_p_next_sibling = p_next; @@ -119,7 +119,7 @@ link_with_next_sibling(node_pointer p_nd) p_nd->m_p_next_sibling = p_next->m_p_next_sibling; - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_nd; if (base_type::m_p_max == p_next) @@ -144,11 +144,11 @@ make_0_exposed() m_rc.pop(); - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling != 0); _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata); node_pointer p_res = link_with_next_sibling(p_nd); - if (p_res->m_p_next_sibling != NULL&& p_res->m_metadata == p_res->m_p_next_sibling->m_metadata) + if (p_res->m_p_next_sibling != 0&& p_res->m_metadata == p_res->m_p_next_sibling->m_metadata) m_rc.push(p_res); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp index a28f5ede5e6..c816cfdeac8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -150,7 +150,7 @@ inline PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: get_nearest_smaller_size(size_type n) const { - const size_t* p_lower = std::lower_bound(detail::g_a_sizes, + const std::size_t* p_lower = std::lower_bound(detail::g_a_sizes, detail::g_a_sizes + detail::num_distinct_sizes, n); if (*p_lower >= n && p_lower != detail::g_a_sizes) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp index ed70b951121..33aecdf5fcc 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -47,7 +47,7 @@ class sample_resize_policy public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; // Default constructor. sample_resize_policy(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp index a27dd942702..963c5530a46 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 2008, 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 terms @@ -47,7 +48,7 @@ class sample_resize_trigger public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; // Default constructor. sample_resize_trigger(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp index 1f2d3a9c125..9b3ba031c4b 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -47,7 +47,7 @@ class sample_size_policy public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; // Default constructor. sample_size_policy(); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp index 084e25d26de..f673877aed2 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp @@ -55,7 +55,7 @@ void PB_DS_CLASS_C_DEC:: assert_special_imp(const node_pointer p_nd) const { - if (p_nd == NULL) + if (p_nd == 0) return; if (p_nd == base_type::m_p_head) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp index 508f586d78d..507b8ba407c 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp @@ -108,7 +108,7 @@ void PB_DS_CLASS_C_DEC:: erase_node(node_pointer p_nd) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); splay(p_nd); _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -119,27 +119,27 @@ erase_node(node_pointer p_nd) base_type::update_min_max_for_erased_node(p_nd); base_type::actual_erase_node(p_nd); - if (p_r == NULL) + if (p_r == 0) { base_type::m_p_head->m_p_parent = p_l; - if (p_l != NULL) + if (p_l != 0) p_l->m_p_parent = base_type::m_p_head; _GLIBCXX_DEBUG_ONLY(assert_valid();) return; } node_pointer p_target_r = leftmost(p_r); - _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL); + _GLIBCXX_DEBUG_ASSERT(p_target_r != 0); p_r->m_p_parent = base_type::m_p_head; base_type::m_p_head->m_p_parent = p_r; splay(p_target_r); - _GLIBCXX_DEBUG_ONLY(p_target_r->m_p_left = NULL); + _GLIBCXX_DEBUG_ONLY(p_target_r->m_p_left = 0); _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_parent == this->m_p_head); _GLIBCXX_DEBUG_ASSERT(this->m_p_head->m_p_parent == p_target_r); p_target_r->m_p_left = p_l; - if (p_l != NULL) + if (p_l != 0) p_l->m_p_parent = p_target_r; _GLIBCXX_DEBUG_ONLY(assert_valid();) apply_update(p_target_r, (node_update* )this); @@ -150,8 +150,8 @@ inline typename PB_DS_CLASS_C_DEC::node_pointer PB_DS_CLASS_C_DEC:: leftmost(node_pointer p_nd) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - while (p_nd->m_p_left != NULL) + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + while (p_nd->m_p_left != 0) p_nd = p_nd->m_p_left; return p_nd; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp index 182425a8f30..e27142c17ec 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp @@ -67,7 +67,7 @@ find_imp(const_key_reference r_key) { _GLIBCXX_DEBUG_ONLY(base_type::structure_only_assert_valid();) node_pointer p_nd = base_type::m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key)) { if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value))) @@ -86,7 +86,7 @@ find_imp(const_key_reference r_key) const { _GLIBCXX_DEBUG_ONLY(assert_valid();) node_pointer p_nd = base_type::m_p_head->m_p_parent; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), r_key)) { if (!Cmp_Fn::operator()(r_key, PB_DS_V2F(p_nd->m_value))) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp index e9ae987b09d..8381174d29f 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp @@ -64,7 +64,7 @@ insert_leaf_imp(const_reference r_value) node_pointer p_nd = base_type::m_p_head->m_p_parent; node_pointer p_pot = base_type::m_p_head; - while (p_nd != NULL) + while (p_nd != 0) if (!Cmp_Fn::operator()(PB_DS_V2F(p_nd->m_value), PB_DS_V2F(r_value))) { if (!Cmp_Fn::operator()(PB_DS_V2F(r_value), PB_DS_V2F(p_nd->m_value))) @@ -83,10 +83,10 @@ insert_leaf_imp(const_reference r_value) _GLIBCXX_DEBUG_ONLY(base_type::check_key_does_not_exist(PB_DS_V2F(r_value))); p_nd = p_pot->m_p_left; - if (p_nd == NULL) + if (p_nd == 0) return (std::make_pair(base_type::insert_leaf_new(r_value, p_pot, true), true)); - while (p_nd->m_p_right != NULL) + while (p_nd->m_p_right != 0) p_nd = p_nd->m_p_right; return std::make_pair(insert_leaf_new(r_value, p_nd, false), true); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp index e4f3556a5f0..b6993590acb 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp @@ -114,11 +114,11 @@ splay_zig_zag_left(node_pointer p_nd, node_pointer p_parent, p_grandparent->m_p_parent = p_nd; p_parent->m_p_left = p_b; - if (p_b != NULL) + if (p_b != 0) p_b->m_p_parent = p_parent; p_grandparent->m_p_right = p_c; - if (p_c != NULL) + if (p_c != 0) p_c->m_p_parent = p_grandparent; splay_zz_end(p_nd, p_parent, p_grandparent); @@ -150,11 +150,11 @@ splay_zig_zag_right(node_pointer p_nd, node_pointer p_parent, p_grandparent->m_p_parent = p_nd; p_parent->m_p_right = p_b; - if (p_b != NULL) + if (p_b != 0) p_b->m_p_parent = p_parent; p_grandparent->m_p_left = p_c; - if (p_c != NULL) + if (p_c != 0) p_c->m_p_parent = p_grandparent; splay_zz_end(p_nd, p_parent, p_grandparent); @@ -186,11 +186,11 @@ splay_zig_zig_left(node_pointer p_nd, node_pointer p_parent, p_grandparent->m_p_parent = p_parent; p_parent->m_p_left = p_b; - if (p_b != NULL) + if (p_b != 0) p_b->m_p_parent = p_parent; p_grandparent->m_p_left = p_c; - if (p_c != NULL) + if (p_c != 0) p_c->m_p_parent = p_grandparent; splay_zz_end(p_nd, p_parent, p_grandparent); @@ -220,11 +220,11 @@ splay_zig_zig_right(node_pointer p_nd, node_pointer p_parent, p_grandparent->m_p_parent = p_parent; p_parent->m_p_right = p_b; - if (p_b != NULL) + if (p_b != 0) p_b->m_p_parent = p_parent; p_grandparent->m_p_right = p_c; - if (p_c != NULL) + if (p_c != 0) p_c->m_p_parent = p_grandparent; base_type::update_to_top(p_grandparent, (node_update* )this); @@ -242,9 +242,9 @@ splay_zz_start(node_pointer p_nd, #endif node_pointer p_grandparent) { - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); - _GLIBCXX_DEBUG_ASSERT(p_parent != NULL); - _GLIBCXX_DEBUG_ASSERT(p_grandparent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); + _GLIBCXX_DEBUG_ASSERT(p_parent != 0); + _GLIBCXX_DEBUG_ASSERT(p_grandparent != 0); const bool grandparent_head = p_grandparent->m_p_parent == base_type::m_p_head; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp index 7f0b2cb205d..401f22c0369 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp @@ -53,15 +53,15 @@ join(PB_DS_CLASS_C_DEC& other) } node_pointer p_target_r = other.leftmost(other.m_p_head); - _GLIBCXX_DEBUG_ASSERT(p_target_r != NULL); + _GLIBCXX_DEBUG_ASSERT(p_target_r != 0); other.splay(p_target_r); _GLIBCXX_DEBUG_ASSERT(p_target_r == other.m_p_head->m_p_parent); - _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left == NULL); + _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left == 0); p_target_r->m_p_left = base_type::m_p_head->m_p_parent; - _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left != NULL); + _GLIBCXX_DEBUG_ASSERT(p_target_r->m_p_left != 0); p_target_r->m_p_left->m_p_parent = p_target_r; base_type::m_p_head->m_p_parent = p_target_r; @@ -90,19 +90,19 @@ split(const_key_reference r_key, PB_DS_CLASS_C_DEC& other) } node_pointer p_upper_bound = upper_bound(r_key).m_p_nd; - _GLIBCXX_DEBUG_ASSERT(p_upper_bound != NULL); + _GLIBCXX_DEBUG_ASSERT(p_upper_bound != 0); splay(p_upper_bound); _GLIBCXX_DEBUG_ASSERT(p_upper_bound->m_p_parent == this->m_p_head); node_pointer p_new_root = p_upper_bound->m_p_left; - _GLIBCXX_DEBUG_ASSERT(p_new_root != NULL); + _GLIBCXX_DEBUG_ASSERT(p_new_root != 0); base_type::m_p_head->m_p_parent = p_new_root; p_new_root->m_p_parent = base_type::m_p_head; other.m_p_head->m_p_parent = p_upper_bound; p_upper_bound->m_p_parent = other.m_p_head; - p_upper_bound->m_p_left = NULL; + p_upper_bound->m_p_left = 0; apply_update(p_upper_bound, (node_update* )this); base_type::split_finish(other); diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp index 4d2c45ce047..5a09f7c4020 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp @@ -52,7 +52,7 @@ copy_from_range(It first_it, It last_it) PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: thin_heap_() : - m_p_max(NULL) + m_p_max(0) { initialize(); _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -62,7 +62,7 @@ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: thin_heap_(const Cmp_Fn& r_cmp_fn) : PB_DS_BASE_C_DEC(r_cmp_fn), - m_p_max(NULL) + m_p_max(0) { initialize(); _GLIBCXX_DEBUG_ONLY(assert_valid();) @@ -75,7 +75,7 @@ thin_heap_(const PB_DS_CLASS_C_DEC& other) : { initialize(); m_p_max = base_type::m_p_root; - for (node_pointer p_nd = base_type::m_p_root; p_nd != NULL; p_nd = p_nd->m_p_next_sibling) + for (node_pointer p_nd = base_type::m_p_root; p_nd != 0; p_nd = p_nd->m_p_next_sibling) if (Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value)) m_p_max = p_nd; @@ -102,5 +102,5 @@ PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: initialize() -{ std::fill(m_a_aux, m_a_aux + max_rank, static_cast<node_pointer>(NULL)); } +{ std::fill(m_a_aux, m_a_aux + max_rank, static_cast<node_pointer>(0)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp index f7abe35279c..0aedadb9f84 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp @@ -57,7 +57,7 @@ PB_DS_CLASS_C_DEC:: assert_aux_null() const { for (size_type i = 0; i < max_rank; ++i) - _GLIBCXX_DEBUG_ASSERT(m_a_aux[i] == NULL); + _GLIBCXX_DEBUG_ASSERT(m_a_aux[i] == 0); } PB_DS_CLASS_T_DEC @@ -65,15 +65,15 @@ void PB_DS_CLASS_C_DEC:: assert_max() const { - if (m_p_max == NULL) + if (m_p_max == 0) { _GLIBCXX_DEBUG_ASSERT(base_type::empty()); return; } _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); - _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == NULL); - _GLIBCXX_DEBUG_ASSERT(m_p_max->m_p_prev_or_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::parent(m_p_max) == 0); + _GLIBCXX_DEBUG_ASSERT(m_p_max->m_p_prev_or_parent == 0); for (const_iterator it = base_type::begin(); it != base_type::end(); ++it) _GLIBCXX_DEBUG_ASSERT(!Cmp_Fn::operator()(m_p_max->m_value, it.m_p_nd->m_value)); } @@ -84,7 +84,7 @@ PB_DS_CLASS_C_DEC:: assert_node_consistent(const_node_pointer p_nd, bool root) const { base_type::assert_node_consistent(p_nd, root); - if (p_nd == NULL) + if (p_nd == 0) return; assert_node_consistent(p_nd->m_p_next_sibling, root); @@ -92,17 +92,17 @@ assert_node_consistent(const_node_pointer p_nd, bool root) const if (!root) { if (p_nd->m_metadata == 0) - _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_next_sibling == 0); else _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata == p_nd->m_p_next_sibling->m_metadata + 1); } - if (p_nd->m_p_l_child != NULL) + if (p_nd->m_p_l_child != 0) _GLIBCXX_DEBUG_ASSERT(p_nd->m_p_l_child->m_metadata + 1 == base_type::degree(p_nd)); - const bool unmarked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 0) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 1); + const bool unmarked_valid =(p_nd->m_p_l_child == 0&& p_nd->m_metadata == 0) ||(p_nd->m_p_l_child != 0&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 1); - const bool marked_valid =(p_nd->m_p_l_child == NULL&& p_nd->m_metadata == 1) ||(p_nd->m_p_l_child != NULL&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 2); + const bool marked_valid =(p_nd->m_p_l_child == 0&& p_nd->m_metadata == 1) ||(p_nd->m_p_l_child != 0&& p_nd->m_metadata == p_nd->m_p_l_child->m_metadata + 2); _GLIBCXX_DEBUG_ASSERT(unmarked_valid || marked_valid); if (root) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp index 69afcd39f15..6f1b20b441a 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp @@ -46,7 +46,7 @@ pop() _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); - _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_max != 0); node_pointer p_nd = m_p_max; @@ -85,11 +85,11 @@ to_aux_except_max() p_add = m_p_max->m_p_l_child; - while (p_add != NULL) + while (p_add != 0) { node_pointer p_next_add = p_add->m_p_next_sibling; - p_add->m_metadata = p_add->m_p_l_child == NULL? + p_add->m_metadata = p_add->m_p_l_child == 0? 0 : p_add->m_p_l_child->m_metadata + 1; @@ -100,7 +100,7 @@ to_aux_except_max() p_add = m_p_max->m_p_next_sibling; - while (p_add != NULL) + while (p_add != 0) { node_pointer p_next_add = p_add->m_p_next_sibling; @@ -117,7 +117,7 @@ add_to_aux(node_pointer p_nd) { size_type r = p_nd->m_metadata; - while (m_a_aux[r] != NULL) + while (m_a_aux[r] != 0) { _GLIBCXX_DEBUG_ASSERT(p_nd->m_metadata < rank_bound()); @@ -130,7 +130,7 @@ add_to_aux(node_pointer p_nd) p_nd = m_a_aux[r]; } - m_a_aux[r] = NULL; + m_a_aux[r] = 0; ++r; } @@ -159,7 +159,7 @@ inline void PB_DS_CLASS_C_DEC:: make_from_aux() { - base_type::m_p_root = m_p_max = NULL; + base_type::m_p_root = m_p_max = 0; const size_type rnk_bnd = rank_bound(); @@ -167,11 +167,11 @@ make_from_aux() while (i < rnk_bnd) { - if (m_a_aux[i] != NULL) + if (m_a_aux[i] != 0) { make_root_and_link(m_a_aux[i]); - m_a_aux[i] = NULL; + m_a_aux[i] = 0; } ++i; @@ -186,7 +186,7 @@ PB_DS_CLASS_C_DEC:: remove_node(node_pointer p_nd) { node_pointer p_parent = p_nd; - while (base_type::parent(p_parent) != NULL) + while (base_type::parent(p_parent) != 0) p_parent = base_type::parent(p_parent); base_type::bubble_to_top(p_nd); @@ -194,10 +194,10 @@ remove_node(node_pointer p_nd) m_p_max = p_nd; node_pointer p_fix = base_type::m_p_root; - while (p_fix != NULL&& p_fix->m_p_next_sibling != p_parent) + while (p_fix != 0&& p_fix->m_p_next_sibling != p_parent) p_fix = p_fix->m_p_next_sibling; - if (p_fix != NULL) + if (p_fix != 0) p_fix->m_p_next_sibling = p_nd; remove_max_node(); @@ -210,7 +210,7 @@ clear() { base_type::clear(); - m_p_max = NULL; + m_p_max = 0; } PB_DS_CLASS_T_DEC @@ -251,7 +251,7 @@ erase_if(Pred pred) size_type ersd = 0; - while (p_out != NULL) + while (p_out != 0) { ++ersd; @@ -264,9 +264,9 @@ erase_if(Pred pred) node_pointer p_cur = base_type::m_p_root; - m_p_max = base_type::m_p_root = NULL; + m_p_max = base_type::m_p_root = 0; - while (p_cur != NULL) + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp index 52407e6d0ae..700486a60d7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp @@ -46,6 +46,6 @@ top() const _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ASSERT(!base_type::empty()); - _GLIBCXX_DEBUG_ASSERT(m_p_max != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_max != 0); return m_p_max->m_value; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp index 7a6952fdad4..4e8a1c2d8cc 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp @@ -49,11 +49,11 @@ push(const_reference r_val) p_nd->m_metadata = 0; - p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = NULL; + p_nd->m_p_prev_or_parent = p_nd->m_p_l_child = 0; - if (base_type::m_p_root == NULL) + if (base_type::m_p_root == 0) { - p_nd->m_p_next_sibling = NULL; + p_nd->m_p_next_sibling = 0; m_p_max = base_type::m_p_root = p_nd; @@ -64,7 +64,7 @@ push(const_reference r_val) p_nd->m_p_next_sibling = base_type::m_p_root; - base_type::m_p_root->m_p_prev_or_parent = NULL; + base_type::m_p_root->m_p_prev_or_parent = 0; base_type::m_p_root = p_nd; @@ -81,7 +81,7 @@ PB_DS_CLASS_C_DEC:: make_root(node_pointer p_nd) { p_nd->m_metadata = - p_nd->m_p_l_child == NULL? + p_nd->m_p_l_child == 0? 0 : 1 + p_nd->m_p_l_child->m_metadata; } @@ -93,12 +93,12 @@ make_root_and_link(node_pointer p_nd) { make_root(p_nd); - p_nd->m_p_prev_or_parent = NULL; + p_nd->m_p_prev_or_parent = 0; p_nd->m_p_next_sibling = base_type::m_p_root; - if (base_type::m_p_root != NULL) - base_type::m_p_root->m_p_prev_or_parent = NULL; + if (base_type::m_p_root != 0) + base_type::m_p_root->m_p_prev_or_parent = 0; base_type::m_p_root = p_nd; @@ -112,15 +112,15 @@ fix(node_pointer p_y) { while (true) { - if (p_y->m_p_prev_or_parent == NULL) + if (p_y->m_p_prev_or_parent == 0) { fix_root(p_y); return; } - else if (p_y->m_metadata == 1&& p_y->m_p_next_sibling == NULL) + else if (p_y->m_metadata == 1&& p_y->m_p_next_sibling == 0) { - if (p_y->m_p_l_child != NULL) + if (p_y->m_p_l_child != 0) { fix_sibling_rank_1_unmarked(p_y); @@ -133,7 +133,7 @@ fix(node_pointer p_y) } else if (p_y->m_metadata > p_y->m_p_next_sibling->m_metadata + 1) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child != 0); if (p_y->m_metadata != p_y->m_p_l_child->m_metadata + 2) { @@ -146,8 +146,8 @@ fix(node_pointer p_y) p_y = p_y->m_p_prev_or_parent; } - else if ((p_y->m_p_l_child == NULL&& - p_y->m_metadata == 2) ||(p_y->m_p_l_child != NULL&& + else if ((p_y->m_p_l_child == 0&& + p_y->m_metadata == 2) ||(p_y->m_p_l_child != 0&& p_y->m_metadata == p_y->m_p_l_child->m_metadata + 3)) { node_pointer p_z = p_y->m_p_prev_or_parent; @@ -166,7 +166,7 @@ inline void PB_DS_CLASS_C_DEC:: fix_root(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent == NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent == 0); make_root(p_y); @@ -178,18 +178,18 @@ inline void PB_DS_CLASS_C_DEC:: fix_sibling_rank_1_unmarked(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != 0); _GLIBCXX_DEBUG_ONLY(node_pointer p_w = p_y->m_p_l_child;) - _GLIBCXX_DEBUG_ASSERT(p_w != NULL); - _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling == NULL); - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_next_sibling == NULL); + _GLIBCXX_DEBUG_ASSERT(p_w != 0); + _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling == 0); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_next_sibling == 0); p_y->m_p_next_sibling = p_y->m_p_l_child; p_y->m_p_next_sibling->m_p_prev_or_parent = p_y; - p_y->m_p_l_child = NULL; + p_y->m_p_l_child = 0; _GLIBCXX_DEBUG_ONLY(assert_node_consistent(p_y, false);) } @@ -199,8 +199,8 @@ inline void PB_DS_CLASS_C_DEC:: fix_sibling_rank_1_marked(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL); - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child == NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != 0); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_l_child == 0); p_y->m_metadata = 0; @@ -212,17 +212,17 @@ inline void PB_DS_CLASS_C_DEC:: fix_sibling_general_unmarked(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != 0); node_pointer p_w = p_y->m_p_l_child; - _GLIBCXX_DEBUG_ASSERT(p_w != NULL); - _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL); + _GLIBCXX_DEBUG_ASSERT(p_w != 0); + _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != 0); p_y->m_p_l_child = p_w->m_p_next_sibling; p_w->m_p_next_sibling->m_p_prev_or_parent = p_y; p_w->m_p_next_sibling = p_y->m_p_next_sibling; - _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != NULL); + _GLIBCXX_DEBUG_ASSERT(p_w->m_p_next_sibling != 0); p_w->m_p_next_sibling->m_p_prev_or_parent = p_w; p_y->m_p_next_sibling = p_w; @@ -236,7 +236,7 @@ inline void PB_DS_CLASS_C_DEC:: fix_sibling_general_marked(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != 0); --p_y->m_metadata; @@ -248,9 +248,9 @@ inline void PB_DS_CLASS_C_DEC:: fix_child(node_pointer p_y) { - _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y->m_p_prev_or_parent != 0); - if (p_y->m_p_next_sibling != NULL) + if (p_y->m_p_next_sibling != 0) p_y->m_p_next_sibling->m_p_prev_or_parent = p_y->m_p_prev_or_parent; if (p_y->m_p_prev_or_parent->m_p_l_child == p_y) @@ -269,7 +269,7 @@ modify(point_iterator it, const_reference r_new_val) _GLIBCXX_DEBUG_ONLY(assert_valid();) node_pointer p_nd = it.m_p_nd; - _GLIBCXX_DEBUG_ASSERT(p_nd != NULL); + _GLIBCXX_DEBUG_ASSERT(p_nd != 0); const bool smaller = Cmp_Fn::operator()(r_new_val, p_nd->m_value); @@ -279,7 +279,7 @@ modify(point_iterator it, const_reference r_new_val) { remove_node(p_nd); - p_nd->m_p_l_child = NULL; + p_nd->m_p_l_child = 0; make_root_and_link(p_nd); @@ -288,7 +288,7 @@ modify(point_iterator it, const_reference r_new_val) return; } - if (p_nd->m_p_prev_or_parent == NULL) + if (p_nd->m_p_prev_or_parent == 0) { update_max(p_nd); @@ -298,9 +298,9 @@ modify(point_iterator it, const_reference r_new_val) } node_pointer p_y = p_nd->m_p_prev_or_parent; - _GLIBCXX_DEBUG_ASSERT(p_y != NULL); + _GLIBCXX_DEBUG_ASSERT(p_y != 0); - if (p_nd->m_p_next_sibling != NULL) + if (p_nd->m_p_next_sibling != 0) p_nd->m_p_next_sibling->m_p_prev_or_parent = p_y; if (p_y->m_p_l_child == p_nd) @@ -320,7 +320,7 @@ inline void PB_DS_CLASS_C_DEC:: update_max(node_pointer p_nd) { - if (m_p_max == NULL || Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value)) + if (m_p_max == 0 || Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value)) m_p_max = p_nd; } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp index 6acb7bd7571..85ebe4cb400 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp @@ -61,7 +61,7 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_out = base_type::prune(pred); - while (p_out != NULL) + while (p_out != 0) { _GLIBCXX_DEBUG_ASSERT(base_type::m_size > 0); --base_type::m_size; @@ -79,11 +79,11 @@ split(Pred pred, PB_DS_CLASS_C_DEC& other) node_pointer p_cur = base_type::m_p_root; - m_p_max = NULL; + m_p_max = 0; - base_type::m_p_root = NULL; + base_type::m_p_root = 0; - while (p_cur != NULL) + while (p_cur != 0) { node_pointer p_next = p_cur->m_p_next_sibling; @@ -106,7 +106,7 @@ join(PB_DS_CLASS_C_DEC& other) node_pointer p_other = other.m_p_root; - while (p_other != NULL) + while (p_other != 0) { node_pointer p_next = p_other->m_p_next_sibling; @@ -117,9 +117,9 @@ join(PB_DS_CLASS_C_DEC& other) base_type::m_size += other.m_size; - other.m_p_root = NULL; + other.m_p_root = 0; other.m_size = 0; - other.m_p_max = NULL; + other.m_p_max = 0; _GLIBCXX_DEBUG_ONLY(assert_valid();) _GLIBCXX_DEBUG_ONLY(other.assert_valid();) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp b/libstdc++-v3/include/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp index 6ea68995e53..b8c19a587f8 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -56,7 +56,7 @@ class sample_tree_node_update public: // Metadata type. - typedef size_t metadata_type; + typedef std::size_t metadata_type; protected: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp index 4e27ac21e62..cb8e2474121 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -50,8 +50,6 @@ find_by_order(size_type order) node_iterator nd_it = node_begin(); - node_iterator end_nd_it = node_end(); - while (true) { if (order > nd_it.get_metadata()) diff --git a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp index 34fbe0cc3e2..2ecad89c9a7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -48,7 +48,7 @@ class sample_trie_e_access_traits public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; // Key type. typedef std::string key_type; diff --git a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp index 55fd99787fb..8b2c6b591f7 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -56,7 +56,7 @@ class sample_trie_node_update public: // Metadata type. - typedef size_t metadata_type; + typedef std::size_t metadata_type; protected: diff --git a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp index 38d4eb1cfbc..71e26261794 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp @@ -74,7 +74,7 @@ public: inline const_iterator_() - : m_p_tbl(NULL) + : m_p_tbl(0) { } // Increments. diff --git a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp index bc0b2ad624a..5574b28e1e1 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp @@ -78,7 +78,7 @@ public: inline const_point_iterator_() - : m_p_value(NULL) + : m_p_value(0) { } // Copy constructor. @@ -99,7 +99,7 @@ public: inline const_pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_value != 0); return (m_p_value); } @@ -108,7 +108,7 @@ public: inline const_reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_value != 0); return (*m_p_value); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/iterator.hpp index 3e21aba8bad..2836c17bea5 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/iterator.hpp @@ -74,7 +74,7 @@ public: inline iterator_() - : const_iterator_(NULL, PB_DS_GEN_POS(), NULL) + : const_iterator_(0, PB_DS_GEN_POS(), 0) { } // Conversion to a point-type iterator. @@ -97,7 +97,7 @@ public: inline pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != 0); return (const_cast<pointer>(base_type::m_p_value)); } @@ -106,7 +106,7 @@ public: inline reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(base_type::m_p_value != 0); return (const_cast<reference>(*base_type::m_p_value)); } diff --git a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp index 37ce90069cf..c009106e0dd 100644 --- a/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp +++ b/libstdc++-v3/include/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp @@ -72,7 +72,7 @@ public: inline point_iterator_() - : m_p_value(NULL) + : m_p_value(0) { } // Copy constructor. @@ -86,7 +86,7 @@ public: inline pointer operator->() const { - _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_value != 0); return (m_p_value); } @@ -95,7 +95,7 @@ public: inline reference operator*() const { - _GLIBCXX_DEBUG_ASSERT(m_p_value != NULL); + _GLIBCXX_DEBUG_ASSERT(m_p_value != 0); return (*m_p_value); } diff --git a/libstdc++-v3/include/ext/pb_ds/exception.hpp b/libstdc++-v3/include/ext/pb_ds/exception.hpp index 4f796b1ef33..b34e3ed26f2 100644 --- a/libstdc++-v3/include/ext/pb_ds/exception.hpp +++ b/libstdc++-v3/include/ext/pb_ds/exception.hpp @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 2008, 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 terms @@ -41,6 +42,7 @@ #ifndef PB_DS_EXCEPTION_HPP #define PB_DS_EXCEPTION_HPP +#include <bits/c++config.h> #include <stdexcept> #include <cstdlib> diff --git a/libstdc++-v3/include/ext/pb_ds/hash_policy.hpp b/libstdc++-v3/include/ext/pb_ds/hash_policy.hpp index 24c0c4562cc..f3bc86e9731 100644 --- a/libstdc++-v3/include/ext/pb_ds/hash_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/hash_policy.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -41,6 +41,7 @@ #ifndef PB_DS_HASH_POLICY_HPP #define PB_DS_HASH_POLICY_HPP +#include <bits/c++config.h> #include <algorithm> #include <vector> #include <cmath> @@ -66,7 +67,7 @@ namespace __gnu_pbds #define PB_DS_CLASS_C_DEC linear_probe_fn<Size_Type> // A probe sequence policy using fixed increments. - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class linear_probe_fn { public: @@ -90,7 +91,7 @@ namespace __gnu_pbds #define PB_DS_CLASS_C_DEC quadratic_probe_fn<Size_Type> // A probe sequence policy using square increments. - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class quadratic_probe_fn { public: @@ -114,7 +115,7 @@ namespace __gnu_pbds #define PB_DS_CLASS_C_DEC direct_mask_range_hashing<Size_Type> // A mask range-hashing class (uses a bit-mask). - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class direct_mask_range_hashing : public detail::mask_based_range_hashing<Size_Type> { @@ -146,7 +147,7 @@ namespace __gnu_pbds #define PB_DS_CLASS_C_DEC direct_mod_range_hashing<Size_Type> // A mod range-hashing class (uses the modulo function). - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class direct_mod_range_hashing : public detail::mod_based_range_hashing<Size_Type> { @@ -180,7 +181,7 @@ namespace __gnu_pbds // A resize trigger policy based on a load check. It keeps the // load factor between some load factors load_min and load_max. - template<bool External_Load_Access = false, typename Size_Type = size_t> + template<bool External_Load_Access = false, typename Size_Type = std::size_t> class hash_load_check_resize_trigger : private PB_DS_SIZE_BASE_C_DEC { public: @@ -295,7 +296,7 @@ namespace __gnu_pbds // A resize trigger policy based on collision checks. It keeps the // simulated load factor lower than some given load factor. - template<bool External_Load_Access = false, typename Size_Type = size_t> + template<bool External_Load_Access = false, typename Size_Type = std::size_t> class cc_hash_max_collision_check_resize_trigger { public: @@ -396,7 +397,7 @@ namespace __gnu_pbds // A size policy whose sequence of sizes form an exponential // sequence (typically powers of 2. - template<typename Size_Type = size_t> + template<typename Size_Type = std::size_t> class hash_exponential_size_policy { public: @@ -438,7 +439,7 @@ namespace __gnu_pbds { public: // Size type. - typedef size_t size_type; + typedef std::size_t size_type; // Default constructor, or onstructor taking a start_size The // policy will use the sequence of sizes approximately @@ -472,7 +473,7 @@ namespace __gnu_pbds template<typename Size_Policy = hash_exponential_size_policy<>, typename Trigger_Policy = hash_load_check_resize_trigger<>, bool External_Size_Access = false, - typename Size_Type = size_t> + typename Size_Type = std::size_t> class hash_standard_resize_policy : public Size_Policy, public Trigger_Policy { diff --git a/libstdc++-v3/include/ext/pb_ds/list_update_policy.hpp b/libstdc++-v3/include/ext/pb_ds/list_update_policy.hpp index ec05b69c7e6..54a67c6e563 100644 --- a/libstdc++-v3/include/ext/pb_ds/list_update_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/list_update_policy.hpp @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 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 terms @@ -41,6 +42,7 @@ #ifndef PB_DS_LU_POLICY_HPP #define PB_DS_LU_POLICY_HPP +#include <bits/c++config.h> #include <cstdlib> #include <ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp> @@ -87,12 +89,13 @@ namespace __gnu_pbds #undef PB_DS_CLASS_T_DEC #undef PB_DS_CLASS_C_DEC -#define PB_DS_CLASS_T_DEC template<size_t Max_Count, class Allocator> +#define PB_DS_CLASS_T_DEC template<std::size_t Max_Count, class Allocator> #define PB_DS_CLASS_C_DEC counter_lu_policy<Max_Count, Allocator> // A list-update policy that moves elements to the front of the list // based on the counter algorithm. - template<size_t Max_Count = 5, typename Allocator = std::allocator<char> > + template<std::size_t Max_Count = 5, + typename Allocator = std::allocator<char> > class counter_lu_policy : private detail::counter_lu_policy_base<typename Allocator::size_type> { diff --git a/libstdc++-v3/include/ext/pb_ds/priority_queue.hpp b/libstdc++-v3/include/ext/pb_ds/priority_queue.hpp index 531f70c65ce..b6088e7d73a 100644 --- a/libstdc++-v3/include/ext/pb_ds/priority_queue.hpp +++ b/libstdc++-v3/include/ext/pb_ds/priority_queue.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -41,6 +41,7 @@ #ifndef PB_DS_PRIORITY_QUEUE_HPP #define PB_DS_PRIORITY_QUEUE_HPP +#include <bits/c++config.h> #include <ext/pb_ds/tag_and_trait.hpp> #include <ext/pb_ds/detail/priority_queue_base_dispatch.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> @@ -53,10 +54,13 @@ namespace __gnu_pbds typename Tag = pairing_heap_tag, typename Allocator = std::allocator<char> > class priority_queue - : public detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type + : public detail::priority_queue_base_dispatch<Value_Type, + Cmp_Fn,Tag,Allocator>::type { private: - typedef typename detail::priority_queue_base_dispatch<Value_Type,Cmp_Fn,Tag,Allocator>::type base_type; + typedef typename + detail::priority_queue_base_dispatch<Value_Type, Cmp_Fn, + Tag, Allocator>::type base_type; public: typedef Value_Type value_type; diff --git a/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp b/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp index ccd2533cc4f..ef445336137 100644 --- a/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp +++ b/libstdc++-v3/include/ext/pb_ds/tag_and_trait.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2008, 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 terms @@ -42,6 +42,7 @@ #ifndef PB_DS_TAG_AND_TRAIT_HPP #define PB_DS_TAG_AND_TRAIT_HPP +#include <bits/c++config.h> #include <ext/pb_ds/detail/type_utils.hpp> /** diff --git a/libstdc++-v3/include/ext/pb_ds/tree_policy.hpp b/libstdc++-v3/include/ext/pb_ds/tree_policy.hpp index 990860ec020..4af1adbde70 100644 --- a/libstdc++-v3/include/ext/pb_ds/tree_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/tree_policy.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 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 terms @@ -41,6 +41,7 @@ #ifndef PB_DS_TREE_POLICY_HPP #define PB_DS_TREE_POLICY_HPP +#include <bits/c++config.h> #include <iterator> #include <ext/pb_ds/detail/type_utils.hpp> #include <ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp> diff --git a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp index c10591bb7f3..fc452104f75 100644 --- a/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp +++ b/libstdc++-v3/include/ext/pb_ds/trie_policy.hpp @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 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 terms @@ -41,6 +41,7 @@ #ifndef PB_DS_TRIE_POLICY_HPP #define PB_DS_TRIE_POLICY_HPP +#include <bits/c++config.h> #include <string> #include <ext/pb_ds/detail/type_utils.hpp> #include <ext/pb_ds/detail/trie_policy/trie_policy_base.hpp> diff --git a/libstdc++-v3/include/ext/pointer.h b/libstdc++-v3/include/ext/pointer.h index ddb5f3c84a8..8055df226f2 100644 --- a/libstdc++-v3/include/ext/pointer.h +++ b/libstdc++-v3/include/ext/pointer.h @@ -1,6 +1,6 @@ // Custom pointer adapter and sample storage policies -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 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 @@ -447,7 +447,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) } inline _Pointer_adapter - operator++(int __unused) + operator++(int) { _Pointer_adapter tmp(*this); _Storage_policy::set(_Storage_policy::get() + 1); diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index a18b274fa88..dd18738dc57 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -554,7 +554,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // NB: Not required, but considered best practice. if (__is_null_pointer(__beg) && __beg != __end) std::__throw_logic_error(__N("__rc_string_base::" - "_S_construct NULL not valid")); + "_S_construct null not valid")); const size_type __dnew = static_cast<size_type>(std::distance(__beg, __end)); diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h index b0500cf17e0..43d44528999 100644 --- a/libstdc++-v3/include/ext/sso_string_base.h +++ b/libstdc++-v3/include/ext/sso_string_base.h @@ -434,7 +434,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // NB: Not required, but considered best practice. if (__is_null_pointer(__beg) && __beg != __end) std::__throw_logic_error(__N("__sso_string_base::" - "_M_construct NULL not valid")); + "_M_construct null not valid")); size_type __dnew = static_cast<size_type>(std::distance(__beg, __end)); diff --git a/libstdc++-v3/include/ext/string_conversions.h b/libstdc++-v3/include/ext/string_conversions.h index 36c19e0a97a..a4276f30ba2 100644 --- a/libstdc++-v3/include/ext/string_conversions.h +++ b/libstdc++-v3/include/ext/string_conversions.h @@ -1,6 +1,6 @@ // String Conversions -*- C++ -*- -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 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 @@ -27,9 +27,9 @@ #pragma GCC system_header +#include <bits/c++config.h> #include <ext/numeric_traits.h> #include <bits/functexcept.h> -#include <cstddef> #include <cstdlib> #include <cwchar> #include <cstdio> diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index 70b197a705d..669d433e272 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -110,7 +110,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) void insert(void* p, size_t size) { - if (p == NULL) + if (!p) { std::string error("annotate_base::insert null insert!\n"); log_to_string(error, make_entry(p, size)); |