[PATCH:libXext] Avoid having macros expand code to be: ((f) ? (f)->m1 : NULL)->m2
Thomas Klausner
wiz at NetBSD.org
Wed Jul 18 14:40:18 PDT 2012
>From Matthew R. Green <mrg at NetBSD.org>
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
src/XSync.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/XSync.c b/src/XSync.c
index df7c435..5775293 100644
--- a/src/XSync.c
+++ b/src/XSync.c
@@ -107,8 +107,8 @@ static /* const */ SyncVersionInfo supported_versions[] = {
};
#define NUM_VERSIONS (sizeof(supported_versions)/sizeof(supported_versions[0]))
-#define GET_VERSION(info) ((info) ? (const SyncVersionInfo*)(info)->data : NULL)
-#define IS_VERSION_SUPPORTED(info) (!!GET_VERSION(info))
+#define GET_VERSION(info) ((const SyncVersionInfo*)(info)->data)
+#define IS_VERSION_SUPPORTED(info) (!!(info))
static
const SyncVersionInfo* GetVersionInfo(Display *dpy)
--
1.7.11.1
More information about the xorg-devel
mailing list