From 821fac3648d9628d4b53dedb94a2209fc31a774a Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 14 Aug 2023 13:59:50 +1200 Subject: [PATCH] wind: Use portable integer types Signed-off-by: Joseph Sutton --- lib/wind/utf8.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/wind/utf8.c b/lib/wind/utf8.c index 1922a0698..5d707a9dc 100644 --- a/lib/wind/utf8.c +++ b/lib/wind/utf8.c @@ -38,11 +38,11 @@ static int utf8toutf32(const unsigned char **pp, uint32_t *out) { const unsigned char *p = *pp; - unsigned c = *p; + uint32_t c = *p; if (c & 0x80) { if ((c & 0xE0) == 0xC0) { - const unsigned c2 = *++p; + const uint32_t c2 = *++p; if ((c2 & 0xC0) == 0x80) { *out = ((c & 0x1F) << 6) | (c2 & 0x3F); @@ -50,9 +50,9 @@ utf8toutf32(const unsigned char **pp, uint32_t *out) return WIND_ERR_INVALID_UTF8; } } else if ((c & 0xF0) == 0xE0) { - const unsigned c2 = *++p; + const uint32_t c2 = *++p; if ((c2 & 0xC0) == 0x80) { - const unsigned c3 = *++p; + const uint32_t c3 = *++p; if ((c3 & 0xC0) == 0x80) { *out = ((c & 0x0F) << 12) | ((c2 & 0x3F) << 6) @@ -64,11 +64,11 @@ utf8toutf32(const unsigned char **pp, uint32_t *out) return WIND_ERR_INVALID_UTF8; } } else if ((c & 0xF8) == 0xF0) { - const unsigned c2 = *++p; + const uint32_t c2 = *++p; if ((c2 & 0xC0) == 0x80) { - const unsigned c3 = *++p; + const uint32_t c3 = *++p; if ((c3 & 0xC0) == 0x80) { - const unsigned c4 = *++p; + const uint32_t c4 = *++p; if ((c4 & 0xC0) == 0x80) { *out = ((c & 0x07) << 18) | ((c2 & 0x3F) << 12)