GOB: Fix analyser warnings regarding sprintf() parameter signness

This commit is contained in:
Sven Hesse 2011-11-03 16:49:57 +01:00
parent a6dc2ae54b
commit c66afb213b
6 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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() {