From 535e935a284b2ec96659d1ac40eebf61321f2362 Mon Sep 17 00:00:00 2001 From: Noah Goldstein Date: Wed, 13 Apr 2022 19:46:03 -0500 Subject: Replace {u}int_fast{16|32} with {u}int32_t On 32-bit machines this has no affect. On 64-bit machines {u}int_fast{16|32} are set as {u}int64_t which is often not ideal. Particularly x86_64 this change both saves code size and may save instruction cost. Full xcheck passes on x86_64. --- string/strcoll_l.c | 2 +- string/strxfrm_l.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'string') diff --git a/string/strcoll_l.c b/string/strcoll_l.c index 1b08f11b99..b366020fc7 100644 --- a/string/strcoll_l.c +++ b/string/strcoll_l.c @@ -257,7 +257,7 @@ int STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, locale_t l) { struct __locale_data *current = l->__locales[LC_COLLATE]; - uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word; + uint32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word; /* We don't assign the following values right away since it might be unnecessary in case there are no rules. */ const unsigned char *rulesets; diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c index 5519c3cf8f..188a3d826a 100644 --- a/string/strxfrm_l.c +++ b/string/strxfrm_l.c @@ -49,7 +49,7 @@ /* Group locale data for shorter parameter lists. */ typedef struct { - uint_fast32_t nrules; + uint32_t nrules; unsigned char *rulesets; USTRING_TYPE *weights; int32_t *table; @@ -135,7 +135,7 @@ do_xfrm (const USTRING_TYPE *usrc, STRING_TYPE *dest, size_t n, { int32_t weight_idx; unsigned char rule_idx; - uint_fast32_t pass; + uint32_t pass; size_t needed = 0; size_t last_needed; @@ -404,10 +404,10 @@ static size_t do_xfrm_cached (STRING_TYPE *dest, size_t n, const locale_data_t *l_data, size_t idxmax, int32_t *idxarr, const unsigned char *rulearr) { - uint_fast32_t nrules = l_data->nrules; + uint32_t nrules = l_data->nrules; unsigned char *rulesets = l_data->rulesets; USTRING_TYPE *weights = l_data->weights; - uint_fast32_t pass; + uint32_t pass; size_t needed = 0; size_t last_needed; size_t idxcnt; -- cgit 1.4.1