From f737a4edba836d4e1fd48952d8e6827d85874e90 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 4 May 2011 08:54:34 +0000 Subject: [PATCH] * libc/locale/lmessages.h (__messages_load_locale): Declare. Remove accidental declaration of __numeric_load_locale. * libc/locale/locale.c: Include timelocal.h to get declaration of __time_load_locale. (__set_locale_from_locale_alias): Fix return type. (__locale_msgcharset): Avoid compiler warnings. (_localeconv_r): Ditto. --- newlib/ChangeLog | 10 ++++++++++ newlib/libc/locale/lmessages.h | 2 +- newlib/libc/locale/locale.c | 25 +++++++++++++------------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 3c1f84b39..22fee34be 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,13 @@ +2011-05-04 Corinna Vinschen + + * libc/locale/lmessages.h (__messages_load_locale): Declare. Remove + accidental declaration of __numeric_load_locale. + * libc/locale/locale.c: Include timelocal.h to get declaration of + __time_load_locale. + (__set_locale_from_locale_alias): Fix return type. + (__locale_msgcharset): Avoid compiler warnings. + (_localeconv_r): Ditto. + 2011-05-04 Andy Koppe * libc/locale/locale.c (current_categories): On Cygwin, set LC_CTYPE diff --git a/newlib/libc/locale/lmessages.h b/newlib/libc/locale/lmessages.h index 52cf6f67c..079895d5b 100644 --- a/newlib/libc/locale/lmessages.h +++ b/newlib/libc/locale/lmessages.h @@ -50,7 +50,7 @@ struct lc_messages_T { }; struct lc_messages_T *__get_current_messages_locale(void); -int __numeric_load_locale(const char *, void *, const char *); +int __messages_load_locale(const char *, void *, const char *); __END_DECLS diff --git a/newlib/libc/locale/locale.c b/newlib/libc/locale/locale.c index 9f9b63962..ee24872b2 100644 --- a/newlib/libc/locale/locale.c +++ b/newlib/libc/locale/locale.c @@ -182,6 +182,7 @@ No supporting OS subroutines are required. #include "lmonetary.h" #include "lnumeric.h" #include "lctype.h" +#include "timelocal.h" #include "../stdlib/local.h" #define _LC_LAST 7 @@ -435,7 +436,7 @@ currentlocale() #ifdef _MB_CAPABLE #ifdef __CYGWIN__ extern void __set_charset_from_locale (const char *locale, char *charset); -extern int __set_locale_from_locale_alias (const char *, char *); +extern char *__set_locale_from_locale_alias (const char *, char *); extern int __collate_load_locale (const char *, void *, const char *); #endif /* __CYGWIN__ */ @@ -951,7 +952,7 @@ char * _DEFUN_VOID(__locale_msgcharset) { #ifdef __HAVE_LOCALE_INFO__ - return __get_current_messages_locale ()->codeset; + return (char *) __get_current_messages_locale ()->codeset; #else return lc_message_charset; #endif @@ -971,21 +972,21 @@ _DEFUN(_localeconv_r, (data), if (__nlocale_changed) { struct lc_numeric_T *n = __get_current_numeric_locale (); - lconv.decimal_point = n->decimal_point; - lconv.thousands_sep = n->thousands_sep; - lconv.grouping = n->grouping; + lconv.decimal_point = (char *) n->decimal_point; + lconv.thousands_sep = (char *) n->thousands_sep; + lconv.grouping = (char *) n->grouping; __nlocale_changed = 0; } if (__mlocale_changed) { struct lc_monetary_T *m = __get_current_monetary_locale (); - lconv.int_curr_symbol = m->int_curr_symbol; - lconv.currency_symbol = m->currency_symbol; - lconv.mon_decimal_point = m->mon_decimal_point; - lconv.mon_thousands_sep = m->mon_thousands_sep; - lconv.mon_grouping = m->mon_grouping; - lconv.positive_sign = m->positive_sign; - lconv.negative_sign = m->negative_sign; + lconv.int_curr_symbol = (char *) m->int_curr_symbol; + lconv.currency_symbol = (char *) m->currency_symbol; + lconv.mon_decimal_point = (char *) m->mon_decimal_point; + lconv.mon_thousands_sep = (char *) m->mon_thousands_sep; + lconv.mon_grouping = (char *) m->mon_grouping; + lconv.positive_sign = (char *) m->positive_sign; + lconv.negative_sign = (char *) m->negative_sign; lconv.int_frac_digits = m->int_frac_digits[0]; lconv.frac_digits = m->frac_digits[0]; lconv.p_cs_precedes = m->p_cs_precedes[0];