mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-03 23:31:57 +00:00
GOB: Fix analyser warnings regarding sprintf() parameter signness
This commit is contained in:
parent
a6dc2ae54b
commit
c66afb213b
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -148,7 +148,7 @@ void Inter_Playtoons::oPlaytoons_printText(OpFuncParams ¶ms) {
|
||||
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:
|
||||
|
@ -945,7 +945,7 @@ void Inter_v1::o1_printText(OpFuncParams ¶ms) {
|
||||
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:
|
||||
|
@ -1104,7 +1104,7 @@ void Inter_v2::o2_printText(OpFuncParams ¶ms) {
|
||||
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:
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user