[Scummvm-cvs-logs] SF.net SVN: scummvm: [21824] scummvm/trunk/engines/sky
khalek at users.sourceforge.net
khalek at users.sourceforge.net
Wed Apr 12 03:03:00 CEST 2006
Revision: 21824
Author: khalek
Date: 2006-04-12 03:01:41 -0700 (Wed, 12 Apr 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=21824&view=rev
Log Message:
-----------
sizeof(void *) != sizeof(int) for a large number of systems.
Fix a lot of debug/error statements that were using %d/%x
for the result of pointer arithmetic.
As C++ apparently has no format string for ptrdiff_t use
%lu/%lx as appropriate.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/sound_adlib.cpp
scummvm/trunk/engines/scumm/he/resource_he.cpp
scummvm/trunk/engines/scumm/player_v1.cpp
scummvm/trunk/engines/scumm/player_v2.cpp
scummvm/trunk/engines/scumm/script_v6.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/sky/control.cpp
Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -769,7 +769,7 @@
}
void AdlibDriver::initChannel(Channel &channel) {
- debugC(9, kDebugLevelSound, "initChannel(%d)", &channel - _channels);
+ debugC(9, kDebugLevelSound, "initChannel(%lu)", &channel - _channels);
memset(&channel.dataptr, 0, sizeof(Channel) - ((char*)&channel.dataptr - (char*)&channel));
channel.tempo = 0xFF;
@@ -781,7 +781,7 @@
}
void AdlibDriver::noteOff(Channel &channel) {
- debugC(9, kDebugLevelSound, "noteOff(%d)", &channel - _channels);
+ debugC(9, kDebugLevelSound, "noteOff(%lu)", &channel - _channels);
// The control channel has no corresponding Adlib channel
@@ -860,7 +860,7 @@
}
void AdlibDriver::setupDuration(uint8 duration, Channel &channel) {
- debugC(9, kDebugLevelSound, "setupDuration(%d, %d)", duration, &channel - _channels);
+ debugC(9, kDebugLevelSound, "setupDuration(%d, %lu)", duration, &channel - _channels);
if (channel.durationRandomness) {
channel.duration = duration + (getRandomNr() & channel.durationRandomness);
return;
@@ -875,7 +875,7 @@
// to noteOn(), which will always play the current note.
void AdlibDriver::setupNote(uint8 rawNote, Channel &channel, bool flag) {
- debugC(9, kDebugLevelSound, "setupNote(%d, %d)", rawNote, &channel - _channels);
+ debugC(9, kDebugLevelSound, "setupNote(%d, %lu)", rawNote, &channel - _channels);
channel.rawNote = rawNote;
@@ -929,7 +929,7 @@
}
void AdlibDriver::setupInstrument(uint8 regOffset, uint8 *dataptr, Channel &channel) {
- debugC(9, kDebugLevelSound, "setupInstrument(%d, %p, %d)", regOffset, (const void *)dataptr, &channel - _channels);
+ debugC(9, kDebugLevelSound, "setupInstrument(%d, %p, %lu)", regOffset, (const void *)dataptr, &channel - _channels);
// Amplitude Modulation / Vibrato / Envelope Generator Type /
// Keyboard Scaling Rate / Modulator Frequency Multiple
writeOPL(0x20 + regOffset, *dataptr++);
@@ -976,7 +976,7 @@
// primary effect 2.
void AdlibDriver::noteOn(Channel &channel) {
- debugC(9, kDebugLevelSound, "noteOn(%d)", &channel - _channels);
+ debugC(9, kDebugLevelSound, "noteOn(%lu)", &channel - _channels);
// The "note on" bit is set, and the current note is played.
@@ -990,7 +990,7 @@
}
void AdlibDriver::adjustVolume(Channel &channel) {
- debugC(9, kDebugLevelSound, "adjustVolume(%d)", &channel - _channels);
+ debugC(9, kDebugLevelSound, "adjustVolume(%lu)", &channel - _channels);
// Level Key Scaling / Total Level
writeOPL(0x43 + _regOffset[_curChannel], calculateOpLevel2(channel));
Modified: scummvm/trunk/engines/scumm/he/resource_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/resource_he.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/scumm/he/resource_he.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -94,13 +94,13 @@
int keycolor = 0;
CachedCursor *cc = findCachedCursor(id);
if (cc != NULL) {
- debug(7, "Found cursor %d in cache slot %d", id, cc - _cursorCache);
+ debug(7, "Found cursor %d in cache slot %lu", id, cc - _cursorCache);
} else {
cc = getCachedCursorSlot();
assert(cc && !cc->valid);
cursorsize = extractResource(id, &cursorRes);
convertIcons(cursorRes, cursorsize, &cc->bitmap, &cc->w, &cc->h, &cc->hotspot_x, &cc->hotspot_y, &keycolor, &cc->palette, &cc->palSize);
- debug(7, "Adding cursor %d to cache slot %d", id, cc - _cursorCache);
+ debug(7, "Adding cursor %d to cache slot %lu", id, cc - _cursorCache);
free(cursorRes);
cc->valid = true;
cc->id = id;
Modified: scummvm/trunk/engines/scumm/player_v1.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v1.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/scumm/player_v1.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -133,7 +133,7 @@
parse_again:
_chunk_type = READ_LE_UINT16(_next_chunk);
- debug(6, "parseSpeakerChunk: sound %d, offset %4x, chunk %x",
+ debug(6, "parseSpeakerChunk: sound %d, offset %lx, chunk %x",
_current_nr, _next_chunk - _current_data, _chunk_type);
_next_chunk += 2;
@@ -209,7 +209,7 @@
_time_left = READ_LE_UINT16(_next_chunk);
_next_chunk += 2;
}
- debug(7, "nextSpeakerCmd: chunk %d, offset %4x: notelen %d",
+ debug(7, "nextSpeakerCmd: chunk %d, offset %4lx: notelen %d",
_chunk_type, _next_chunk - 2 - _current_data, _time_left);
if (_time_left == 0) {
parseSpeakerChunk();
@@ -265,7 +265,7 @@
parse_again:
_chunk_type = READ_LE_UINT16(_next_chunk);
- debug(6, "parsePCjrChunk: sound %d, offset %4x, chunk %x",
+ debug(6, "parsePCjrChunk: sound %d, offset %4lx, chunk %x",
_current_nr, _next_chunk - _current_data, _chunk_type);
_next_chunk += 2;
@@ -351,7 +351,7 @@
}
*_value_ptr_2 = _start_2;
}
- debug(6, "chunk 1: %d: %d step %d for %d, %d: %d step %d for %d",
+ debug(6, "chunk 1: %lu: %d step %d for %d, %lu: %d step %d for %d",
_value_ptr - (uint*)_channels, _start, _delta, _time_left,
_value_ptr_2 - (uint*)_channels, _start_2, _delta_2, _time_left_2);
break;
Modified: scummvm/trunk/engines/scumm/player_v2.cpp
===================================================================
--- scummvm/trunk/engines/scumm/player_v2.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/scumm/player_v2.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -565,14 +565,14 @@
if (opcode >= 0xf8) {
switch (opcode) {
case 0xf8: // set hull curve
- debug(7, "channels[%d]: hull curve %2d",
+ debug(7, "channels[%lu]: hull curve %2d",
channel - _channels, *script_ptr);
channel->d.hull_curve = hull_offsets[*script_ptr / 2];
script_ptr++;
break;
case 0xf9: // set freqmod curve
- debug(7, "channels[%d]: freqmod curve %2d",
+ debug(7, "channels[%lu]: freqmod curve %2d",
channel - _channels, *script_ptr);
channel->d.freqmod_table = freqmod_offsets[*script_ptr / 4];
channel->d.freqmod_modulo = freqmod_lengths[*script_ptr / 4];
@@ -643,7 +643,7 @@
opcode = *script_ptr++;
value = READ_LE_UINT16 (script_ptr);
channel->array[opcode / 2] = value;
- debug(7, "channels[%d]: set param %2d = %5d",
+ debug(7, "channels[%lu]: set param %2d = %5d",
channel - &_channels[0], opcode, value);
script_ptr += 2;
if (opcode == 14) {
@@ -671,7 +671,7 @@
is_last_note = note & 0x80;
note &= 0x7f;
if (note == 0x7f) {
- debug(8, "channels[%d]: pause %d",
+ debug(8, "channels[%lu]: pause %d",
channel - _channels, channel->d.time_left);
goto end;
}
@@ -680,7 +680,7 @@
channel->d.time_left = ((opcode & 7) << 8) | *script_ptr++;
if ((opcode & 0x10)) {
- debug(8, "channels[%d]: pause %d",
+ debug(8, "channels[%lu]: pause %d",
channel - _channels, channel->d.time_left);
goto end;
}
@@ -689,7 +689,7 @@
note = (*script_ptr++) & 0x7f;
}
- debug(8, "channels[%d]: @%04x note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s",
+ debug(8, "channels[%lu]: @%04lx note: %3d+%d len: %2d hull: %d mod: %d/%d/%d %s",
dest_channel - channel, script_ptr ? script_ptr - _current_data - 2 : 0,
note, (signed short) dest_channel->d.transpose, channel->d.time_left,
dest_channel->d.hull_curve, dest_channel->d.freqmod_table,
Modified: scummvm/trunk/engines/scumm/script_v6.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v6.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/scumm/script_v6.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -612,7 +612,7 @@
}
void ScummEngine_v6::o6_invalid() {
- error("Invalid opcode '%x' at %x", _opcode, _scriptPointer - _scriptOrgPointer);
+ error("Invalid opcode '%x' at %lx", _opcode, _scriptPointer - _scriptOrgPointer);
}
void ScummEngine_v6::o6_byteArrayRead() {
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -1994,7 +1994,7 @@
void ScummEngine::errorString(const char *buf1, char *buf2) {
if (_currentScript != 0xFF) {
ScriptSlot *ss = &vm.slot[_currentScript];
- sprintf(buf2, "(%d:%d:0x%X): %s", _roomResource,
+ sprintf(buf2, "(%d:%d:0x%lX): %s", _roomResource,
ss->number, _scriptPointer - _scriptOrgPointer, buf1);
} else {
strcpy(buf2, buf1);
Modified: scummvm/trunk/engines/sky/control.cpp
===================================================================
--- scummvm/trunk/engines/sky/control.cpp 2006-04-12 09:49:08 UTC (rev 21823)
+++ scummvm/trunk/engines/sky/control.cpp 2006-04-12 10:01:41 UTC (rev 21824)
@@ -1421,7 +1421,7 @@
_skyCompact->fetchCpt(cnt)->status = 0;
if (srcPos - srcBuf != (int32)size)
- error("Restore failed! Savegame data = %d bytes. Expected size: %d", srcPos-srcBuf, size);
+ error("Restore failed! Savegame data = %lu bytes. Expected size: %d", srcPos-srcBuf, size);
_skyDisk->refreshFilesList(reloadList);
SkyEngine::_systemVars.currentMusic = (uint16)music;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list