[Scummvm-git-logs] scummvm master -> 5d340d244cc21f93b3cb7f46228fb767d9d16cd9

digitall dgturner at iee.org
Tue Oct 16 14:24:54 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:
5d340d244c LASTEXPRESS: Fix Compiler Warning in Sound Code.


Commit: 5d340d244cc21f93b3cb7f46228fb767d9d16cd9
    https://github.com/scummvm/scummvm/commit/5d340d244cc21f93b3cb7f46228fb767d9d16cd9
Author: D G Turner (digitall at scummvm.org)
Date: 2018-10-16T13:30:44+01:00

Commit Message:
LASTEXPRESS: Fix Compiler Warning in Sound Code.

The SoundFlag type is an enumeration which have a default underlying
type of unsigned int in most case.

Thus comparing this to -1 causes a compiler warning. Since the default
entity sound flag type is 0xFFFF... which is equivalent to -1, then
replacing this with the correct enum symbol fixes the issue and should
result in the correct behaviour. Examination of the resulting code line
seems to confirm that this is the correct expected logic.

Changed paths:
    engines/lastexpress/sound/sound.cpp


diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp
index a226250..c8240e9 100644
--- a/engines/lastexpress/sound/sound.cpp
+++ b/engines/lastexpress/sound/sound.cpp
@@ -139,7 +139,7 @@ void SoundManager::playSound(EntityIndex entity, Common::String filename, SoundF
 	if (_queue->isBuffered(entity) && entity && entity < kEntityTrain)
 		_queue->removeFromQueue(entity);
 
-	SoundFlag currentFlag = (flag == -1) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000);
+	SoundFlag currentFlag = (flag == kSoundVolumeEntityDefault) ? getSoundFlag(entity) : (SoundFlag)(flag | 0x80000);
 
 	// Add .SND at the end of the filename if needed
 	if (!filename.contains('.'))





More information about the Scummvm-git-logs mailing list