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
This commit is contained in:
Howard Hinnant 2012-12-27 18:46:00 +00:00
parent 27c836ff3a
commit c6e54b964f
2 changed files with 13 additions and 14 deletions

View File

@ -23,7 +23,7 @@ __get_db()
{ {
static __libcpp_db db; static __libcpp_db db;
return &db; return &db;
}; }
_LIBCPP_VISIBLE _LIBCPP_VISIBLE
const __libcpp_db* const __libcpp_db*

View File

@ -865,7 +865,7 @@ ctype<char>::do_toupper(char_type c) const
return isascii(c) ? return isascii(c) ?
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c; static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(c)]) : c;
#elif defined(__GLIBC__) #elif defined(__GLIBC__)
return isascii(c) ? __classic_upper_table()[c] : c; return isascii(c) ? __classic_upper_table()[static_cast<size_t>(c)] : c;
#else #else
return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c; return (isascii(c) && islower_l(c, __cloc())) ? c-'a'+'A' : c;
#endif #endif
@ -879,7 +879,7 @@ ctype<char>::do_toupper(char_type* low, const char_type* high) const
*low = isascii(*low) ? *low = isascii(*low) ?
static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low; static_cast<char>(_DefaultRuneLocale.__mapupper[static_cast<ptrdiff_t>(*low)]) : *low;
#elif defined(__GLIBC__) #elif defined(__GLIBC__)
*low = isascii(*low) ? __classic_upper_table()[*low] : *low; *low = isascii(*low) ? __classic_upper_table()[static_cast<size_t>(*low)] : *low;
#else #else
*low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low; *low = (isascii(*low) && islower_l(*low, __cloc())) ? *low-'a'+'A' : *low;
#endif #endif
@ -893,7 +893,7 @@ ctype<char>::do_tolower(char_type c) const
return isascii(c) ? return isascii(c) ?
static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c; static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(c)]) : c;
#elif defined(__GLIBC__) #elif defined(__GLIBC__)
return isascii(c) ? __classic_lower_table()[c] : c; return isascii(c) ? __classic_lower_table()[static_cast<size_t>(c)] : c;
#else #else
return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c; return (isascii(c) && isupper_l(c, __cloc())) ? c-'A'+'a' : c;
#endif #endif
@ -906,7 +906,7 @@ ctype<char>::do_tolower(char_type* low, const char_type* high) const
#ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE #ifdef _LIBCPP_HAS_DEFAULTRUNELOCALE
*low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low; *low = isascii(*low) ? static_cast<char>(_DefaultRuneLocale.__maplower[static_cast<ptrdiff_t>(*low)]) : *low;
#elif defined(__GLIBC__) #elif defined(__GLIBC__)
*low = isascii(*low) ? __classic_lower_table()[*low] : *low; *low = isascii(*low) ? __classic_lower_table()[static_cast<size_t>(*low)] : *low;
#else #else
*low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low; *low = (isascii(*low) && isupper_l(*low, __cloc())) ? *low-'A'+'a' : *low;
#endif #endif
@ -1229,7 +1229,7 @@ ctype_byname<wchar_t>::do_narrow(char_type c, char dfault) const
#else #else
int r = __wctob_l(c, __l); int r = __wctob_l(c, __l);
#endif #endif
return r != WEOF ? static_cast<char>(r) : dfault; return r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
} }
const wchar_t* const wchar_t*
@ -1242,7 +1242,7 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
#else #else
int r = __wctob_l(*low, __l); int r = __wctob_l(*low, __l);
#endif #endif
*dest = r != WEOF ? static_cast<char>(r) : dfault; *dest = r != static_cast<int>(WEOF) ? static_cast<char>(r) : dfault;
} }
return low; return low;
} }
@ -4922,7 +4922,6 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
{ {
tm t = {0}; tm t = {0};
char buf[100]; char buf[100];
size_t be;
wchar_t wbuf[100]; wchar_t wbuf[100];
wchar_t* wbe; wchar_t* wbe;
mbstate_t mb = {0}; mbstate_t mb = {0};
@ -4930,7 +4929,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
t.tm_wday = i; t.tm_wday = i;
be = strftime_l(buf, 100, "%A", &t, __loc_); strftime_l(buf, 100, "%A", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
const char* bb = buf; const char* bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@ -4942,7 +4941,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
__throw_runtime_error("locale not supported"); __throw_runtime_error("locale not supported");
wbe = wbuf + j; wbe = wbuf + j;
__weeks_[i].assign(wbuf, wbe); __weeks_[i].assign(wbuf, wbe);
be = strftime_l(buf, 100, "%a", &t, __loc_); strftime_l(buf, 100, "%a", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
bb = buf; bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@ -4959,7 +4958,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
for (int i = 0; i < 12; ++i) for (int i = 0; i < 12; ++i)
{ {
t.tm_mon = i; t.tm_mon = i;
be = strftime_l(buf, 100, "%B", &t, __loc_); strftime_l(buf, 100, "%B", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
const char* bb = buf; const char* bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@ -4971,7 +4970,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
__throw_runtime_error("locale not supported"); __throw_runtime_error("locale not supported");
wbe = wbuf + j; wbe = wbuf + j;
__months_[i].assign(wbuf, wbe); __months_[i].assign(wbuf, wbe);
be = strftime_l(buf, 100, "%b", &t, __loc_); strftime_l(buf, 100, "%b", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
bb = buf; bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@ -4986,7 +4985,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
} }
// __am_pm_ // __am_pm_
t.tm_hour = 1; t.tm_hour = 1;
be = strftime_l(buf, 100, "%p", &t, __loc_); strftime_l(buf, 100, "%p", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
const char* bb = buf; const char* bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS
@ -4999,7 +4998,7 @@ __time_get_storage<wchar_t>::init(const ctype<wchar_t>& ct)
wbe = wbuf + j; wbe = wbuf + j;
__am_pm_[0].assign(wbuf, wbe); __am_pm_[0].assign(wbuf, wbe);
t.tm_hour = 13; t.tm_hour = 13;
be = strftime_l(buf, 100, "%p", &t, __loc_); strftime_l(buf, 100, "%p", &t, __loc_);
mb = mbstate_t(); mb = mbstate_t();
bb = buf; bb = buf;
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS #ifdef _LIBCPP_LOCALE__L_EXTENSIONS