[Scummvm-git-logs] scummvm master -> b5451ca5a1e6957d12eb4b44ca769031de2fe865

athrxx noreply at scummvm.org
Fri Feb 21 13:49:34 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b5451ca5a1 SCUMM: get rid of UBSan warnings


Commit: b5451ca5a1e6957d12eb4b44ca769031de2fe865
    https://github.com/scummvm/scummvm/commit/b5451ca5a1e6957d12eb4b44ca769031de2fe865
Author: athrxx (athrxx at scummvm.org)
Date: 2025-02-21T14:48:27+01:00

Commit Message:
SCUMM: get rid of UBSan warnings

(about left shifts on negative values)

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 3b072b960a0..0a3370cf305 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -659,11 +659,11 @@ int Actor::actorWalkStep() {
 		return 0;
 	}
 
-	int tmpX = (_pos.x << 16) + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
+	int tmpX = _pos.x * 0x10000 + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
 	_walkdata.xfrac = (uint16)tmpX;
 	_pos.x = (tmpX >> 16);
 
-	int tmpY = (_pos.y << 16) + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
+	int tmpY = _pos.y * 0x10000 + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
 	_walkdata.yfrac = (uint16)tmpY;
 	_pos.y = (tmpY >> 16);
 




More information about the Scummvm-git-logs mailing list