aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Hesse2011-11-03 16:49:57 +0100
committerSven Hesse2011-11-03 17:01:54 +0100
commitc66afb213b55c7e65dd317ef4b82276a8704f43f (patch)
tree1070d85ee548a328dfedcc27ae3726a73045ee6a
parenta6dc2ae54b4906bfe75b6b00e54c082630d71c1e (diff)
downloadscummvm-rg350-c66afb213b55c7e65dd317ef4b82276a8704f43f.tar.gz
scummvm-rg350-c66afb213b55c7e65dd317ef4b82276a8704f43f.tar.bz2
scummvm-rg350-c66afb213b55c7e65dd317ef4b82276a8704f43f.zip
GOB: Fix analyser warnings regarding sprintf() parameter signness
-rw-r--r--engines/gob/draw_v1.cpp4
-rw-r--r--engines/gob/draw_v2.cpp4
-rw-r--r--engines/gob/inter_playtoons.cpp2
-rw-r--r--engines/gob/inter_v1.cpp2
-rw-r--r--engines/gob/inter_v2.cpp2
-rw-r--r--engines/gob/inter_v7.cpp2
6 files changed, 8 insertions, 8 deletions
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 8cb88b522c..fb15fdbc19 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 6e64d6fd06..78702f2ec9 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 e05cae354c..f76ba8e97b 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 0eb8be1a03..2d3f2ad731 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 2fea18343d..1e5b7bb24c 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 a36154fe5e..81547f7362 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() {