set_toupper: add do { ... } while (0) to avoid -Wextra-semi-stmt warnings

Clears 4 warnings from clang of the form:

lcUtil.c:53:18: warning: empty expression statement has no effect;
 remove unnecessary ';' to silence this warning [-Wextra-semi-stmt]
        set_toupper(ch1);
                        ^

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/272>
This commit is contained in:
Alan Coopersmith 2024-11-10 11:06:28 -08:00
parent 4cb567d9a0
commit 5e22c4b3d5

View file

@ -32,9 +32,10 @@
/* Don't use <ctype.h> here because it is locale dependent. */
#define set_toupper(ch) \
#define set_toupper(ch) do { \
if (ch >= 'a' && ch <= 'z') \
ch = (unsigned char) (ch - 'a' + 'A');
ch = (unsigned char) (ch - 'a' + 'A'); \
} while (0)
/* Compares two ISO 8859-1 strings, ignoring case of ASCII letters.
Like strcasecmp in an ASCII locale. */