From: Florian Forster Date: Fri, 22 Dec 2023 14:32:30 +0000 (+0100) Subject: utf8: Make `decode` a void function -- its return value is always ignored. X-Git-Tag: 6.0.0-rc0~22^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ddad2acb9a6a6afec222c73dd8e2055db627a0d;p=thirdparty%2Fcollectd.git utf8: Make `decode` a void function -- its return value is always ignored. --- diff --git a/src/utils/utf8/utf8.c b/src/utils/utf8/utf8.c index 2d3bd89b9..d5c5f07c7 100644 --- a/src/utils/utf8/utf8.c +++ b/src/utils/utf8/utf8.c @@ -46,14 +46,13 @@ static const uint8_t utf8d[] = { }; // clang-format on -static uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte) { +static void decode(uint32_t *state, uint32_t *codep, uint32_t byte) { uint32_t type = utf8d[byte]; *codep = (*state != UTF8_ACCEPT) ? (byte & 0x3fu) | (*codep << 6) : (0xff >> type) & (byte); - *state = utf8d[256 + *state * 16 + type]; - return *state; + *state = utf8d[256 + (*state) * 16 + type]; } bool utf8_valid(char const *s) {