[PATCH:xkbutils] XkbQueryExtension returns a Bool, don't use > 0 to check it

Alan Coopersmith alan.coopersmith at oracle.com
Sun Dec 8 13:10:26 PST 2013


We just want to know if XkbQueryExtension returned false, so ! is enough,
don't need > 0 as well.

Reported by cppcheck:
[app/xkbutils/xkbbell.c:205]: (warning) Comparison of a boolean value
 using relational operator (<, >, <= or >=).

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 xkbbell.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xkbbell.c b/xkbbell.c
index ac06b35..95b8604 100644
--- a/xkbbell.c
+++ b/xkbbell.c
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
                 XkbMajorVersion, XkbMinorVersion);
         fprintf(stderr, "         Trying anyway\n");
     }
-    if (!XkbQueryExtension(dpy, &i1, &i2, &i3, &i4, &i5) > 0) {
+    if (!XkbQueryExtension(dpy, &i1, &i2, &i3, &i4, &i5)) {
         if ((i4 != 0) || (i5 != 0))
             fprintf(stderr,
                     "server supports incompatible XKB version %d.%02d\n", i4,
-- 
1.7.9.2



More information about the xorg-devel mailing list