aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-02 21:04:06 +0000
committerRoland McGrath <roland@gnu.org>2002-08-02 21:04:06 +0000
commit174d73a3bad55f7359c49c82474e9991871d0e2f (patch)
tree2bec465ea339c2c3a5c634b1e3c08a655db04f94 /locale
parentae309ba9e4f88118c23cd925cef2d457a42f4404 (diff)
downloadglibc-174d73a3bad55f7359c49c82474e9991871d0e2f.tar
glibc-174d73a3bad55f7359c49c82474e9991871d0e2f.tar.gz
glibc-174d73a3bad55f7359c49c82474e9991871d0e2f.tar.bz2
glibc-174d73a3bad55f7359c49c82474e9991871d0e2f.zip
2002-08-02 Roland McGrath <roland@redhat.com>
* locale/localeinfo.h (_NL_CURRENT_DATA): New macro. * wcsmbs/wcsmbsload.h (update_conversion_ptrs): Use it. * locale/lc-ctype.c (_nl_postload_ctype): Likewise. * wctype/wctrans.c (wctrans): Likewise. * wctype/wctype.c (__wctype): Likewise. * intl/loadmsgcat.c (_nl_init_domain_conv): Use _NL_CURRENT.
Diffstat (limited to 'locale')
-rw-r--r--locale/lc-ctype.c6
-rw-r--r--locale/localeinfo.h6
2 files changed, 9 insertions, 3 deletions
diff --git a/locale/lc-ctype.c b/locale/lc-ctype.c
index 3fc23948c6..59ff7019aa 100644
--- a/locale/lc-ctype.c
+++ b/locale/lc-ctype.c
@@ -34,6 +34,8 @@ _NL_CURRENT_DEFINE (LC_CTYPE);
void
_nl_postload_ctype (void)
{
+ const struct locale_data *data = _NL_CURRENT_DATA (LC_CTYPE);
+
#define paste(a,b) paste1(a,b)
#define paste1(a,b) a##b
@@ -58,11 +60,11 @@ _nl_postload_ctype (void)
offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_CLASS_OFFSET);
for (cnt = 0; cnt < 12; cnt++)
- __ctype32_wctype[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string;
+ __ctype32_wctype[cnt] = data->values[offset + cnt].string;
offset = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_OFFSET);
for (cnt = 0; cnt < 2; cnt++)
- __ctype32_wctrans[cnt] = _nl_current_LC_CTYPE->values[offset + cnt].string;
+ __ctype32_wctrans[cnt] = data->values[offset + cnt].string;
__ctype32_width = current (char, WIDTH, 0);
}
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 2074569811..3a43469c84 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -158,13 +158,17 @@ extern const char _nl_POSIX_name[] attribute_hidden;
/* The standard codeset. */
extern const char _nl_C_codeset[] attribute_hidden;
+/* Return a pointer to the current `struct locale_data' for CATEGORY. */
+#define _NL_CURRENT_DATA(category) \
+ ((const struct locale_data *) _nl_current_##category)
+
/* Extract the current CATEGORY locale's string for ITEM. */
#define _NL_CURRENT(category, item) \
(_nl_current_##category->values[_NL_ITEM_INDEX (item)].string)
/* Extract the current CATEGORY locale's string for ITEM. */
#define _NL_CURRENT_WSTR(category, item) \
- ((wchar_t *) (_nl_current_##category->values[_NL_ITEM_INDEX (item)].wstr))
+ ((wchar_t *) _nl_current_##category->values[_NL_ITEM_INDEX (item)].wstr)
/* Extract the current CATEGORY locale's word for ITEM. */
#define _NL_CURRENT_WORD(category, item) \