diff options
| author | eriktorbjorn | 2011-06-19 15:13:49 +0200 | 
|---|---|---|
| committer | eriktorbjorn | 2011-06-19 15:13:49 +0200 | 
| commit | 0efea76fff1a68a2050e9b427c383c24a0ab5d8c (patch) | |
| tree | b6bae7420a263c09b12ee631c63a562d34d57c4f | |
| parent | 613a203c8a8ac6175988938fbbceaa47ee8b2877 (diff) | |
| download | scummvm-rg350-0efea76fff1a68a2050e9b427c383c24a0ab5d8c.tar.gz scummvm-rg350-0efea76fff1a68a2050e9b427c383c24a0ab5d8c.tar.bz2 scummvm-rg350-0efea76fff1a68a2050e9b427c383c24a0ab5d8c.zip | |
TSAGE: Silence GCC warnings (hopefully without breaking anything)
There is one remaining warning about 'maxPriority' being set but
not tested in one of the loops in _sfRethinkSoundDrivers(), but
I'm uncertain about that one. Looks like it could be an actual
engine bug.
| -rw-r--r-- | engines/tsage/sound.cpp | 24 | ||||
| -rw-r--r-- | engines/tsage/sound.h | 3 | 
2 files changed, 16 insertions, 11 deletions
| diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 4494656d46..88b2c2abb2 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -232,19 +232,20 @@ void SoundManager::unInstallDriver(int driverNum) {  			// Mute any loaded sounds  			disableSoundServer(); -			for (Common::List<Sound *>::iterator i = _playList.begin(); i != _playList.end(); ++i) -				(*i)->mute(true); +			Common::List<Sound *>::iterator j; +			for (j = _playList.begin(); j != _playList.end(); ++j) +				(*j)->mute(true);  			// Uninstall the driver  			_sfUnInstallDriver(*i);  			// Re-orient all the loaded sounds  -			for (Common::List<Sound *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i) -				(*i)->orientAfterDriverChange(); +			for (j = _soundList.begin(); j != _soundList.end(); ++j) +				(*j)->orientAfterDriverChange();  			// Unmute currently active sounds -			for (Common::List<Sound *>::iterator i = _playList.begin(); i != _playList.end(); ++i) -				(*i)->mute(false); +			for (j = _playList.begin(); j != _playList.end(); ++j) +				(*j)->mute(false);  			enableSoundServer();  		} @@ -549,14 +550,16 @@ bool SoundManager::_sfIsOnPlayList(Sound *sound) {  void SoundManager::_sfRethinkSoundDrivers() {  	// Free any existing entries -	for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { +	int idx; + +	for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) {  		if (sfManager()._voiceTypeStructPtrs[idx]) {  			delete sfManager()._voiceTypeStructPtrs[idx];  			sfManager()._voiceTypeStructPtrs[idx] = NULL;  		}  	} -	for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) { +	for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) {  		byte flag = 0xff;  		int total = 0; @@ -638,7 +641,7 @@ void SoundManager::_sfRethinkSoundDrivers() {  							byteVal = *groupData;  							groupData += 2; -							for (int idx = 0; idx < byteVal; ++idx) { +							for (idx = 0; idx < byteVal; ++idx) {  								VoiceStructEntry ve;  								memset(&ve, 0, sizeof(VoiceStructEntry)); @@ -2462,8 +2465,9 @@ void AdlibSoundDriver::proc32(int channel, int program, int v0, int v1) {  	int offset = READ_LE_UINT16(_patchData + program * 2);  	if (offset) {  		const byte *dataP = _patchData + offset; +		int id; -		for (int offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) { +		for (offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) {  			if ((dataP[offset] <= v0) && (dataP[offset + 1] >= v0)) {  				if (dataP[offset + 2] != 0xff)  					v0 = dataP[offset + 2]; diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 4bef27d2c9..105b2a43bf 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -74,6 +74,7 @@ public:  	int _driverResID;  public:  	SoundDriver(); +	virtual ~SoundDriver() {};  	const Common::String &getShortDriverDescription() { return _shortDescription; }  	const Common::String &getLongDriverDescription() { return _longDescription; } @@ -415,7 +416,7 @@ private:  	void setFrequency(int channel);  public:  	AdlibSoundDriver(); -	~AdlibSoundDriver(); +	virtual ~AdlibSoundDriver();  	virtual bool open();  	virtual void close(); | 
