[cfe-commits] [libcxx] r152240 - in /libcxx/trunk: include/locale src/locale.cpp

Howard Hinnant hhinnant at apple.com
Wed Mar 7 12:37:44 PST 2012


Author: hhinnant
Date: Wed Mar  7 14:37:43 2012
New Revision: 152240

URL: http://llvm.org/viewvc/llvm-project?rev=152240&view=rev
Log:
Change some smart_ptr == 0 to smart_ptr == nullptr.  Fixes http://llvm.org/bugs/show_bug.cgi?id=12185.

Modified:
    libcxx/trunk/include/locale
    libcxx/trunk/src/locale.cpp

Modified: libcxx/trunk/include/locale
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/locale?rev=152240&r1=152239&r2=152240&view=diff
==============================================================================
--- libcxx/trunk/include/locale (original)
+++ libcxx/trunk/include/locale Wed Mar  7 14:37:43 2012
@@ -3561,7 +3561,7 @@
             __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();
     }

Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=152240&r1=152239&r2=152240&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Wed Mar  7 14:37:43 2012
@@ -4084,7 +4084,7 @@
     {
         __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<char>::numpunct_byname"
                                 " failed to construct for " + string(nm));
 #endif  // _LIBCPP_NO_EXCEPTIONS
@@ -4127,7 +4127,7 @@
     {
         __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<char>::numpunct_byname"
                                 " failed to construct for " + string(nm));
 #endif  // _LIBCPP_NO_EXCEPTIONS
@@ -5518,7 +5518,7 @@
     typedef moneypunct<char, false> 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 @@
     typedef moneypunct<char, true> 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 @@
     typedef moneypunct<wchar_t, false> 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 @@
     typedef moneypunct<wchar_t, true> 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





More information about the cfe-commits mailing list