diff options
Diffstat (limited to 'locale')
-rw-r--r-- | locale/duplocale.c | 2 | ||||
-rw-r--r-- | locale/freelocale.c | 2 | ||||
-rw-r--r-- | locale/langinfo.h | 24 | ||||
-rw-r--r-- | locale/programs/ld-ctype.c | 5 | ||||
-rw-r--r-- | locale/programs/locale.c | 3 | ||||
-rw-r--r-- | locale/setlocale.c | 8 |
6 files changed, 31 insertions, 13 deletions
diff --git a/locale/duplocale.c b/locale/duplocale.c index b3aa4af68c..2dcc0f5b02 100644 --- a/locale/duplocale.c +++ b/locale/duplocale.c @@ -45,7 +45,7 @@ __duplocale (__locale_t dataset) for (cnt = 0; cnt < LC_ALL; ++cnt) { result->__locales[cnt] = dataset->__locales[cnt]; - if (result->__locales[cnt]->usage_count != MAX_USAGE_COUNT) + if (result->__locales[cnt]->usage_count < MAX_USAGE_COUNT) ++result->__locales[cnt]->usage_count; } } diff --git a/locale/freelocale.c b/locale/freelocale.c index a09a744ebf..3cfa5276ca 100644 --- a/locale/freelocale.c +++ b/locale/freelocale.c @@ -38,7 +38,7 @@ __freelocale (__locale_t dataset) __libc_lock_lock (__libc_setlocale_lock); for (cnt = 0; cnt < LC_ALL; ++cnt) - if (dataset->__locales[cnt]->usage_count != MAX_USAGE_COUNT) + if (dataset->__locales[cnt]->usage_count != UNDELETABLE) /* We can remove the data. */ _nl_remove_locale (cnt, dataset->__locales[cnt]); diff --git a/locale/langinfo.h b/locale/langinfo.h index 81696479e5..8cdb104c0d 100644 --- a/locale/langinfo.h +++ b/locale/langinfo.h @@ -1,5 +1,5 @@ -/* nl_langinfo -- Access to locale-dependent parameters. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Access to locale-dependent parameters. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,10 @@ #include <locale.h> /* Define the LC_* category names. */ +/* Get the type definition. */ +#include <nl_types.h> + + __BEGIN_DECLS /* Construct an `nl_item' value for `nl_langinfo' from a locale category @@ -36,7 +40,7 @@ __BEGIN_DECLS /* Enumeration of locale items that can be queried with `nl_langinfo'. */ -typedef enum +enum { /* LC_TIME category: date and time formatting. */ @@ -153,6 +157,9 @@ typedef enum _NL_CTYPE_WIDTH, _NL_CTYPE_MB_CUR_MAX, _NL_CTYPE_CODESET_NAME, +#ifdef __USE_UNIX98 + CODESET = _NL_CTYPE_CODESET_NAME, +#endif _NL_NUM_LC_CTYPE, /* LC_MONETARY category: formatting of monetary quantities. @@ -160,6 +167,9 @@ typedef enum defined in <locale.h>. */ INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0), CURRENCY_SYMBOL, +#ifdef __USE_UNIX98 + CRNCYSTR = CURRENCY_SYMBOL, +#endif MON_DECIMAL_POINT, MON_THOUSANDS_SEP, MON_GROUPING, @@ -178,7 +188,13 @@ typedef enum /* LC_NUMERIC category: formatting of numbers. These also correspond to members of `struct lconv'; see <locale.h>. */ DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0), +#ifdef __USE_UNIX98 + RADIXCHAR = DECIMAL_POINT, +#endif THOUSANDS_SEP, +#ifdef __USE_UNIX98 + THOUSEP = THOUSANDS_SEP, +#endif GROUPING, _NL_NUM_LC_NUMERIC, @@ -190,7 +206,7 @@ typedef enum /* This marks the highest value used. */ _NL_NUM -} nl_item; +}; /* Return the current locale's value for ITEM. diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 0a5e4eebf1..f2ad46f092 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -492,8 +492,9 @@ ctype_output (struct localedef_t *locale, struct charset_t *charset, else { iov[2 + elem + offset].iov_base = alloca ((total + 3) & ~3); - memcpy (iov[2 + elem + offset].iov_base, ctype->codeset_name, - total); + memset (mempcpy (iov[2 + elem + offset].iov_base, + ctype->codeset_name, total), + '\0', 4 - (total & 3)); total = (total + 3) & ~3; } iov[2 + elem + offset].iov_len = total; diff --git a/locale/programs/locale.c b/locale/programs/locale.c index e09e6f1e37..93818e02e2 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -657,7 +657,8 @@ show_info (const char *name) break; case word: { - unsigned int val = (unsigned int) nl_langinfo (item->item_id); + unsigned int val = + (unsigned int) (unsigned long int) nl_langinfo (item->item_id); printf ("%d", val); } break; diff --git a/locale/setlocale.c b/locale/setlocale.c index 42c1e5033a..33599c64db 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -312,8 +312,8 @@ setlocale (int category, const char *locale) /* We must not simply free a global locale since we have no control over the usage. So we mark it as un-deletable. */ - if (newdata[category]->usage_count != MAX_USAGE_COUNT) - newdata[category]->usage_count = MAX_USAGE_COUNT; + if (newdata[category]->usage_count != UNDELETABLE) + newdata[category]->usage_count = UNDELETABLE; } /* Create new composite name. */ @@ -362,8 +362,8 @@ setlocale (int category, const char *locale) Note: do ont remove the `if', it's necessary to copy with the builtin locale data. */ - if (newdata->usage_count != MAX_USAGE_COUNT) - newdata->usage_count = MAX_USAGE_COUNT; + if (newdata->usage_count != UNDELETABLE) + newdata->usage_count = UNDELETABLE; } /* Create new composite name. */ |