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

sev- sev at scummvm.org
Mon Sep 11 08:14:01 CEST 2017


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:
cc12c878b7 BBVS: Fix UB shifting negative signed integers


Commit: cc12c878b7faba373ac23aecf798f979122e5bd8
    https://github.com/scummvm/scummvm/commit/cc12c878b7faba373ac23aecf798f979122e5bd8
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-09-11T08:13:58+02:00

Commit Message:
BBVS: Fix UB shifting negative signed integers

These shifted values are replaced with their literal equivalents
as would be calculated on an x86.

Changed paths:
    engines/bbvs/minigames/bbant.cpp


diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index 3c13ee5..72c2d62 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -588,7 +588,7 @@ void MinigameBbAnt::insertBugSmokeObj(int x, int y, int bugObjIndex) {
 		obj->priority = 950;
 		if (bugObj->status >= 4 && (bugObj->status <= 6 || bugObj->status == 8)) {
 			obj->xIncr = 0;
-			obj->yIncr = (-1 << 16);
+			obj->yIncr = -0x10000;
 		} else {
 			obj->xIncr = bugObj->xIncr / 8;
 			obj->yIncr = bugObj->yIncr / 8;
@@ -730,8 +730,8 @@ bool MinigameBbAnt::isBugOutOfScreen(int objIndex) {
 	Obj *obj = &_objects[objIndex];
 
 	return
-		obj->x < (-10 << 16) || obj->x > (330 << 16) ||
-		obj->y < (-10 << 16) || obj->y > (250 << 16);
+		obj->x < -0xa0000 || obj->x > (330 << 16) ||
+		obj->y < -0xa0000 || obj->y > (250 << 16);
 }
 
 void MinigameBbAnt::updateObjAnim3(int objIndex) {
@@ -931,7 +931,7 @@ void MinigameBbAnt::updateFootObj(int objIndex) {
 
 	case 1:
 		obj->xIncr = -0x8000;
-		obj->yIncr = (-4 << 16);
+		obj->yIncr = -0x40000;
 		obj->status = 2;
 		_stompCounter1 += 5;
 		_stompCounter2 = 100;





More information about the Scummvm-git-logs mailing list