summaryrefslogtreecommitdiff
path: root/locale/localeinfo.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-11-21 03:41:31 +0000
committerRoland McGrath <roland@gnu.org>2002-11-21 03:41:31 +0000
commit5d0bbaaf3a253601974ec9bc30f49fc4452d12ed (patch)
tree628c2cfc45c98444356af3891817839f87e737e2 /locale/localeinfo.h
parent9a5b9056e0b3db14d5f15c10d9c4114568c5d65b (diff)
* 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.
Diffstat (limited to 'locale/localeinfo.h')
-rw-r--r--locale/localeinfo.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 28256e9a2b..a9fa1f41f0 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) \