From 253561cfcc3b95d21046bf08467fa0f68be385da Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 21 Nov 2022 11:33:26 -0800 Subject: Wrap XComposite*CheckExtension() in do { ... } while(0) Makes macro expansion safer and eliminates -Wextra-semi-stmt warnings from clang every time it is called due to semicolon after bracket. Signed-off-by: Alan Coopersmith --- src/xcompositeint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xcompositeint.h b/src/xcompositeint.h index f9f1b46..c2247bf 100644 --- a/src/xcompositeint.h +++ b/src/xcompositeint.h @@ -76,9 +76,9 @@ XCompositeFindDisplay (Display *dpy); #define XCompositeHasExtension(i) ((i) && ((i)->codes)) #define XCompositeCheckExtension(dpy,i,val) \ - if (!XCompositeHasExtension(i)) { return val; } + do { if (!XCompositeHasExtension(i)) { return val; } } while (0) #define XCompositeSimpleCheckExtension(dpy,i) \ - if (!XCompositeHasExtension(i)) { return; } + do { if (!XCompositeHasExtension(i)) { return; } } while (0) #endif /* _XCOMPOSITEINT_H_ */ -- cgit v1.2.3