Skip to content

Commit

Permalink
Fix warning: suggest parentheses around comparison in operand of ‘!=’
Browse files Browse the repository at this point in the history
spine-c/spine-c/src/spine/Bone.c: In function ‘spBone_updateWorldTransformWith’:
spine-c/spine-c/src/spine/Bone.c:169:64: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
  169 |                                 (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
      |                                                             ~~~^~~
spine-c/spine-c/src/spine/Bone.c: In function ‘spBone_updateAppliedTransform’:
spine-c/spine-c/src/spine/Bone.c:284:76: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
  284 |                                         pid < 0 != (self->skeleton->scaleX < 0 != (self->skeleton->scaleY * yDownScale) < 0))
      |                                                     ~~~~~~~~~~~~~~~~~~~~~~~^~~
spine-c/spine-c/src/spine/Bone.c:284:45: warning: suggest parentheses around comparison in operand of ‘!=’ [-Wparentheses]
  284 |                                         pid < 0 != (self->skeleton->scaleX < 0 != (self->skeleton->scaleY * yDownScale) < 0))
      |                                         ~~~~^~~
  • Loading branch information
jhasse committed Dec 28, 2024
1 parent 2864e32 commit 228f78a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spine-c/spine-c/src/spine/Bone.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void spBone_updateWorldTransformWith(spBone *self, float x, float y, float rotat
zc *= s;
s = SQRT(za * za + zc * zc);
if (self->inherit == SP_INHERIT_NOSCALE &&
(pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
(pa * pd - pb * pc < 0) != ((sx < 0) != (sy < 0)))
s = -s;
rotation = PI / 2 + ATAN2(zc, za);
float zb = COS(rotation) * s;
Expand Down Expand Up @@ -281,7 +281,7 @@ void spBone_updateAppliedTransform(spBone *self) {
pc *= s;
s = SQRT(pa * pa + pc * pc);
if (self->inherit == SP_INHERIT_NOSCALE &&
pid < 0 != (self->skeleton->scaleX < 0 != (self->skeleton->scaleY * yDownScale) < 0))
(pid < 0) != ((self->skeleton->scaleX < 0) != ((self->skeleton->scaleY * yDownScale) < 0)))
s = -s;
r = PI / 2 + ATAN2(pc, pa);
pb = COS(r) * s;
Expand Down

0 comments on commit 228f78a

Please sign in to comment.