portability: addressed all compilation warnings from MSVC

This commit is contained in:
Hermet Park 2023-10-27 14:09:53 +09:00 committed by Hermet Park
parent bb30db429e
commit f3a2d2a5a6
2 changed files with 4 additions and 4 deletions

View file

@ -545,15 +545,15 @@ struct LottieComposition
return frameCnt() / frameRate; // in second
}
int32_t frameAtTime(float timeInSec) const
float frameAtTime(float timeInSec) const
{
auto p = timeInSec / duration();
if (p < 0.0f) p = 0.0f;
else if (p > 1.0f) p = 1.0f;
return (int32_t)lroundf(p * frameCnt());
return p * frameCnt();
}
uint32_t frameCnt() const
float frameCnt() const
{
return endFrame - startFrame;
}

View file

@ -218,7 +218,7 @@ SwFixed mathLength(const SwPoint& pt)
than 7% compared to the exact value. */
if (v.x < 0) v.x = -v.x;
if (v.y < 0) v.y = -v.y;
return (v.x > v.y) ? (v.x + v.y * 0.375f) : (v.y + v.x * 0.375f);
return static_cast<SwFixed>((v.x > v.y) ? (v.x + v.y * 0.375f) : (v.y + v.x * 0.375f));
}