diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-04-30 15:13:06 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-30 15:13:06 +0000 |
commit | 8d61889074faf8430b37877235bac658d68e34c3 (patch) | |
tree | 5a48f7ccaa3f745d8926e56b3b66b58ebc12ecce | |
parent | 8c22f86128c2f64c57e5c7b6f294d5879feae124 (diff) | |
parent | 01d98425a4d9b02e306a14a746541990df3d5743 (diff) | |
download | stlport-8d61889074faf8430b37877235bac658d68e34c3.tar.gz |
am 01d98425: Merge changes Ib5e6736f,Ibf1b146d
* commit '01d98425a4d9b02e306a14a746541990df3d5743':
stlport: c_locale_dummy unused argument warnings
stlport: deal with compile warnings
-rw-r--r-- | src/c_locale_dummy/c_locale_dummy.c | 305 | ||||
-rw-r--r-- | src/locale.cpp | 3 | ||||
-rw-r--r-- | stlport/stl/_istream.c | 1 | ||||
-rw-r--r-- | stlport/stl/_messages_facets.h | 12 | ||||
-rw-r--r-- | stlport/stl/_slist.c | 1 | ||||
-rw-r--r-- | stlport/stl/_stdexcept_base.c | 2 | ||||
-rw-r--r-- | stlport/stl/_time_facets.c | 5 | ||||
-rw-r--r-- | stlport/stl/config/features.h | 2 |
8 files changed, 188 insertions, 143 deletions
diff --git a/src/c_locale_dummy/c_locale_dummy.c b/src/c_locale_dummy/c_locale_dummy.c index 01708ee..709c35e 100644 --- a/src/c_locale_dummy/c_locale_dummy.c +++ b/src/c_locale_dummy/c_locale_dummy.c @@ -41,6 +41,8 @@ # endif #endif +#define UNUSED __attribute__((__unused__)) + static const char *_C_name = "C"; static const char *_empty_str = ""; #ifndef _STLP_NO_WCHAR_T @@ -86,68 +88,75 @@ void* _Locale_create(const char* name, int *__err_code) { } struct _Locale_ctype* _Locale_ctype_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_ctype*)_Locale_create(name, __err_code); } struct _Locale_codecvt* _Locale_codecvt_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_codecvt*)_Locale_create(name, __err_code); } struct _Locale_numeric* _Locale_numeric_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_numeric*)_Locale_create(name, __err_code); } struct _Locale_time* _Locale_time_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_time*)_Locale_create(name, __err_code); } struct _Locale_collate* _Locale_collate_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_collate*)_Locale_create(name, __err_code); } struct _Locale_monetary* _Locale_monetary_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_monetary*)_Locale_create(name, __err_code); } struct _Locale_messages* _Locale_messages_create(const char *name, - struct _Locale_name_hint* hint, int *__err_code) + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return (struct _Locale_messages*)_Locale_create(name, __err_code); } -const char *_Locale_ctype_default(char* buf) { return _C_name; } -const char *_Locale_numeric_default(char * buf) { return _C_name; } -const char *_Locale_time_default(char* buf) { return _C_name; } -const char *_Locale_collate_default(char* buf) { return _C_name; } -const char *_Locale_monetary_default(char* buf) { return _C_name; } -const char *_Locale_messages_default(char* buf) { return _C_name; } +const char *_Locale_ctype_default(char* buf UNUSED) { return _C_name; } +const char *_Locale_numeric_default(char * buf UNUSED) { return _C_name; } +const char *_Locale_time_default(char* buf UNUSED) { return _C_name; } +const char *_Locale_collate_default(char* buf UNUSED) { return _C_name; } +const char *_Locale_monetary_default(char* buf UNUSED) { return _C_name; } +const char *_Locale_messages_default(char* buf UNUSED) { return _C_name; } -char const* _Locale_ctype_name(const struct _Locale_ctype *lctype, char* buf) +char const* _Locale_ctype_name(const struct _Locale_ctype *lctype UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_codecvt_name(const struct _Locale_codecvt *lcodecvt, char* buf) +char const* _Locale_codecvt_name(const struct _Locale_codecvt *lcodecvt UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_numeric_name(const struct _Locale_numeric *lnum, char* buf) +char const* _Locale_numeric_name(const struct _Locale_numeric *lnum UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_time_name(const struct _Locale_time *ltime, char* buf) +char const* _Locale_time_name(const struct _Locale_time *ltime UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_collate_name(const struct _Locale_collate *lcol, char* buf) +char const* _Locale_collate_name(const struct _Locale_collate *lcol UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_monetary_name(const struct _Locale_monetary *lmon, char* buf) +char const* _Locale_monetary_name(const struct _Locale_monetary *lmon UNUSED, char* buf UNUSED) { return _C_name; } -char const* _Locale_messages_name(const struct _Locale_messages *lmes, char* buf) +char const* _Locale_messages_name(const struct _Locale_messages *lmes UNUSED, char* buf UNUSED) { return _C_name; } -void _Locale_ctype_destroy(struct _Locale_ctype *lctype) {} -void _Locale_codecvt_destroy(struct _Locale_codecvt *lcodecvt) {} -void _Locale_numeric_destroy(struct _Locale_numeric *lnum) {} -void _Locale_time_destroy(struct _Locale_time *ltime) {} -void _Locale_collate_destroy(struct _Locale_collate *lcol) {} -void _Locale_monetary_destroy(struct _Locale_monetary *lmon) {} -void _Locale_messages_destroy(struct _Locale_messages *lmes) {} +void _Locale_ctype_destroy(struct _Locale_ctype *lctype UNUSED) {} +void _Locale_codecvt_destroy(struct _Locale_codecvt *lcodecvt UNUSED) {} +void _Locale_numeric_destroy(struct _Locale_numeric *lnum UNUSED) {} +void _Locale_time_destroy(struct _Locale_time *ltime UNUSED) {} +void _Locale_collate_destroy(struct _Locale_collate *lcol UNUSED) {} +void _Locale_monetary_destroy(struct _Locale_monetary *lmon UNUSED) {} +void _Locale_messages_destroy(struct _Locale_messages *lmes UNUSED) {} static char const* _Locale_extract_name(const char* name, int *__err_code) { // When the request is the default locale or the "C" locale we answer "C". @@ -157,41 +166,53 @@ static char const* _Locale_extract_name(const char* name, int *__err_code) { *__err_code = _STLP_LOC_NO_PLATFORM_SUPPORT; return 0; } -char const* _Locale_extract_ctype_name(const char *name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_ctype_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -char const* _Locale_extract_numeric_name(const char *name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_numeric_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -char const* _Locale_extract_time_name(const char*name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_time_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -char const* _Locale_extract_collate_name(const char *name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_collate_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -char const* _Locale_extract_monetary_name(const char *name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_monetary_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -char const* _Locale_extract_messages_name(const char *name, char *buf, - struct _Locale_name_hint* hint, int *__err_code) +char const* _Locale_extract_messages_name(const char *name, + char *buf UNUSED, + struct _Locale_name_hint* hint UNUSED, + int *__err_code) { return _Locale_extract_name(name, __err_code); } -struct _Locale_name_hint* _Locale_get_ctype_hint(struct _Locale_ctype* ctype) +struct _Locale_name_hint* _Locale_get_ctype_hint(struct _Locale_ctype* ctype UNUSED) { return 0; } -struct _Locale_name_hint* _Locale_get_numeric_hint(struct _Locale_numeric* numeric) +struct _Locale_name_hint* _Locale_get_numeric_hint(struct _Locale_numeric* numeric UNUSED) { return 0; } -struct _Locale_name_hint* _Locale_get_time_hint(struct _Locale_time* time) +struct _Locale_name_hint* _Locale_get_time_hint(struct _Locale_time* time UNUSED) { return 0; } -struct _Locale_name_hint* _Locale_get_collate_hint(struct _Locale_collate* collate) +struct _Locale_name_hint* _Locale_get_collate_hint(struct _Locale_collate* collate UNUSED) { return 0; } -struct _Locale_name_hint* _Locale_get_monetary_hint(struct _Locale_monetary* monetary) +struct _Locale_name_hint* _Locale_get_monetary_hint(struct _Locale_monetary* monetary UNUSED) { return 0; } -struct _Locale_name_hint* _Locale_get_messages_hint(struct _Locale_messages* messages) +struct _Locale_name_hint* _Locale_get_messages_hint(struct _Locale_messages* messages UNUSED) { return 0; } /* ctype */ @@ -200,14 +221,14 @@ const _Locale_mask_t* _Locale_ctype_table(struct _Locale_ctype* lctype) { return ctable; } -int _Locale_toupper(struct _Locale_ctype*lctype, int c) +int _Locale_toupper(struct _Locale_ctype*lctype UNUSED, int c) { return toupper(c); } -int _Locale_tolower(struct _Locale_ctype*lctype, int c) +int _Locale_tolower(struct _Locale_ctype*lctype UNUSED, int c) { return tolower(c); } #ifndef _STLP_NO_WCHAR_T -_Locale_mask_t _WLocale_ctype(struct _Locale_ctype *lctype, wint_t wc, _Locale_mask_t mask) { +_Locale_mask_t _WLocale_ctype(struct _Locale_ctype *lctype UNUSED, wint_t wc, _Locale_mask_t mask) { _Locale_mask_t ret = 0; if ((mask & _Locale_ALPHA) != 0 && iswalpha(wc)) ret |= _Locale_ALPHA; @@ -239,36 +260,36 @@ _Locale_mask_t _WLocale_ctype(struct _Locale_ctype *lctype, wint_t wc, _Locale_m return ret; } -wint_t _WLocale_tolower(struct _Locale_ctype *lctype, wint_t wc) +wint_t _WLocale_tolower(struct _Locale_ctype *lctype UNUSED, wint_t wc) { return towlower(wc); } -wint_t _WLocale_toupper(struct _Locale_ctype *lctype, wint_t wc) +wint_t _WLocale_toupper(struct _Locale_ctype *lctype UNUSED, wint_t wc) { return towupper(wc); } -int _WLocale_mb_cur_max (struct _Locale_codecvt *lcodecvt) { return 1; } -int _WLocale_mb_cur_min (struct _Locale_codecvt *lcodecvt) { return 1; } -int _WLocale_is_stateless (struct _Locale_codecvt *lcodecvt) { return 1; } +int _WLocale_mb_cur_max (struct _Locale_codecvt *lcodecvt UNUSED) { return 1; } +int _WLocale_mb_cur_min (struct _Locale_codecvt *lcodecvt UNUSED) { return 1; } +int _WLocale_is_stateless (struct _Locale_codecvt *lcodecvt UNUSED) { return 1; } -size_t _WLocale_mbtowc(struct _Locale_codecvt *lcodecvt, +size_t _WLocale_mbtowc(struct _Locale_codecvt *lcodecvt UNUSED, wchar_t *to, - const char *from, size_t n, - mbstate_t *st) + const char *from, size_t n UNUSED, + mbstate_t *st UNUSED) { *to = *from; return 1; } -size_t _WLocale_wctomb(struct _Locale_codecvt *lcodecvt, - char *to, size_t n, +size_t _WLocale_wctomb(struct _Locale_codecvt *lcodecvt UNUSED, + char *to, size_t n UNUSED, const wchar_t c, - mbstate_t *st) + mbstate_t *st UNUSED) { *to = (char)c; return 1; } -size_t _WLocale_unshift(struct _Locale_codecvt *lcodecvt, - mbstate_t *st, - char *buf, size_t n, char ** next) +size_t _WLocale_unshift(struct _Locale_codecvt *lcodecvt UNUSED, + mbstate_t *st UNUSED, + char *buf, size_t n UNUSED, char ** next) { *next = buf; return 0; } #endif /* Collate */ - int _Locale_strcmp(struct _Locale_collate* lcol, + int _Locale_strcmp(struct _Locale_collate* lcol UNUSED, const char* s1, size_t n1, const char* s2, size_t n2) { int ret = 0; char buf1[64], buf2[64]; @@ -288,7 +309,7 @@ size_t _WLocale_unshift(struct _Locale_codecvt *lcodecvt, #ifndef _STLP_NO_WCHAR_T -int _WLocale_strcmp(struct _Locale_collate* lcol, +int _WLocale_strcmp(struct _Locale_collate* lcol UNUSED, const wchar_t* s1, size_t n1, const wchar_t* s2, size_t n2) { int ret = 0; wchar_t buf1[64], buf2[64]; @@ -308,7 +329,7 @@ int _WLocale_strcmp(struct _Locale_collate* lcol, #endif -size_t _Locale_strxfrm(struct _Locale_collate* lcol, +size_t _Locale_strxfrm(struct _Locale_collate* lcol UNUSED, char* dest, size_t dest_n, const char* src, size_t src_n) { if (dest != 0) { @@ -319,7 +340,7 @@ size_t _Locale_strxfrm(struct _Locale_collate* lcol, #ifndef _STLP_NO_WCHAR_T -size_t _WLocale_strxfrm(struct _Locale_collate* lcol, +size_t _WLocale_strxfrm(struct _Locale_collate* lcol UNUSED, wchar_t* dest, size_t dest_n, const wchar_t* src, size_t src_n) { if (dest != 0) { @@ -332,84 +353,96 @@ size_t _WLocale_strxfrm(struct _Locale_collate* lcol, /* Numeric */ -char _Locale_decimal_point(struct _Locale_numeric* lnum) +char _Locale_decimal_point(struct _Locale_numeric* lnum UNUSED) { return '.'; } -char _Locale_thousands_sep(struct _Locale_numeric* lnum) +char _Locale_thousands_sep(struct _Locale_numeric* lnum UNUSED) { return ','; } -const char* _Locale_grouping(struct _Locale_numeric * lnum) +const char* _Locale_grouping(struct _Locale_numeric * lnum UNUSED) { return _empty_str; } -const char * _Locale_true(struct _Locale_numeric * lnum) +const char * _Locale_true(struct _Locale_numeric * lnum UNUSED) { return "true"; } -const char * _Locale_false(struct _Locale_numeric * lnum) +const char * _Locale_false(struct _Locale_numeric * lnum UNUSED) { return "false"; } #ifndef _STLP_NO_WCHAR_T -wchar_t _WLocale_decimal_point(struct _Locale_numeric* lnum) +wchar_t _WLocale_decimal_point(struct _Locale_numeric* lnum UNUSED) { return L'.'; } -wchar_t _WLocale_thousands_sep(struct _Locale_numeric* lnum) +wchar_t _WLocale_thousands_sep(struct _Locale_numeric* lnum UNUSED) { return L','; } #if defined(WCHAR_MAX) && WCHAR_MAX == 255 -const wchar_t * _WLocale_true(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_true(struct _Locale_numeric* lnum UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return "true"; } -const wchar_t * _WLocale_false(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_false(struct _Locale_numeric* lnum UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return "false"; } #else -const wchar_t * _WLocale_true(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_true(struct _Locale_numeric* lnum UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return L"true"; } -const wchar_t * _WLocale_false(struct _Locale_numeric* lnum, wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_false(struct _Locale_numeric* lnum UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return L"false"; } #endif #endif /* Monetary */ -const char* _Locale_int_curr_symbol(struct _Locale_monetary * lmon) +const char* _Locale_int_curr_symbol(struct _Locale_monetary * lmon UNUSED) { return _empty_str; } -const char* _Locale_currency_symbol(struct _Locale_monetary * lmon) +const char* _Locale_currency_symbol(struct _Locale_monetary * lmon UNUSED) { return _empty_str; } -char _Locale_mon_decimal_point(struct _Locale_monetary * lmon) +char _Locale_mon_decimal_point(struct _Locale_monetary * lmon UNUSED) { return '.'; } -char _Locale_mon_thousands_sep(struct _Locale_monetary * lmon) +char _Locale_mon_thousands_sep(struct _Locale_monetary * lmon UNUSED) { return ','; } -const char* _Locale_mon_grouping(struct _Locale_monetary * lmon) +const char* _Locale_mon_grouping(struct _Locale_monetary * lmon UNUSED) { return _empty_str; } -const char* _Locale_positive_sign(struct _Locale_monetary * lmon) +const char* _Locale_positive_sign(struct _Locale_monetary * lmon UNUSED) { return _empty_str; } -const char* _Locale_negative_sign(struct _Locale_monetary * lmon) +const char* _Locale_negative_sign(struct _Locale_monetary * lmon UNUSED) { return _empty_str; } -char _Locale_int_frac_digits(struct _Locale_monetary * lmon) +char _Locale_int_frac_digits(struct _Locale_monetary * lmon UNUSED) { return 0; } -char _Locale_frac_digits(struct _Locale_monetary * lmon) +char _Locale_frac_digits(struct _Locale_monetary * lmon UNUSED) { return 0; } -int _Locale_p_cs_precedes(struct _Locale_monetary * lmon) +int _Locale_p_cs_precedes(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } -int _Locale_p_sep_by_space(struct _Locale_monetary * lmon) +int _Locale_p_sep_by_space(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } -int _Locale_p_sign_posn(struct _Locale_monetary * lmon) +int _Locale_p_sign_posn(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } -int _Locale_n_cs_precedes(struct _Locale_monetary * lmon) +int _Locale_n_cs_precedes(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } -int _Locale_n_sep_by_space(struct _Locale_monetary * lmon) +int _Locale_n_sep_by_space(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } -int _Locale_n_sign_posn(struct _Locale_monetary * lmon) +int _Locale_n_sign_posn(struct _Locale_monetary * lmon UNUSED) { return CHAR_MAX; } #ifndef _STLP_NO_WCHAR_T -const wchar_t* _WLocale_int_curr_symbol(struct _Locale_monetary * lmon, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_int_curr_symbol(struct _Locale_monetary * lmon UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return _empty_wstr; } -const wchar_t* _WLocale_currency_symbol(struct _Locale_monetary * lmon, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_currency_symbol(struct _Locale_monetary * lmon UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return _empty_wstr; } -wchar_t _WLocale_mon_decimal_point(struct _Locale_monetary * lmon) +wchar_t _WLocale_mon_decimal_point(struct _Locale_monetary * lmon UNUSED) { return L'.'; } -wchar_t _WLocale_mon_thousands_sep(struct _Locale_monetary * lmon) +wchar_t _WLocale_mon_thousands_sep(struct _Locale_monetary * lmon UNUSED) { return L','; } -const wchar_t* _WLocale_positive_sign(struct _Locale_monetary * lmon, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_positive_sign(struct _Locale_monetary * lmon UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return _empty_wstr; } -const wchar_t* _WLocale_negative_sign(struct _Locale_monetary * lmon, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_negative_sign(struct _Locale_monetary * lmon UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return _empty_wstr; } #endif @@ -417,38 +450,38 @@ const wchar_t* _WLocale_negative_sign(struct _Locale_monetary * lmon, static const char* full_monthname[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; -const char * _Locale_full_monthname(struct _Locale_time * ltime, int n) +const char * _Locale_full_monthname(struct _Locale_time * ltime UNUSED, int n) { return full_monthname[n]; } static const char* abbrev_monthname[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -const char * _Locale_abbrev_monthname(struct _Locale_time * ltime, int n) +const char * _Locale_abbrev_monthname(struct _Locale_time * ltime UNUSED, int n) { return abbrev_monthname[n]; } static const char* full_dayname[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; -const char * _Locale_full_dayofweek(struct _Locale_time * ltime, int n) +const char * _Locale_full_dayofweek(struct _Locale_time * ltime UNUSED, int n) { return full_dayname[n]; } static const char* abbrev_dayname[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -const char * _Locale_abbrev_dayofweek(struct _Locale_time * ltime, int n) +const char * _Locale_abbrev_dayofweek(struct _Locale_time * ltime UNUSED, int n) { return abbrev_dayname[n]; } -const char* _Locale_d_t_fmt(struct _Locale_time* ltime) +const char* _Locale_d_t_fmt(struct _Locale_time* ltime UNUSED) { return "%m/%d/%y"; } -const char* _Locale_d_fmt(struct _Locale_time* ltime) +const char* _Locale_d_fmt(struct _Locale_time* ltime UNUSED) { return "%m/%d/%y"; } -const char* _Locale_t_fmt(struct _Locale_time* ltime) +const char* _Locale_t_fmt(struct _Locale_time* ltime UNUSED) { return "%H:%M:%S"; } -const char* _Locale_long_d_t_fmt(struct _Locale_time* ltime) +const char* _Locale_long_d_t_fmt(struct _Locale_time* ltime UNUSED) { return _empty_str; } -const char* _Locale_long_d_fmt(struct _Locale_time* ltime) +const char* _Locale_long_d_fmt(struct _Locale_time* ltime UNUSED) { return _empty_str; } -const char* _Locale_am_str(struct _Locale_time* ltime) +const char* _Locale_am_str(struct _Locale_time* ltime UNUSED) { return "AM"; } -const char* _Locale_pm_str(struct _Locale_time* ltime) +const char* _Locale_pm_str(struct _Locale_time* ltime UNUSED) { return "PM"; } #ifndef _STLP_NO_WCHAR_T @@ -489,43 +522,57 @@ const wchar_t* _WLocale_pm_str(struct _Locale_time* ltime, static const wchar_t* full_wmonthname[] = { L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December" }; -const wchar_t * _WLocale_full_monthname(struct _Locale_time * ltime, int n, - wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_full_monthname(struct _Locale_time * ltime UNUSED, + int n, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return full_wmonthname[n]; } static const wchar_t* abbrev_wmonthname[] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" }; -const wchar_t * _WLocale_abbrev_monthname(struct _Locale_time * ltime, int n, - wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_abbrev_monthname(struct _Locale_time * ltime UNUSED, + int n, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return abbrev_wmonthname[n]; } static const wchar_t* full_wdayname[] = { L"Sunday", L"Monday", L"Tuesday", L"Wednesday", L"Thursday", L"Friday", L"Saturday" }; -const wchar_t * _WLocale_full_dayofweek(struct _Locale_time * ltime, int n, - wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_full_dayofweek(struct _Locale_time * ltime UNUSED, + int n, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return full_wdayname[n]; } static const wchar_t* abbrev_wdayname[] = { L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat" }; -const wchar_t * _WLocale_abbrev_dayofweek(struct _Locale_time * ltime, int n, - wchar_t* buf, size_t bufSize) +const wchar_t * _WLocale_abbrev_dayofweek(struct _Locale_time * ltime UNUSED, + int n, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return abbrev_wdayname[n]; } -const wchar_t* _WLocale_am_str(struct _Locale_time* ltime, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_am_str(struct _Locale_time* ltime UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return L"AM"; } -const wchar_t* _WLocale_pm_str(struct _Locale_time* ltime, - wchar_t* buf, size_t bufSize) +const wchar_t* _WLocale_pm_str(struct _Locale_time* ltime UNUSED, + wchar_t* buf UNUSED, + size_t bufSize UNUSED) { return L"PM"; } #endif /* WCHAR_MAX != 255 */ #endif /* Messages */ -nl_catd_type _Locale_catopen(struct _Locale_messages* lmes, const char* name) +nl_catd_type _Locale_catopen(struct _Locale_messages* lmes UNUSED, + const char* name UNUSED) { return -1; } -void _Locale_catclose(struct _Locale_messages* lmes, nl_catd_type cat) {} -const char* _Locale_catgets(struct _Locale_messages* lmes, nl_catd_type cat, - int setid, int msgid, const char *dfault) +void _Locale_catclose(struct _Locale_messages* lmes UNUSED, nl_catd_type cat UNUSED) {} +const char* _Locale_catgets(struct _Locale_messages* lmes UNUSED, + nl_catd_type cat UNUSED, + int setid UNUSED, + int msgid UNUSED, + const char *dfault) { return dfault; } diff --git a/src/locale.cpp b/src/locale.cpp index 5564a6e..8d724f5 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -249,8 +249,9 @@ locale::locale(const locale& L, const char* name, locale::category c) if (!name) _M_throw_on_null_name(); - if (!::strcmp(_Nameless, name)) + if (!::strcmp(_Nameless, name)) { _STLP_THROW(runtime_error("Invalid locale name '" _NAMELESS "'")); + } _Locale_impl* impl = 0; diff --git a/stlport/stl/_istream.c b/stlport/stl/_istream.c index 7fc2f04..ae66a99 100644 --- a/stlport/stl/_istream.c +++ b/stlport/stl/_istream.c @@ -1159,7 +1159,6 @@ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __delim) { if (__sentry) { basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf(); - typedef _STLP_PRIV _Constant_unary_fun<bool, int_type> _Const_bool; typedef _STLP_PRIV _Constant_binary_fun<streamsize, streamsize, streamsize> _Const_streamsize; const streamsize __maxss = (numeric_limits<streamsize>::max)(); diff --git a/stlport/stl/_messages_facets.h b/stlport/stl/_messages_facets.h index aca5596..795570c 100644 --- a/stlport/stl/_messages_facets.h +++ b/stlport/stl/_messages_facets.h @@ -73,12 +73,12 @@ public: protected: ~messages() {} - virtual catalog do_open(const string& __fn, const locale& __loc) const + virtual catalog do_open(const string& /*__fn*/, const locale& /*__loc*/) const { return -1; } - virtual string_type do_get(catalog __c, int __set, int __msgid, + virtual string_type do_get(catalog /*__c*/, int /*__set*/, int /*__msgid*/, const string_type& __dfault) const { return __dfault; } - virtual void do_close(catalog __c) const + virtual void do_close(catalog /*__c*/) const {} }; @@ -106,12 +106,12 @@ public: protected: ~messages() {} - virtual catalog do_open(const string& __fn, const locale& __loc) const + virtual catalog do_open(const string& /*__fn*/, const locale& /*__loc*/) const { return -1; } - virtual string_type do_get(catalog __c, int __set, int __msgid, + virtual string_type do_get(catalog /*__c*/, int /*__set*/, int /*__msgid*/, const string_type& __dfault) const { return __dfault; } - virtual void do_close(catalog __c) const + virtual void do_close(catalog /*__c*/) const {} }; diff --git a/stlport/stl/_slist.c b/stlport/stl/_slist.c index ba158d0..107b600 100644 --- a/stlport/stl/_slist.c +++ b/stlport/stl/_slist.c @@ -148,7 +148,6 @@ template <class _Tp, class _Alloc, class _StrictWeakOrdering> void _Slist_merge(slist<_Tp, _Alloc>& __that, slist<_Tp, _Alloc>& __x, _StrictWeakOrdering __comp) { typedef _Slist_node<_Tp> _Node; - typedef _STLP_PRIV _Slist_node_base _Node_base; if (__that.get_allocator() == __x.get_allocator()) { typename slist<_Tp, _Alloc>::iterator __ite(__that.before_begin()); while (__ite._M_node->_M_next && !__x.empty()) { diff --git a/stlport/stl/_stdexcept_base.c b/stlport/stl/_stdexcept_base.c index deb7056..d03c1aa 100644 --- a/stlport/stl/_stdexcept_base.c +++ b/stlport/stl/_stdexcept_base.c @@ -64,7 +64,7 @@ __Named_exception::__Named_exception(const __Named_exception& __x) { __Named_exception& __Named_exception::operator = (const __Named_exception& __x) { size_t __size = strlen(__x._M_name) + 1; - size_t __buf_size = _M_name != _M_static_name ? *(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) : _S_bufsize; + size_t __buf_size = _M_name != _M_static_name ? *(__REINTERPRET_CAST(size_t*, &_M_static_name[0])) : __STATIC_CAST(size_t,_S_bufsize); if (__size > __buf_size) { // Being here necessarily mean that we need to allocate a buffer: if (_M_name != _M_static_name) free(_M_name); diff --git a/stlport/stl/_time_facets.c b/stlport/stl/_time_facets.c index f403817..c4f74ce 100644 --- a/stlport/stl/_time_facets.c +++ b/stlport/stl/_time_facets.c @@ -151,7 +151,6 @@ __get_formatted_time _STLP_WEAK (_InIt1 __first, _InIt1 __last, _Ch*, const _TimeInfo& __table, const ios_base& __s, ios_base::iostate& __err, tm* __t) { const ctype<_Ch>& __ct = use_facet<ctype<_Ch> >(__s.getloc()); - typedef basic_string<_Ch, char_traits<_Ch>, allocator<_Ch> > string_type; size_t offset; while (__first != __last && __format != __format_end) { @@ -366,7 +365,7 @@ time_get<_Ch, _InIt>::do_get_year(_InIt __s, _InIt __end, template <class _Ch, class _InIt> _InIt time_get<_Ch, _InIt>::do_get_weekday(_InIt __s, _InIt __end, - ios_base &__str, ios_base::iostate &__err, + ios_base& /*__str*/, ios_base::iostate &__err, tm *__t) const { bool __result = _STLP_PRIV __get_short_or_long_dayname(__s, __end, this->_M_timeinfo, __t); @@ -383,7 +382,7 @@ time_get<_Ch, _InIt>::do_get_weekday(_InIt __s, _InIt __end, template <class _Ch, class _InIt> _InIt time_get<_Ch, _InIt>::do_get_monthname(_InIt __s, _InIt __end, - ios_base &__str, ios_base::iostate &__err, + ios_base& /*__str*/, ios_base::iostate &__err, tm *__t) const { bool __result = _STLP_PRIV __get_short_or_long_monthname(__s, __end, this->_M_timeinfo, __t); diff --git a/stlport/stl/config/features.h b/stlport/stl/config/features.h index 5928ded..b615041 100644 --- a/stlport/stl/config/features.h +++ b/stlport/stl/config/features.h @@ -314,7 +314,7 @@ /* Some compiler support 0 size array so we use negative size array to generate * a compilation time error. */ -# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1]; +# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1] __attribute__((__unused__)); #endif /* apple mpw exception handling bug */ |