From 5d0bbaaf3a253601974ec9bc30f49fc4452d12ed Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 21 Nov 2002 03:41:31 +0000 Subject: * scripts/abilist.awk: Grok function descriptor symbols. * intl/tst-gettext.c (main): Check return values from setlocale. Add necessary unsetenv's to make LANG=existing-locale check work. * intl/tst-gettext.sh: Use mkdir -p. Copy test files unconditionally, so aborted prior runs don't confuse things. * locale/localeinfo.h (struct locale_data: union locale_data_value): Use uintptr_t instead of unsigned int for `word' member. (_NL_CURRENT_WORD): Cast to uint32_t. * posix/bug-regex5.c (main): Use union to extract _NL_COLLATE_NRULES value. --- locale/localeinfo.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'locale') diff --git a/locale/localeinfo.h b/locale/localeinfo.h index 28256e9..a9fa1f4 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -78,7 +78,11 @@ struct locale_data { const uint32_t *wstr; const char *string; - unsigned int word; + /* The values we store here are always uint32_t in fact. But it's + safer for the union to use a type that matches pointers so that + casting one of the pointer values to uint32_t produces the right + value for big-endian 64-bit platforms. */ + uintptr_t word; } values __flexarr; /* Items, usually pointers into `filedata'. */ }; @@ -232,7 +236,7 @@ extern __thread struct locale_data *const *_nl_current_##category \ /* Extract the current CATEGORY locale's word for ITEM. */ #define _NL_CURRENT_WORD(category, item) \ - ((*_nl_current_##category)->values[_NL_ITEM_INDEX (item)].word) + ((uint32_t) (*_nl_current_##category)->values[_NL_ITEM_INDEX (item)].word) /* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */ #define _NL_CURRENT_DEFINE(category) \ @@ -268,7 +272,7 @@ extern __thread struct locale_data *const *_nl_current_##category \ /* Extract the current CATEGORY locale's word for ITEM. */ # define _NL_CURRENT_WORD(category, item) \ - (_NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].word) + ((uint32_t) _NL_CURRENT_DATA (category)->values[_NL_ITEM_INDEX (item)].word) /* This is used in lc-CATEGORY.c to define _nl_current_CATEGORY. */ # define _NL_CURRENT_DEFINE(category) \ -- cgit v1.1