[Piglit] [PATCH] glx-swap-event: Fix logical-not-parentheses warning.

Vinson Lee vlee at freedesktop.org
Tue Jun 14 22:57:30 UTC 2016


glx-swap-event.c:161:26: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
                    if ( ! Intel_swap_event == 0 ) {
                         ^                  ~~
glx-swap-event.c:161:26: note: add parentheses after the '!' to evaluate the comparison first
                    if ( ! Intel_swap_event == 0 ) {
                         ^
                           (                    )
glx-swap-event.c:161:26: note: add parentheses around left hand side expression to silence this warning
                    if ( ! Intel_swap_event == 0 ) {
                         ^
                         (                 )

Fixes: b6a0fc0fe54e8 ("glx: Add test for glx swap event's receive and its asynchronization.")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/glx/glx-swap-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/glx/glx-swap-event.c b/tests/glx/glx-swap-event.c
index 74a16cc5c547..7519a51ff4e4 100644
--- a/tests/glx/glx-swap-event.c
+++ b/tests/glx/glx-swap-event.c
@@ -158,7 +158,7 @@ draw_frame(Display *dpy, Window win)
         if (Automatic) {
             if (message_count==2) {
                 if (test_events) {
-                    if ( ! Intel_swap_event == 0 ) {
+                    if ( Intel_swap_event != 0 ) {
                         if (verbose) {
                             printf("glXSwapBuffers is called %d times and there\
  is %d Intel_swap_event received in past %3.1f seconds.\n", swap_count,
-- 
2.7.4



More information about the Piglit mailing list