[Scummvm-cvs-logs] scummvm master -> 0efea76fff1a68a2050e9b427c383c24a0ab5d8c

eriktorbjorn eriktorbjorn at telia.com
Sun Jun 19 15:18:11 CEST 2011


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:
0efea76fff TSAGE: Silence GCC warnings (hopefully without breaking anything)


Commit: 0efea76fff1a68a2050e9b427c383c24a0ab5d8c
    https://github.com/scummvm/scummvm/commit/0efea76fff1a68a2050e9b427c383c24a0ab5d8c
Author: eriktorbjorn (eriktorbjorn at users.sourceforge.net)
Date: 2011-06-19T06:13:49-07:00

Commit Message:
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.

Changed paths:
    engines/tsage/sound.cpp
    engines/tsage/sound.h



diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 4494656..88b2c2a 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 4bef27d..105b2a4 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();






More information about the Scummvm-git-logs mailing list