[Scummvm-cvs-logs] scummvm master -> d43af8da796ffc243aff31b8ae31aac714be651d

DrMcCoy drmccoy at drmccoy.de
Thu Nov 3 17:05:09 CET 2011


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

Summary:
c66afb213b GOB: Fix analyser warnings regarding sprintf() parameter signness
d43af8da79 GOB: Fix a very stupid typo in the pathfinder


Commit: c66afb213b55c7e65dd317ef4b82276a8704f43f
    https://github.com/scummvm/scummvm/commit/c66afb213b55c7e65dd317ef4b82276a8704f43f
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-11-03T09:01:54-07:00

Commit Message:
GOB: Fix analyser warnings regarding sprintf() parameter signness

Changed paths:
    engines/gob/draw_v1.cpp
    engines/gob/draw_v2.cpp
    engines/gob/inter_playtoons.cpp
    engines/gob/inter_v1.cpp
    engines/gob/inter_v2.cpp
    engines/gob/inter_v7.cpp



diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 8cb88b5..fb15fdb 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -251,7 +251,7 @@ void Draw_v1::printTotText(int16 id) {
 			cmd = ptrEnd[17] & 0x7F;
 			if (cmd == 0) {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
-				sprintf(buf, "%d", VAR_OFFSET(val));
+				sprintf(buf, "%d", (int32)VAR_OFFSET(val));
 			} else if (cmd == 1) {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
 
@@ -259,7 +259,7 @@ void Draw_v1::printTotText(int16 id) {
 			} else {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
 
-				sprintf(buf, "%d", VAR_OFFSET(val));
+				sprintf(buf, "%d", (int32)VAR_OFFSET(val));
 				if (buf[0] == '-') {
 					while (strlen(buf) - 1 < (uint32)ptrEnd[17]) {
 						_vm->_util->insertStr("0", buf, 1);
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index 6e64d6f..78702f2 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -553,13 +553,13 @@ void Draw_v2::printTotText(int16 id) {
 			cmd = ptrEnd[17] & 0x7F;
 			if (cmd == 0) {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
-				sprintf(buf, "%d",  VAR_OFFSET(val));
+				sprintf(buf, "%d", (int32)VAR_OFFSET(val));
 			} else if (cmd == 1) {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
 				Common::strlcpy(buf, GET_VARO_STR(val), 20);
 			} else {
 				val = READ_LE_UINT16(ptrEnd + 18) * 4;
-				sprintf(buf, "%d",  VAR_OFFSET(val));
+				sprintf(buf, "%d", (int32)VAR_OFFSET(val));
 				if (buf[0] == '-') {
 					while (strlen(buf) - 1 < (uint32)ptrEnd[17]) {
 						_vm->_util->insertStr("0", buf, 1);
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index e05cae3..f76ba8e 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -148,7 +148,7 @@ void Inter_Playtoons::oPlaytoons_printText(OpFuncParams &params) {
 			case TYPE_VAR_INT32:
 			case TYPE_ARRAY_INT32:
 				sprintf(buf + i, "%d",
-						VAR_OFFSET(_vm->_game->_script->readVarIndex()));
+						(int32)VAR_OFFSET(_vm->_game->_script->readVarIndex()));
 				break;
 
 			case TYPE_VAR_STR:
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 0eb8be1..2d3f2ad 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -945,7 +945,7 @@ void Inter_v1::o1_printText(OpFuncParams &params) {
 			case TYPE_VAR_INT32:
 			case TYPE_ARRAY_INT32:
 				sprintf(buf + i, "%d",
-					VAR_OFFSET(_vm->_game->_script->readVarIndex()));
+					(int32)VAR_OFFSET(_vm->_game->_script->readVarIndex()));
 				break;
 
 			case TYPE_VAR_STR:
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 2fea183..1e5b7bb 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1104,7 +1104,7 @@ void Inter_v2::o2_printText(OpFuncParams &params) {
 			case TYPE_VAR_INT32:
 			case TYPE_ARRAY_INT32:
 				sprintf(buf + i, "%d",
-						VAR_OFFSET(_vm->_game->_script->readVarIndex()));
+						(int32)VAR_OFFSET(_vm->_game->_script->readVarIndex()));
 				break;
 
 			case TYPE_VAR_STR:
diff --git a/engines/gob/inter_v7.cpp b/engines/gob/inter_v7.cpp
index a36154f..81547f7 100644
--- a/engines/gob/inter_v7.cpp
+++ b/engines/gob/inter_v7.cpp
@@ -135,7 +135,7 @@ void Inter_v7::o7_intToString() {
 	uint16 valueIndex = _vm->_game->_script->readVarIndex();
 	uint16 destIndex  = _vm->_game->_script->readVarIndex();
 
-	sprintf(GET_VARO_STR(destIndex), "%d", READ_VARO_UINT32(valueIndex));
+	sprintf(GET_VARO_STR(destIndex), "%d", (int32)READ_VARO_UINT32(valueIndex));
 }
 
 void Inter_v7::o7_callFunction() {


Commit: d43af8da796ffc243aff31b8ae31aac714be651d
    https://github.com/scummvm/scummvm/commit/d43af8da796ffc243aff31b8ae31aac714be651d
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2011-11-03T09:01:54-07:00

Commit Message:
GOB: Fix a very stupid typo in the pathfinder

Changed paths:
    engines/gob/map.cpp



diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp
index 57f5f7a..e58cd3c 100644
--- a/engines/gob/map.cpp
+++ b/engines/gob/map.cpp
@@ -373,7 +373,7 @@ void Map::findNearestWalkable(int16 &gobDestX, int16 &gobDestY,
 	int i;
 
 	mapWidth = _screenWidth / _tilesWidth;
-	mapHeight = _vm->_width / _tilesHeight;
+	mapHeight = _vm->_height / _tilesHeight;
 	direction = 0;
 
 	for (i = 1; i <= gobDestX; i++)






More information about the Scummvm-git-logs mailing list