diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-21 11:33:26 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-21 11:33:26 -0800 |
commit | 253561cfcc3b95d21046bf08467fa0f68be385da (patch) | |
tree | ca7920326f9cf06b8e4f8327a6ef69a07d4a2ac0 /src | |
parent | 8a10ff647b795b778af58037a8cbc23a03289e9a (diff) |
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 <alan.coopersmith@oracle.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/xcompositeint.h | 4 |
1 files 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_ */ |