Make div by zero fix more concice
This commit is contained in:
parent
67a656a4df
commit
a982e6ab88
1 changed files with 3 additions and 8 deletions
|
@ -1319,18 +1319,13 @@ void ApplyAffineAnimFrameRelativeAndUpdateMatrix(u8 matrixNum, struct AffineAnim
|
||||||
|
|
||||||
s16 ConvertScaleParam(s16 scale)
|
s16 ConvertScaleParam(s16 scale)
|
||||||
{
|
{
|
||||||
s16 ret;
|
|
||||||
s32 val = 0x10000;
|
s32 val = 0x10000;
|
||||||
// UB: possible division by zero
|
// UB: possible division by zero
|
||||||
#ifdef UBFIX
|
#ifdef UBFIX
|
||||||
if (scale != 0)
|
if (scale == 0)
|
||||||
ret = val / scale;
|
return 0;
|
||||||
else
|
|
||||||
ret = 0;
|
|
||||||
#else
|
|
||||||
ret = val / scale;
|
|
||||||
#endif //UBFIX
|
#endif //UBFIX
|
||||||
return ret;
|
return val / scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetAffineAnimFrame(u8 matrixNum, struct Sprite *sprite, struct AffineAnimFrameCmd *frameCmd)
|
void GetAffineAnimFrame(u8 matrixNum, struct Sprite *sprite, struct AffineAnimFrameCmd *frameCmd)
|
||||||
|
|
Loading…
Reference in a new issue