From c6e54b964f22f489309e4e98554ddd7a42ccd291 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 27 Dec 2012 18:46:00 +0000 Subject: [PATCH] Saleem Abdulrasool: This just rounds up a few compile warnings emitted by GCC (4.7.2). git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171165 91177308-0d34-0410-b5e6-96231b3b80d8 --- src/debug.cpp | 2 +- src/locale.cpp | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index b8af4dde..f3a0262d 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -23,7 +23,7 @@ __get_db() { static __libcpp_db db; return &db; -}; +} _LIBCPP_VISIBLE const __libcpp_db* diff --git a/src/locale.cpp b/src/locale.cpp index 792ea44d..e75f27ff 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -865,7 +865,7 @@ ctype::do_toupper(char_type c) const return isascii(c) ? static_cast(_DefaultRuneLocale.__mapupper[static_cast(c)]) : c; #elif defined(__GLIBC__) - return isascii(c) ? __classic_upper_table()[c] : c; + return isascii(c) ? __classic_upper_table()[static_cast(c)] : c; #else return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c; #endif @@ -879,7 +879,7 @@ ctype::do_toupper(char_type* low, const char_type* high) const *low = isascii(*low) ? static_cast(_DefaultRuneLocale.__mapupper[static_cast(*low)]) : *low; #elif defined(__GLIBC__) - *low = isascii(*low) ? __classic_upper_table()[*low] : *low; + *low = isascii(*low) ? __classic_upper_table()[static_cast(*low)] : *low; #else *low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low; #endif @@ -893,7 +893,7 @@ ctype::do_tolower(char_type c) const return isascii(c) ? static_cast(_DefaultRuneLocale.__maplower[static_cast(c)]) : c; #elif defined(__GLIBC__) - return isascii(c) ? __classic_lower_table()[c] : c; + return isascii(c) ? __classic_lower_table()[static_cast(c)] : c; #else return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c; #endif @@ -906,7 +906,7 @@ ctype::do_tolower(char_type* low, const char_type* high) const #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE *low = isascii(*low) ? static_cast(_DefaultRuneLocale.__maplower[static_cast(*low)]) : *low; #elif defined(__GLIBC__) - *low = isascii(*low) ? __classic_lower_table()[*low] : *low; + *low = isascii(*low) ? __classic_lower_table()[static_cast(*low)] : *low; #else *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low; #endif @@ -1229,7 +1229,7 @@ ctype_byname::do_narrow(char_type c, char dfault) const #else int r = __wctob_l(c, __l); #endif - return r != WEOF ? static_cast(r) : dfault; + return r != static_cast(WEOF) ? static_cast(r) : dfault; } const wchar_t* @@ -1242,7 +1242,7 @@ ctype_byname::do_narrow(const char_type* low, const char_type* high, ch #else int r = __wctob_l(*low, __l); #endif - *dest = r != WEOF ? static_cast(r) : dfault; + *dest = r != static_cast(WEOF) ? static_cast(r) : dfault; } return low; } @@ -4922,7 +4922,6 @@ __time_get_storage::init(const ctype& ct) { tm t = {0}; char buf[100]; - size_t be; wchar_t wbuf[100]; wchar_t* wbe; mbstate_t mb = {0}; @@ -4930,7 +4929,7 @@ __time_get_storage::init(const ctype& ct) 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 @@ __time_get_storage::init(const ctype& ct) __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 @@ __time_get_storage::init(const ctype& ct) 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 @@ __time_get_storage::init(const ctype& ct) __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 @@ __time_get_storage::init(const ctype& ct) } // __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 @@ __time_get_storage::init(const ctype& ct) 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