#25 Use single '&' to screen flag values

0.2.4
closed-fixed
nobody
5
2014-02-19
2013-01-22
Anonymous
Yes

In src/wildmidi_lib.c, wrong use of '&&' for masking check appears four times.
This typo causes build error with llvm/clang compiler:
| wildmidi_lib.c:2185:25: error: use of logical '&&' with constant operand
| [-Werror,-Wconstant-logical-operand]
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ^ ~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2185:25: note: use '&' for a bitwise operation
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ^~
| &
| wildmidi_lib.c:2185:25: note: remove constant to silence this warning
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ~^~~~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2189:32: error: use of logical '&&' with constant operand
| [-Werror,-Wconstant-logical-operand]
| } else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ^ ~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2189:32: note: use '&' for a bitwise operation
| } else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ^~
| &
| wildmidi_lib.c:2189:32: note: remove constant to silence this warning
| } else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ~^~~~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2423:57: error: use of logical '&&' with constant operand
| [-Werror,-Wconstant-logical-operand]
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ^ ~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2423:57: note: use '&' for a bitwise operation
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ^~
| &
| wildmidi_lib.c:2423:57: note: remove constant to silence this warning
| if (WM_MixerOptions && WM_MO_WHOLETEMPO)
| ~^~~~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2427:64: error: use of logical '&&' with constant operand
| [-Werror,-Wconstant-logical-operand]
| ...} else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ^ ~~~~~~~~~~~~~~~~
| wildmidi_lib.c:2427:64: note: use '&' for a bitwise operation
| ...} else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ^~
| &
| wildmidi_lib.c:2427:64: note: remove constant to silence this warning
| ...} else if (WM_MixerOptions && WM_MO_ROUNDTEMPO)
| ~^~~~~~~~~~~~~~~~~~~
| 4 errors generated.

Discussion

  • bret curtis

    bret curtis - 2014-02-19
    • status: open --> closed-fixed
    • private: No --> Yes
    • Group: --> 0.2.4
     

Log in to post a comment.