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 <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 10:27:39 -08:00
parent 9ab8f6a5f7
commit 4cb567d9a0

View file

@ -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 */