[Scummvm-git-logs] scummvm master -> 733cb7dcc728763b65eab9b11d955e1aa13e16ad
digitall
dgturner at iee.org
Sun Jul 29 04:28:47 CEST 2018
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:
733cb7dcc7 CRYO: Fix Debug Statement Format String Compiler Warnings.
Commit: 733cb7dcc728763b65eab9b11d955e1aa13e16ad
https://github.com/scummvm/scummvm/commit/733cb7dcc728763b65eab9b11d955e1aa13e16ad
Author: D G Turner (digitall at scummvm.org)
Date: 2018-07-29T03:32:40+01:00
Commit Message:
CRYO: Fix Debug Statement Format String Compiler Warnings.
Some of the debug statements in the engine compute values or sizes of
various items by pointer subtraction (which is probably not recommended;
I am not sure if this is why some of the structs were previous packed as
noted and removed by snover).
In any case, the subtractions should result in relatively small integer
values, but using these into debug() calls with printf style format
strings can cause warnings from the compiler with the format specifier
depending on the underlying pointer sizes.
To avoid these, have recast these to int. If this does cause any issues,
they should be limited to debug() value changes and thus not a
functional issue with the engine, which can be corrected by the engine
developers.
Changed paths:
engines/cryo/eden.cpp
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index c4a76a4..bf8fbe4 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -2012,7 +2012,7 @@ void EdenGame::loadCharacter(perso_t *perso) {
ptr += READ_LE_UINT16(ptr) - 2;
_globals->_persoSpritePtr = baseptr;
_globals->_persoSpritePtr2 = baseptr + READ_LE_UINT16(ptr);
- debug("load perso: b6 len is %ld", _globals->_persoSpritePtr2 - _globals->_persoSpritePtr);
+ debug("load perso: b6 len is %d", (int)(_globals->_persoSpritePtr2 - _globals->_persoSpritePtr));
} else {
useBank(_globals->_characterImageBank);
_characterBankData = _bankData;
@@ -3182,7 +3182,7 @@ void EdenGame::dialautooff() {
void EdenGame::follow() {
if (_globals->_roomCharacterType == PersonFlags::pfType12) {
- debug("follow: hiding person %ld", _globals->_roomCharacterPtr - _persons);
+ debug("follow: hiding person %d", (int)(_globals->_roomCharacterPtr - _persons));
_globals->_roomCharacterPtr->_flags |= PersonFlags::pf80;
_globals->_roomCharacterPtr->_roomNum = 0;
_globals->_gameFlags |= GameFlags::gfFlag8;
@@ -5845,7 +5845,7 @@ void EdenGame::perso_ici(int16 action) {
// Original name: setpersohere
void EdenGame::setCharacterHere() {
- debug("setCharacterHere, perso is %ld", _globals->_characterPtr - _persons);
+ debug("setCharacterHere, perso is %d", (int)(_globals->_characterPtr - _persons));
_globals->_partyOutside = 0;
_globals->_party = 0;
_globals->_roomCharacterPtr = nullptr;
@@ -5871,7 +5871,7 @@ void EdenGame::faire_suivre(int16 roomNum) {
// Original name: suis_moi5
void EdenGame::AddCharacterToParty() {
- debug("adding person %ld to party", _globals->_characterPtr - _persons);
+ debug("adding person %d to party", (int)(_globals->_characterPtr - _persons));
_globals->_characterPtr->_flags |= PersonFlags::pfInParty;
_globals->_characterPtr->_roomNum = _globals->_roomNum;
_globals->_party |= _globals->_characterPtr->_partyMask;
@@ -5888,7 +5888,7 @@ void EdenGame::addToParty(int16 index) {
// Original name: reste_ici5
void EdenGame::removeCharacterFromParty() {
- debug("removing person %ld from party", _globals->_characterPtr - _persons);
+ debug("removing person %d from party", (int)(_globals->_characterPtr - _persons));
_globals->_characterPtr->_flags &= ~PersonFlags::pfInParty;
_globals->_partyOutside |= _globals->_characterPtr->_partyMask;
_globals->_party &= ~_globals->_characterPtr->_partyMask;
More information about the Scummvm-git-logs
mailing list