From 05b57d5cdf8acb3933b5f6f22cc81f9dee7408d2 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 7 Mar 2012 20:37:43 +0000 Subject: [PATCH] Change some smart_ptr == 0 to smart_ptr == nullptr. Fixes http://llvm.org/bugs/show_bug.cgi?id=12185. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@152240 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/locale | 2 +- src/locale.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/locale b/include/locale index 2bdae30b..f6d38607 100644 --- a/include/locale +++ b/include/locale @@ -3561,7 +3561,7 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl, __throw_bad_alloc(); __hn.reset(__bb); __hd.reset((char_type*)malloc(__n * sizeof(char_type))); - if (__hd == 0) + if (__hd == nullptr) __throw_bad_alloc(); __db = __hd.get(); } diff --git a/src/locale.cpp b/src/locale.cpp index 109629d6..5c4215aa 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -4084,7 +4084,7 @@ numpunct_byname::__init(const char* nm) { __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("numpunct_byname::numpunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS @@ -4127,7 +4127,7 @@ numpunct_byname::__init(const char* nm) { __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("numpunct_byname::numpunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS @@ -5518,7 +5518,7 @@ moneypunct_byname::init(const char* nm) typedef moneypunct base; __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("moneypunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS @@ -5560,7 +5560,7 @@ moneypunct_byname::init(const char* nm) typedef moneypunct base; __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("moneypunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS @@ -5615,7 +5615,7 @@ moneypunct_byname::init(const char* nm) typedef moneypunct base; __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("moneypunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS @@ -5692,7 +5692,7 @@ moneypunct_byname::init(const char* nm) typedef moneypunct base; __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale); #ifndef _LIBCPP_NO_EXCEPTIONS - if (loc == 0) + if (loc == nullptr) throw runtime_error("moneypunct_byname" " failed to construct for " + string(nm)); #endif // _LIBCPP_NO_EXCEPTIONS