Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-05-03 13:25:32 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-05-03 13:25:32 +0400
commit7edacc4997a54c8f3e8d3bf3b8db957814cd7a67 (patch)
treeb20ee91fa7daad906aa3ad696fb47a58045f8672 /newlib
parentffa42cf6a0aa8835f832027c7545e2476b89b834 (diff)
* libc/locale/lctype.c: Include <string.h> and "setlocale.h".
(_C_ctype_locale): Add braces to initializer. (__ctype_load_locale): Fix compiler warnings in non-Cygwin case. * libc/locale/nl_langinfo.c (nl_langinfo): Expose _NL_CTYPE_MB_CUR_MAX case only if __HAVE_LOCALE_INFO__ is defined.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog8
-rw-r--r--newlib/libc/locale/lctype.c21
-rw-r--r--newlib/libc/locale/nl_langinfo.c2
3 files changed, 22 insertions, 9 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index c3e6662d7..9118f2f79 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-03 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/locale/lctype.c: Include <string.h> and "setlocale.h".
+ (_C_ctype_locale): Add braces to initializer.
+ (__ctype_load_locale): Fix compiler warnings in non-Cygwin case.
+ * libc/locale/nl_langinfo.c (nl_langinfo): Expose _NL_CTYPE_MB_CUR_MAX
+ case only if __HAVE_LOCALE_INFO__ is defined.
+
2010-05-02 Corinna Vinschen <corinna@vinschen.de>
* libc/stdlib/wctob.c (wctob): Reorganize and fix WEOF check. Rename
diff --git a/newlib/libc/locale/lctype.c b/newlib/libc/locale/lctype.c
index bd027ceaa..28575dd08 100644
--- a/newlib/libc/locale/lctype.c
+++ b/newlib/libc/locale/lctype.c
@@ -22,8 +22,10 @@
*/
#include <limits.h>
+#include <string.h>
#include "lctype.h"
#include "ldpart.h"
+#include "setlocale.h"
#define LCCTYPE_SIZE (sizeof(struct lc_ctype_T) / sizeof(char *))
@@ -33,10 +35,11 @@ static const struct lc_ctype_T _C_ctype_locale = {
"ASCII", /* codeset */
numone /* mb_cur_max */
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
- , "0", "1", "2", "3", "4", /* outdigits */
- "5", "6", "7", "8", "9",
- L"0", L"1", L"2", L"3", L"4", /* woutdigits */
- L"5", L"6", L"7", L"8", L"9"
+ ,
+ { "0", "1", "2", "3", "4", /* outdigits */
+ "5", "6", "7", "8", "9" },
+ { L"0", L"1", L"2", L"3", L"4", /* woutdigits */
+ L"5", L"6", L"7", L"8", L"9" }
#endif
};
@@ -79,11 +82,11 @@ __ctype_load_locale(const char *name, void *f_wctomb, const char *charset,
_ctype_using_locale = 0;
else
{
- _ctype_locale.codeset = _ctype_locale_buf;
- _ctype_locale.mb_cur_max = _ctype_locale_buf + _CTYPE_BUF_SIZE - 2;
- strcpy (_ctype_locale.codeset, charset);
- _ctype_locale.mb_cur_max[0] = mb_cur_max;
- _ctype_locale.mb_cur_max[1] = '\0';
+ _ctype_locale.codeset = strcpy (_ctype_locale_buf, charset);
+ char *mbc = _ctype_locale_buf + _CTYPE_BUF_SIZE - 2;
+ mbc[0] = mb_cur_max;
+ mbc[1] = '\0';
+ _ctype_locale.mb_cur_max = mbc;
_ctype_using_locale = 1;
}
ret = 0;
diff --git a/newlib/libc/locale/nl_langinfo.c b/newlib/libc/locale/nl_langinfo.c
index 97d835bef..392a7cbbb 100644
--- a/newlib/libc/locale/nl_langinfo.c
+++ b/newlib/libc/locale/nl_langinfo.c
@@ -412,9 +412,11 @@ do_codeset:
case D_MD_ORDER: /* local extension */
ret = (char *) __get_current_time_locale()->md_order;
break;
+#ifdef __HAVE_LOCALE_INFO__
case _NL_CTYPE_MB_CUR_MAX:
ret = (char *) __get_current_ctype_locale()->mb_cur_max;
break;
+#endif
default:
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
if (item > _NL_LOCALE_EXTENDED_FIRST_ENTRY