! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Fix compiler warnings (extraneous parentheses)
Status:
RESOLVED: FIXED

Comments

Description Youri Mouton 2015-03-19 09:41:19 CET
Created attachment 6097 
src/client.c and src/netwm.c fixes

I get the following warnings when compiling with clang and attached is a patch to quiet them.


  CC       xfwm4-client.o
client.c:1775:29: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((attr.map_state == IsUnmapped))
             ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
client.c:1775:29: note: remove extraneous parentheses around the comparison to silence this warning
        if ((attr.map_state == IsUnmapped))
            ~               ^            ~
client.c:1775:29: note: use '=' to turn this equality comparison into an assignment
        if ((attr.map_state == IsUnmapped))
                            ^~
                            =
------------------------------------------------------------------------------------

  CC       xfwm4-netwm.o
netwm.c:192:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            if ((atoms[i] == display_info->atoms[NET_WM_STATE_SHADED]))
                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:192:27: note: remove extraneous parentheses around the comparison to silence this warning
            if ((atoms[i] == display_info->atoms[NET_WM_STATE_SHADED]))
                ~         ^                                          ~
netwm.c:192:27: note: use '=' to turn this equality comparison into an assignment
            if ((atoms[i] == display_info->atoms[NET_WM_STATE_SHADED]))
                          ^~
                          =
netwm.c:197:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_STICKY]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:197:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_STICKY]))
                     ~         ^                                          ~
netwm.c:197:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_STICKY]))
                               ^~
                               =
netwm.c:202:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_HORZ]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:202:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_HORZ]))
                     ~         ^                                                  ~
netwm.c:202:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_HORZ]))
                               ^~
                               =
netwm.c:207:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_VERT]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:207:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_VERT]))
                     ~         ^                                                  ~
netwm.c:207:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_MAXIMIZED_VERT]))
                               ^~
                               =
netwm.c:212:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_FULLSCREEN]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:212:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_FULLSCREEN]))
                     ~         ^                                              ~
netwm.c:212:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_FULLSCREEN]))
                               ^~
                               =
netwm.c:220:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_ABOVE]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:220:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_ABOVE]))
                     ~         ^                                         ~
netwm.c:220:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_ABOVE]))
                               ^~
                               =
netwm.c:228:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_BELOW]))
                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netwm.c:228:32: note: remove extraneous parentheses around the comparison to silence this warning
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_BELOW]))
                     ~         ^                                         ~
netwm.c:228:32: note: use '=' to turn this equality comparison into an assignment
            else if ((atoms[i] == display_info->atoms[NET_WM_STATE_BELOW]))
                               ^~
                               =
------------------------------------------------------------------------------------
Comment 1 Olivier Fourdan editbugs 2015-03-27 22:43:25 CET
committed, both branches master and xfwm4-4.12.

Next time, would be great if you could provide a "git format-patch" instead of a bare diff.

Bug #11723

Reported by:
Youri Mouton
Reported on: 2015-03-19
Last modified on: 2015-03-27

People

Assignee:
Olivier Fourdan
CC List:
0 users

Version

Version:
4.12.0

Attachments

src/client.c and src/netwm.c fixes (3.00 KB, application/octet-stream)
2015-03-19 09:41 CET , Youri Mouton
no flags

Additional information