Page MenuHome

Suppress warning in gpencil_paint.c with parentheses around logical operators
Needs ReviewPublic

Authored by Stephan Seitz (theHamsta) on Feb 13 2021, 12:33 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Suppress warning in gpencil_paint.c with parentheses around logical operators

This suppresses the following warning on clang-13 (and -Wparenthesis on
gcc) by clarifying the precedence of && over ||.

../source/blender/editors/gpencil/gpencil_paint.c:1239:21: warning: '&&' within '||' [-Wlogical-op-parentheses]
    if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
        ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
../source/blender/editors/gpencil/gpencil_paint.c:1239:21: note: place parentheses around the '&&' expression to silence this warning
    if ((!is_depth) && ((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || is_camera) {
                    ^
        (                                                                        )

Diff Detail

Event Timeline

Stephan Seitz (theHamsta) requested review of this revision.Feb 13 2021, 12:33 AM
Stephan Seitz (theHamsta) created this revision.