From 5e22c4b3d56d8327d8610faabc8ecfc0c45399de Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Nov 2024 11:06:28 -0800 Subject: [PATCH] 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 Part-of: --- src/xlibi18n/lcUtil.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xlibi18n/lcUtil.c b/src/xlibi18n/lcUtil.c index 2ff86aba..cd4cc774 100644 --- a/src/xlibi18n/lcUtil.c +++ b/src/xlibi18n/lcUtil.c @@ -32,9 +32,10 @@ /* Don't use 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. */