summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:52:50 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-19 10:55:47 -0800
commit2047abb224051d578a6a320b776a7e8a969a980c (patch)
treeb613e44f2ac07dfe352838c94fb0003d0bb4f6c0
parent5129fc91b8483ec3a11e18280eac00857311edfa (diff)
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 <alan.coopersmith@oracle.com>
-rw-r--r--src/Xfixesint.h4
1 files 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_ */