Wed 17 Sep 2014 07:42:20 AM UTC, comment #4:
I'm not clear that it's incorrect, but I'll readily agree that the more I look at it, the less I like it. I was initially tempted to fix it just by adding the parentheses that don't change meaning but do make it impossible for a human to mis-parse.
But I don't think that would be the Right Thing To Do. From the XineramaQueryVersion man page:
Success is defined in /usr/include/X11/X.h with value zero. But here zero is the error value, so I'm not keen on using the symbolic constant Success, since it is both at odds with the manpage and with the sense of what is happening. If XineramaQueryVersion() returns non-zero, it means that we correctly found the xinerama major and minor version numbers. If it returns 0 (Success), then it means we've failed and should drop out of xinerama_init() without setting rp_have_xinerama.
I think, therefore, that the correct line should be
which, admittedly (and thankfully), must have the same behavior.
|
Sun 14 Sep 2014 07:05:29 PM UTC, comment #2:
>A compiler warning is not a bug.
I am grateful for your advice.
Suggest rework code to ensure that a boolean expression
isn't compared with the value of Success.
Maybe
if (XineramaQueryVersion(dpy, &major, &minor) != Success) {
return;
}
was intended ?
|
Tue 09 Sep 2014 06:35:45 AM UTC, original submission:
David Binderman <dcb314@hotmail.com> reports:
This bug is also in trunk. I just checked.
xinerama.c:50:56: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
if (!XineramaQueryVersion(dpy, &major, &minor) != Success) {
return;
}
Clearly some dubious sanity checking code. Suggest code rework.
|