From 2047abb224051d578a6a320b776a7e8a969a980c Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 19 Nov 2022 10:52:50 -0800 Subject: Resolve 36 of 40 -Wextra-semi-stmt warnings from clang Wrap XFixesCheckExtension() & XFixesSimpleCheckExtension() macro bodies in do { ... } while(0) so that they use the semicolon provided by callers instead of letting it dangle as another statement. Signed-off-by: Alan Coopersmith --- src/Xfixesint.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Xfixesint.h b/src/Xfixesint.h index 8a4d5fd..a058f12 100644 --- a/src/Xfixesint.h +++ b/src/Xfixesint.h @@ -55,9 +55,9 @@ XFixesFindDisplay (Display *dpy); #define XFixesHasExtension(i) ((i) && ((i)->codes)) #define XFixesCheckExtension(dpy,i,val) \ - if (!XFixesHasExtension(i)) { return val; } + do { if (!XFixesHasExtension(i)) { return val; } } while(0) #define XFixesSimpleCheckExtension(dpy,i) \ - if (!XFixesHasExtension(i)) { return; } + do { if (!XFixesHasExtension(i)) { return; } } while(0) #endif /* _XFIXESINT_H_ */ -- cgit v1.2.3