From 17d90bda87dd445a974de7e644629593ade617d8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 7 Oct 2022 15:19:39 -0400 Subject: Use uppercase integer literal suffixes --- src/internal.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/internal.c') diff --git a/src/internal.c b/src/internal.c index 69f220e..dd1b7f1 100644 --- a/src/internal.c +++ b/src/internal.c @@ -67,29 +67,29 @@ puglDecodeUTF8(const uint8_t* buf) } if (buf[0] < 0xE0) { - FAIL_IF((buf[1] & 0xC0u) != 0x80); - return ((uint32_t)buf[0] << 6u) + buf[1] - 0x3080u; + FAIL_IF((buf[1] & 0xC0U) != 0x80); + return ((uint32_t)buf[0] << 6U) + buf[1] - 0x3080U; } if (buf[0] < 0xF0) { - FAIL_IF((buf[1] & 0xC0u) != 0x80); + FAIL_IF((buf[1] & 0xC0U) != 0x80); FAIL_IF(buf[0] == 0xE0 && buf[1] < 0xA0); - FAIL_IF((buf[2] & 0xC0u) != 0x80); - return ((uint32_t)buf[0] << 12u) + // - ((uint32_t)buf[1] << 6u) + // - ((uint32_t)buf[2] - 0xE2080u); + FAIL_IF((buf[2] & 0xC0U) != 0x80); + return ((uint32_t)buf[0] << 12U) + // + ((uint32_t)buf[1] << 6U) + // + ((uint32_t)buf[2] - 0xE2080U); } if (buf[0] < 0xF5) { - FAIL_IF((buf[1] & 0xC0u) != 0x80); + FAIL_IF((buf[1] & 0xC0U) != 0x80); FAIL_IF(buf[0] == 0xF0 && buf[1] < 0x90); FAIL_IF(buf[0] == 0xF4 && buf[1] >= 0x90); - FAIL_IF((buf[2] & 0xC0u) != 0x80u); - FAIL_IF((buf[3] & 0xC0u) != 0x80u); - return (((uint32_t)buf[0] << 18u) + // - ((uint32_t)buf[1] << 12u) + // - ((uint32_t)buf[2] << 6u) + // - ((uint32_t)buf[3] - 0x3C82080u)); + FAIL_IF((buf[2] & 0xC0U) != 0x80U); + FAIL_IF((buf[3] & 0xC0U) != 0x80U); + return (((uint32_t)buf[0] << 18U) + // + ((uint32_t)buf[1] << 12U) + // + ((uint32_t)buf[2] << 6U) + // + ((uint32_t)buf[3] - 0x3C82080U)); } return 0xFFFD; -- cgit v1.2.1