From 4cb567d9a05b4a995a50e2fe178c2e697d339668 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Nov 2024 10:27:39 -0800 Subject: [PATCH] Data: add do ... while (0) to avoid -Wextra-semi-stmt warnings Clears 38 warnings from clang of the form: cmsLkCol.c:155:35: warning: empty expression statement has no effect; remove unnecessary ';' to silence this warning [-Wextra-semi-stmt] Data (dpy, colorname, (long)n); ^ Signed-off-by: Alan Coopersmith Part-of: --- include/X11/Xlibint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index 398037df..b03a2ed1 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -644,13 +644,13 @@ extern void _XFlushGCCache(Display *dpy, GC gc); * "len" is the length of the data buffer. */ #ifndef DataRoutineIsProcedure -#define Data(dpy, data, len) {\ +#define Data(dpy, data, len) do {\ if (dpy->bufptr + (len) <= dpy->bufmax) {\ memcpy(dpy->bufptr, data, (size_t)(len));\ dpy->bufptr += ((size_t)((len) + 3) & (size_t)~3);\ } else\ _XSend(dpy, (_Xconst char*)(data), (long)(len));\ -} +} while (0) #endif /* DataRoutineIsProcedure */