Skip to content

Commit

Permalink
AGOS: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Nov 2, 2011
1 parent d0bb81f commit 0e1affc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion engines/agos/draw.cpp
Expand Up @@ -776,7 +776,7 @@ void AGOSEngine::setMoveRect(uint16 x, uint16 y, uint16 width, uint16 height) {
void AGOSEngine::displayScreen() {
if (_fastFadeInFlag == 0 && _paletteFlag == 1) {
_paletteFlag = 0;
if (memcmp(_displayPalette, _currentPalette, sizeof(_currentPalette))) {
if (memcmp(_displayPalette, _currentPalette, sizeof(_currentPalette)) != 0) {
memcpy(_currentPalette, _displayPalette, sizeof(_displayPalette));
_system->getPaletteManager()->setPalette(_displayPalette, 0, 256);
}
Expand Down
6 changes: 3 additions & 3 deletions engines/agos/midi.cpp
Expand Up @@ -478,7 +478,7 @@ void MidiPlayer::loadMultipleSMF(Common::File *in, bool sfx) {

// Make sure there's a MThd
in->read(buf, 4);
if (memcmp(buf, "MThd", 4)) {
if (memcmp(buf, "MThd", 4) != 0) {
warning("Expected MThd but found '%c%c%c%c' instead", buf[0], buf[1], buf[2], buf[3]);
return;
}
Expand All @@ -487,7 +487,7 @@ void MidiPlayer::loadMultipleSMF(Common::File *in, bool sfx) {
// Now skip all the MTrk blocks
while (true) {
in->read(buf, 4);
if (memcmp(buf, "MTrk", 4))
if (memcmp(buf, "MTrk", 4) != 0)
break;
in->seek(in->readUint32BE(), SEEK_CUR);
}
Expand Down Expand Up @@ -524,7 +524,7 @@ void MidiPlayer::loadXMIDI(Common::File *in, bool sfx) {
memcpy(buf, &buf[2], 2);
in->read(&buf[2], 2);
}
if (memcmp(buf, "CAT ", 4)) {
if (memcmp(buf, "CAT ", 4) != 0) {
error("Could not find 'CAT ' tag to determine resource size");
}
size += 4 + in->readUint32BE();
Expand Down
4 changes: 2 additions & 2 deletions engines/agos/res_snd.cpp
Expand Up @@ -495,7 +495,7 @@ void AGOSEngine::loadSound(uint16 sound, int16 pan, int16 vol, uint16 type) {
}

if (getPlatform() == Common::kPlatformAmiga)
sprintf(filename, "sfx%d.wav", file);
sprintf(filename, "sfx%u.wav", file);
else
sprintf(filename, "effects.wav");

Expand Down Expand Up @@ -606,7 +606,7 @@ void AGOSEngine::loadVoice(uint speechId) {
}

if (getPlatform() == Common::kPlatformAmiga)
sprintf(filename, "sp%d.wav", file);
sprintf(filename, "sp%u.wav", file);
else
sprintf(filename, "speech.wav");

Expand Down
4 changes: 2 additions & 2 deletions engines/agos/sound.cpp
Expand Up @@ -799,12 +799,12 @@ void Sound::switchVoiceFile(const GameSpecificSettings *gss, uint disc) {
Common::File *file = new Common::File();

if (!_hasVoiceFile) {
sprintf(filename, "%s%d", gss->speech_filename, disc);
sprintf(filename, "%s%u", gss->speech_filename, disc);
_voice = makeCompressedSound(_mixer, file, filename);
_hasVoiceFile = (_voice != 0);
}
if (!_hasVoiceFile) {
sprintf(filename, "%s%d.wav", gss->speech_filename, disc);
sprintf(filename, "%s%u.wav", gss->speech_filename, disc);
file->open(filename);
if (file->isOpen() == false) {
error("switchVoiceFile: Can't load voice file %s", filename);
Expand Down
1 change: 0 additions & 1 deletion engines/agos/subroutine.cpp
Expand Up @@ -558,7 +558,6 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
while ((byte *)sl != (byte *)sub) {
_currentLine = sl;
if (checkIfToRunSubroutineLine(sl, sub)) {
result = 0;
_codePtr = (byte *)sl;
if (sub->id)
_codePtr += 2;
Expand Down

0 comments on commit 0e1affc

Please sign in to comment.