mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-06 10:17:14 +00:00
TSAGE: Fix undefined behaviour in variadic functions
Passing a type that undergoes default argument promotion as last argument of a variadic function results in undefined behaviour.
This commit is contained in:
parent
9b374acb2b
commit
b1ba071ea8
@ -2358,8 +2358,11 @@ int SceneObject::checkRegion(const Common::Point &pt) {
|
||||
return regionIndex;
|
||||
}
|
||||
|
||||
void SceneObject::animate(AnimateMode animMode, ...) {
|
||||
_animateMode = animMode;
|
||||
// The parameter to the function below should really be an AnimateMode value.
|
||||
// However passing an enum type as last argument of a variadic function may
|
||||
// result in undefined behaviour.
|
||||
void SceneObject::animate(int animMode, ...) {
|
||||
_animateMode = (AnimateMode)animMode;
|
||||
_updateStartFrame = g_globals->_events.getFrameNumber();
|
||||
if (_numFrames)
|
||||
_updateStartFrame += 60 / _numFrames;
|
||||
|
@ -577,7 +577,7 @@ public:
|
||||
void getHorizBounds();
|
||||
int getRegionIndex();
|
||||
int checkRegion(const Common::Point &pt);
|
||||
void animate(AnimateMode animMode, ...);
|
||||
void animate(int animMode, ...);
|
||||
void checkAngle(const SceneObject *obj);
|
||||
void checkAngle(const Common::Point &pt);
|
||||
void hide();
|
||||
|
Loading…
x
Reference in New Issue
Block a user