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. --- iconv/gconv_simple.c | 4 ++-- iconv/gconv_trans.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'iconv') diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c index be8504791b..640068d9ba 100644 --- a/iconv/gconv_simple.c +++ b/iconv/gconv_simple.c @@ -959,8 +959,8 @@ ucs4le_internal_loop_single (struct __gconv_step *step, } \ else \ { \ - uint_fast32_t cnt; \ - uint_fast32_t i; \ + unsigned int cnt; \ + unsigned int i; \ \ if (ch >= 0xc2 && ch < 0xe0) \ { \ diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c index 0101332d61..1ebbbfd51b 100644 --- a/iconv/gconv_trans.c +++ b/iconv/gconv_trans.c @@ -37,15 +37,15 @@ __gconv_transliterate (struct __gconv_step *step, unsigned char **outbufstart, size_t *irreversible) { /* Find out about the locale's transliteration. */ - uint_fast32_t size; + uint32_t size; const uint32_t *from_idx; const uint32_t *from_tbl; const uint32_t *to_idx; const uint32_t *to_tbl; const uint32_t *winbuf; const uint32_t *winbufend; - uint_fast32_t low; - uint_fast32_t high; + uint32_t low; + uint32_t high; /* The input buffer. There are actually 4-byte values. */ winbuf = (const uint32_t *) *inbufp; @@ -85,7 +85,7 @@ __gconv_transliterate (struct __gconv_step *step, high = size; while (low < high) { - uint_fast32_t med = (low + high) / 2; + uint32_t med = (low + high) / 2; uint32_t idx; int cnt; @@ -111,7 +111,7 @@ __gconv_transliterate (struct __gconv_step *step, do { /* Determine length of replacement. */ - uint_fast32_t len = 0; + unsigned int len = 0; int res; const unsigned char *toinptr; unsigned char *outptr; -- cgit 1.4.1