[cfe-commits] [libcxx] r171165 - in /libcxx/trunk/src: debug.cpp locale.cpp

Howard Hinnant hhinnant at apple.com
Thu Dec 27 10:46:00 PST 2012


Author: hhinnant
Date: Thu Dec 27 12:46:00 2012
New Revision: 171165

URL: http://llvm.org/viewvc/llvm-project?rev=171165&view=rev
Log:
Saleem Abdulrasool:  This just rounds up a few compile warnings emitted by GCC (4.7.2).

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

Modified: libcxx/trunk/src/debug.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/debug.cpp?rev=171165&r1=171164&r2=171165&view=diff
==============================================================================
--- libcxx/trunk/src/debug.cpp (original)
+++ libcxx/trunk/src/debug.cpp Thu Dec 27 12:46:00 2012
@@ -23,7 +23,7 @@
 {
     static __libcpp_db db;
     return &db;
-};
+}
 
 _LIBCPP_VISIBLE
 const __libcpp_db*

Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=171165&r1=171164&r2=171165&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Thu Dec 27 12:46:00 2012
@@ -865,7 +865,7 @@
     return isascii(c) ?
       static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c;
 #elif defined(__GLIBC__)
-    return isascii(c) ? __classic_upper_table()[c] : c;
+    return isascii(c) ? __classic_upper_table()[static_cast<size_t>(c)] : c;
 #else
     return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
 #endif
@@ -879,7 +879,7 @@
         *low = isascii(*low) ?
           static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low;
 #elif defined(__GLIBC__)
-        *low = isascii(*low) ? __classic_upper_table()[*low] : *low;
+        *low = isascii(*low) ? __classic_upper_table()[static_cast<size_t>(*low)] : *low;
 #else
         *low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
 #endif
@@ -893,7 +893,7 @@
     return isascii(c) ?
       static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c;
 #elif defined(__GLIBC__)
-    return isascii(c) ? __classic_lower_table()[c] : c;
+    return isascii(c) ? __classic_lower_table()[static_cast<size_t>(c)] : c;
 #else
     return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
 #endif
@@ -906,7 +906,7 @@
 #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
         *low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
 #elif defined(__GLIBC__)
-        *low = isascii(*low) ? __classic_lower_table()[*low] : *low;
+        *low = isascii(*low) ? __classic_lower_table()[static_cast<size_t>(*low)] : *low;
 #else
         *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
 #endif
@@ -1229,7 +1229,7 @@
 #else
     int r = __wctob_l(c, __l);
 #endif
-    return r != WEOF ? static_cast<char>(r) : dfault;
+    return r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
 }
 
 const wchar_t*
@@ -1242,7 +1242,7 @@
 #else
         int r = __wctob_l(*low, __l);
 #endif
-        *dest = r != WEOF ? static_cast<char>(r) : dfault;
+        *dest = r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
     }
     return low;
 }
@@ -4922,7 +4922,6 @@
 {
     tm t = {0};
     char buf[100];
-    size_t be;
     wchar_t wbuf[100];
     wchar_t* wbe;
     mbstate_t mb = {0};
@@ -4930,7 +4929,7 @@
     for (int i = 0; i < 7; ++i)
     {
         t.tm_wday = i;
-        be = strftime_l(buf, 100, "%A", &t, __loc_);
+        strftime_l(buf, 100, "%A", &t, __loc_);
         mb = mbstate_t();
         const char* bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@@ -4942,7 +4941,7 @@
             __throw_runtime_error("locale not supported");
         wbe = wbuf + j;
         __weeks_[i].assign(wbuf, wbe);
-        be = strftime_l(buf, 100, "%a", &t, __loc_);
+        strftime_l(buf, 100, "%a", &t, __loc_);
         mb = mbstate_t();
         bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@@ -4959,7 +4958,7 @@
     for (int i = 0; i < 12; ++i)
     {
         t.tm_mon = i;
-        be = strftime_l(buf, 100, "%B", &t, __loc_);
+        strftime_l(buf, 100, "%B", &t, __loc_);
         mb = mbstate_t();
         const char* bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@@ -4971,7 +4970,7 @@
             __throw_runtime_error("locale not supported");
         wbe = wbuf + j;
         __months_[i].assign(wbuf, wbe);
-        be = strftime_l(buf, 100, "%b", &t, __loc_);
+        strftime_l(buf, 100, "%b", &t, __loc_);
         mb = mbstate_t();
         bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@@ -4986,7 +4985,7 @@
     }
     // __am_pm_
     t.tm_hour = 1;
-    be = strftime_l(buf, 100, "%p", &t, __loc_);
+    strftime_l(buf, 100, "%p", &t, __loc_);
     mb = mbstate_t();
     const char* bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@@ -4999,7 +4998,7 @@
     wbe = wbuf + j;
     __am_pm_[0].assign(wbuf, wbe);
     t.tm_hour = 13;
-    be = strftime_l(buf, 100, "%p", &t, __loc_);
+    strftime_l(buf, 100, "%p", &t, __loc_);
     mb = mbstate_t();
     bb = buf;
 #ifdef _LIBCPP_LOCALE__L_EXTENSIONS





More information about the cfe-commits mailing list