[Scummvm-cvs-logs] scummvm master -> 190a656c08914db94d09f1829312e78aa8084a87

sev- sev at scummvm.org
Sun Mar 30 15:22:27 CEST 2014


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4d02f67bd1 ALL: Resolve multiple clang warnings
190a656c08 Merge pull request #456 from fingolfin/clang-fixes


Commit: 4d02f67bd1dc3b7fc9eb8729f92a4d5d41a6831a
    https://github.com/scummvm/scummvm/commit/4d02f67bd1dc3b7fc9eb8729f92a4d5d41a6831a
Author: Max Horn (max at quendi.de)
Date: 2014-03-30T14:38:02+02:00

Commit Message:
ALL: Resolve multiple clang warnings

Changed paths:
    audio/mixer.cpp
    engines/avalanche/dialogs.cpp
    engines/cruise/font.cpp
    engines/cruise/function.cpp
    engines/cruise/saveload.cpp
    engines/cruise/vars.cpp
    engines/cruise/vars.h
    engines/groovie/roq.cpp
    engines/groovie/roq.h
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/animation.h
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/data/sequence.h
    engines/parallaction/saveload.h
    engines/scumm/gfx.cpp
    engines/scumm/saveload.cpp
    engines/zvision/fonts/truetype_font.cpp
    engines/zvision/fonts/truetype_font.h
    test/common/util.h
    test/cxxtest_mingw.h



diff --git a/audio/mixer.cpp b/audio/mixer.cpp
index 0620d07..16cf564 100644
--- a/audio/mixer.cpp
+++ b/audio/mixer.cpp
@@ -333,7 +333,7 @@ void MixerImpl::stopHandle(SoundHandle handle) {
 }
 
 void MixerImpl::muteSoundType(SoundType type, bool mute) {
-	assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings));
+	assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings));
 	_soundTypeSettings[type].mute = mute;
 
 	for (int i = 0; i != NUM_CHANNELS; ++i) {
@@ -343,7 +343,7 @@ void MixerImpl::muteSoundType(SoundType type, bool mute) {
 }
 
 bool MixerImpl::isSoundTypeMuted(SoundType type) const {
-	assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings));
+	assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings));
 	return _soundTypeSettings[type].mute;
 }
 
@@ -468,7 +468,7 @@ bool MixerImpl::hasActiveChannelOfType(SoundType type) {
 }
 
 void MixerImpl::setVolumeForSoundType(SoundType type, int volume) {
-	assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings));
+	assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings));
 
 	// Check range
 	if (volume > kMaxMixerVolume)
@@ -489,7 +489,7 @@ void MixerImpl::setVolumeForSoundType(SoundType type, int volume) {
 }
 
 int MixerImpl::getVolumeForSoundType(SoundType type) const {
-	assert(0 <= type && type < ARRAYSIZE(_soundTypeSettings));
+	assert(0 <= (int)type && (int)type < ARRAYSIZE(_soundTypeSettings));
 
 	return _soundTypeSettings[type].volume;
 }
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index dc1c277..b7b03e8 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -363,6 +363,7 @@ void Dialogs::scrollModeMusic() {
 					value = 11;
 					break;
 				default:
+					error("cannot happen");
 					break;
 				}
 
diff --git a/engines/cruise/font.cpp b/engines/cruise/font.cpp
index c63be30..80fb0e8 100644
--- a/engines/cruise/font.cpp
+++ b/engines/cruise/font.cpp
@@ -148,8 +148,6 @@ void initSystem() {
 		preloadData[i].nofree = 0;
 	}
 
-	lowMemory = 0;
-
 	doFade = 0;
 	fadeFlag = 0;
 	scroll = 0;
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index e727ac7..7af6b73 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -606,7 +606,7 @@ int16 Op_InitializeState() {
 }
 
 int16 Op_GetlowMemory() {
-	return lowMemory;
+	return 0;
 }
 
 int16 Op_AniDir() {
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index a991c29..a734db4 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -182,11 +182,13 @@ static void syncFilesDatabase(Common::Serializer &s) {
 		s.syncAsUint16LE(fe.resType);
 		s.syncAsUint16LE(fe.height);
 
-		// TODO: Have a look at the saving/loading of this pointer
+		// Remember whether this file database was open or not.
+		// Upon loading, loadSavegameData uses this information
+		// in order to re-open the file databases accordingly.
 		tmp = (fe.subData.ptr) ? 1 : 0;
 		s.syncAsUint32LE(tmp);
 		if (s.isLoading()) {
-			fe.subData.ptr = (uint8 *)tmp;
+			fe.subData.ptr = tmp ? (uint8 *)1 : 0;
 		}
 
 		s.syncAsSint16LE(fe.subData.index);
@@ -195,11 +197,11 @@ static void syncFilesDatabase(Common::Serializer &s) {
 
 		s.syncAsSint16LE(fe.subData.transparency);
 
-		// TODO: Have a look at the saving/loading of this pointer
+		// Treat fe.subData.ptrMask the same as fe.subData.ptr.
 		tmp = (fe.subData.ptrMask) ? 1 : 0;
 		s.syncAsUint32LE(tmp);
 		if (s.isLoading()) {
-			fe.subData.ptrMask = (uint8 *)tmp;
+			fe.subData.ptrMask = tmp ? (uint8 *)1 : 0;
 		}
 
 		s.syncAsUint16LE(fe.subData.resourceType);
@@ -806,7 +808,6 @@ Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName)
 }
 
 Common::Error loadSavegameData(int saveGameIdx) {
-	int lowMemorySave;
 	Common::String saveName;
 	cellStruct *currentcellHead;
 
@@ -878,20 +879,19 @@ Common::Error loadSavegameData(int saveGameIdx) {
 
 	lastAni[0] = 0;
 
-	lowMemorySave = lowMemory;
-
 	for (int i = 0; i < NUM_FILE_ENTRIES; i++) {
 		if (filesDatabase[i].subData.ptr) {
 			int j;
 			int k;
 
-			for (j = i + 1; j < NUM_FILE_ENTRIES && filesDatabase[j].subData.ptr && !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) && (filesDatabase[j].subData.index == (j - i)); j++)
+			for (j = i + 1; j < NUM_FILE_ENTRIES &&
+			        filesDatabase[j].subData.ptr &&
+			        !strcmp(filesDatabase[i].subData.name, filesDatabase[j].subData.name) &&
+			        (filesDatabase[j].subData.index == (j - i));
+			        j++)
 				;
 
 			for (k = i; k < j; k++) {
-				if (filesDatabase[k].subData.ptrMask)
-					lowMemory = 0;
-
 				filesDatabase[k].subData.ptr = NULL;
 				filesDatabase[k].subData.ptrMask = NULL;
 			}
@@ -908,7 +908,6 @@ Common::Error loadSavegameData(int saveGameIdx) {
 			}
 
 			i = j - 1;
-			lowMemory = lowMemorySave;
 		}
 	}
 
diff --git a/engines/cruise/vars.cpp b/engines/cruise/vars.cpp
index f7c74c8..9a59c8a 100644
--- a/engines/cruise/vars.cpp
+++ b/engines/cruise/vars.cpp
@@ -31,7 +31,6 @@ uint8 selectColor = 3;
 uint8 titleColor = 2;
 uint8 subColor = 5;
 
-int16 lowMemory;
 int16 scroll;
 int16 switchPal;
 char cmdLine[90];
diff --git a/engines/cruise/vars.h b/engines/cruise/vars.h
index 8bfcdc5..fe3f7d6 100644
--- a/engines/cruise/vars.h
+++ b/engines/cruise/vars.h
@@ -59,7 +59,6 @@ extern uint8 selectColor;
 extern uint8 titleColor;
 extern uint8 subColor;
 
-extern int16 lowMemory;
 extern int16 scroll;
 extern int16 switchPal;
 extern char cmdLine[90];
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index cbaa992..2776a04 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -43,8 +43,9 @@
 
 namespace Groovie {
 
-ROQPlayer::ROQPlayer(GroovieEngine *vm) : VideoPlayer(vm), _codingTypeCount(0), _bg(&_vm->_graphicsMan->_background) {
-	// _fg = &_vm->_graphicsMan->_foreground;
+ROQPlayer::ROQPlayer(GroovieEngine *vm) :
+	VideoPlayer(vm), _codingTypeCount(0),
+	_bg(&_vm->_graphicsMan->_background) {
 
 	// Create the work surfaces
 	_currBuf = new Graphics::Surface();
diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h
index b5e63c2..cd5e91c 100644
--- a/engines/groovie/roq.h
+++ b/engines/groovie/roq.h
@@ -75,7 +75,6 @@ private:
 	byte _codebook4[256 * 4];
 
 	// Buffers
-	// Graphics::Surface *_fg, *_thirdBuf;
 	Graphics::Surface *_bg;
 	Graphics::Surface *_currBuf, *_prevBuf;
 	void buildShowBuf();
diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp
index 9c8cc20..148854e 100644
--- a/engines/lastexpress/data/animation.cpp
+++ b/engines/lastexpress/data/animation.cpp
@@ -39,7 +39,7 @@
 
 namespace LastExpress {
 
-Animation::Animation() : _stream(NULL), _currentChunk(NULL), _overlay(NULL), _background1(NULL), _background2(NULL), _backgroundCurrent(0), _audio(NULL), _startTime(0), _changed(false), _flag(0) {
+Animation::Animation() : _stream(NULL), _currentChunk(NULL), _overlay(NULL), _background1(NULL), _background2(NULL), _backgroundCurrent(0), _audio(NULL), _startTime(0), _changed(false) {
 }
 
 Animation::~Animation() {
diff --git a/engines/lastexpress/data/animation.h b/engines/lastexpress/data/animation.h
index 7f69228..9523cdd 100644
--- a/engines/lastexpress/data/animation.h
+++ b/engines/lastexpress/data/animation.h
@@ -113,7 +113,6 @@ private:
 
 	uint32 _startTime;
 	bool _changed;
-	int _flag;
 };
 
 } // End of namespace LastExpress
diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp
index c7073b5..f43e2af 100644
--- a/engines/lastexpress/data/sequence.cpp
+++ b/engines/lastexpress/data/sequence.cpp
@@ -76,7 +76,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) {
 
 // AnimFrame
 
-AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool ignoreSubtype) : _palette(NULL), _ignoreSubtype(ignoreSubtype) {
+AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool /* ignoreSubtype */) : _palette(NULL) {
 	_palSize = 1;
 	// TODO: use just the needed rectangle
 	_image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h
index dbb08a0..fd8b3cd 100644
--- a/engines/lastexpress/data/sequence.h
+++ b/engines/lastexpress/data/sequence.h
@@ -147,7 +147,6 @@ private:
 	uint16 _palSize;
 	uint16 *_palette;
 	Common::Rect _rect;
-	bool _ignoreSubtype;
 };
 
 class Sequence {
diff --git a/engines/parallaction/saveload.h b/engines/parallaction/saveload.h
index dbbbb42..c9b724e 100644
--- a/engines/parallaction/saveload.h
+++ b/engines/parallaction/saveload.h
@@ -71,12 +71,12 @@ public:
 };
 
 class SaveLoad_br : public SaveLoad {
-	Parallaction_br *_vm;
+//	Parallaction_br *_vm;
 	virtual void doLoadGame(uint16 slot);
 	virtual void doSaveGame(uint16 slot, const char* name);
 
 public:
-	SaveLoad_br(Parallaction_br *vm, Common::SaveFileManager *saveFileMan) : SaveLoad(saveFileMan, "bra"), _vm(vm) { }
+	SaveLoad_br(Parallaction_br *vm, Common::SaveFileManager *saveFileMan) : SaveLoad(saveFileMan, "bra") { }
 
 	virtual void getGamePartProgress(bool *complete, int size);
 	virtual void setPartComplete(const char *part);
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index bb1a7ff..1d1b6b4 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -380,7 +380,7 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
 	int size;
 
 	assert(height >= 0);
-	assert(slot >= 0 && slot < 4);
+	assert((int)slot >= 0 && (int)slot < 4);
 
 	if (_game.version >= 7) {
 		if (slot == kMainVirtScreen && (_roomHeight != 0))
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 8d278f6..fc3c193 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1242,7 +1242,7 @@ void ScummEngine::saveOrLoad(Serializer *s) {
 			}
 			s->saveUint16(0xFFFF);	// End marker
 		} else {
-			while ((type = (ResType)s->loadUint16()) != 0xFFFF) {
+			while ((int)(type = (ResType)s->loadUint16()) != 0xFFFF) {
 				while ((idx = s->loadUint16()) != 0xFFFF) {
 					assert(idx < _res->_types[type].size());
 					loadResource(s, type, idx);
@@ -1430,7 +1430,7 @@ void ScummEngine::saveOrLoad(Serializer *s) {
 			}
 		s->saveByte(0xFF);
 	} else {
-		while ((type = (ResType)s->loadByte()) != 0xFF) {
+		while ((int)(type = (ResType)s->loadByte()) != 0xFF) {
 			idx = s->loadUint16();
 			_res->lock(type, idx);
 		}
diff --git a/engines/zvision/fonts/truetype_font.cpp b/engines/zvision/fonts/truetype_font.cpp
index 03520f1..ba4d72b 100644
--- a/engines/zvision/fonts/truetype_font.cpp
+++ b/engines/zvision/fonts/truetype_font.cpp
@@ -39,12 +39,9 @@
 namespace ZVision {
 
 TruetypeFont::TruetypeFont(ZVision *engine, int32 fontHeight)
-		: _engine(engine),
-		  _fontHeight(fontHeight),
+		: _fontHeight(fontHeight),
 		  _font(0),
-		  _lineHeight(0),
-		  _maxCharWidth(0),
-		  _maxCharHeight(0) {
+		  _lineHeight(0) {
 }
 
 TruetypeFont::~TruetypeFont(void) {
diff --git a/engines/zvision/fonts/truetype_font.h b/engines/zvision/fonts/truetype_font.h
index 3b5805d..64f53a2 100644
--- a/engines/zvision/fonts/truetype_font.h
+++ b/engines/zvision/fonts/truetype_font.h
@@ -43,12 +43,12 @@ public:
 	~TruetypeFont();
 
 private:
-	ZVision *_engine;
+//	ZVision *_engine;
 	Graphics::Font *_font;
 	int _lineHeight;
 
-	size_t _maxCharWidth;
-	size_t _maxCharHeight;
+//	size_t _maxCharWidth;
+//	size_t _maxCharHeight;
 
 public:
 	int32 _fontHeight;
diff --git a/test/common/util.h b/test/common/util.h
index cd65307..e195f13 100644
--- a/test/common/util.h
+++ b/test/common/util.h
@@ -115,7 +115,7 @@ class UtilTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT_EQUALS(Common::isAlnum('Z'), 1);
 		TS_ASSERT_EQUALS(Common::isAlnum('1'), 1);
 		TS_ASSERT_EQUALS(Common::isAlnum('0'), 1);
-		TS_ASSERT_EQUALS(Common::isAlnum('§'), 0);
+		TS_ASSERT_EQUALS(Common::isAlnum('\xA7'), 0);
 		TS_ASSERT_EQUALS(Common::isAlnum('$'), 0);
 		TS_ASSERT_EQUALS(Common::isAlnum(' '), 0);
 		TS_ASSERT_EQUALS(Common::isAlnum('\n'), 0);
@@ -136,7 +136,7 @@ class UtilTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT_EQUALS(Common::isAlpha('Z'), 1);
 		TS_ASSERT_EQUALS(Common::isAlpha('1'), 0);
 		TS_ASSERT_EQUALS(Common::isAlpha('0'), 0);
-		TS_ASSERT_EQUALS(Common::isAlpha('§'), 0);
+		TS_ASSERT_EQUALS(Common::isAlpha('\xA7'), 0);
 		TS_ASSERT_EQUALS(Common::isAlpha('$'), 0);
 		TS_ASSERT_EQUALS(Common::isAlpha(' '), 0);
 		TS_ASSERT_EQUALS(Common::isAlpha('\n'), 0);
@@ -157,7 +157,7 @@ class UtilTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT_EQUALS(Common::isDigit('Z'), 0);
 		TS_ASSERT_EQUALS(Common::isDigit('1'), 1);
 		TS_ASSERT_EQUALS(Common::isDigit('0'), 1);
-		TS_ASSERT_EQUALS(Common::isDigit('§'), 0);
+		TS_ASSERT_EQUALS(Common::isDigit('\xA7'), 0);
 		TS_ASSERT_EQUALS(Common::isDigit('$'), 0);
 		TS_ASSERT_EQUALS(Common::isDigit(' '), 0);
 		TS_ASSERT_EQUALS(Common::isDigit('\n'), 0);
@@ -178,7 +178,7 @@ class UtilTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT_EQUALS(Common::isLower('Z'), 0);
 		TS_ASSERT_EQUALS(Common::isLower('1'), 0);
 		TS_ASSERT_EQUALS(Common::isLower('0'), 0);
-		TS_ASSERT_EQUALS(Common::isLower('§'), 0);
+		TS_ASSERT_EQUALS(Common::isLower('\xA7'), 0);
 		TS_ASSERT_EQUALS(Common::isLower('$'), 0);
 		TS_ASSERT_EQUALS(Common::isLower(' '), 0);
 		TS_ASSERT_EQUALS(Common::isLower('\n'), 0);
@@ -200,7 +200,7 @@ class UtilTestSuite : public CxxTest::TestSuite {
 		TS_ASSERT_EQUALS(Common::isUpper('Z'), 1);
 		TS_ASSERT_EQUALS(Common::isUpper('1'), 0);
 		TS_ASSERT_EQUALS(Common::isUpper('0'), 0);
-		TS_ASSERT_EQUALS(Common::isUpper('§'), 0);
+		TS_ASSERT_EQUALS(Common::isUpper('\xA7'), 0);
 		TS_ASSERT_EQUALS(Common::isUpper('$'), 0);
 		TS_ASSERT_EQUALS(Common::isUpper(' '), 0);
 		TS_ASSERT_EQUALS(Common::isUpper('\n'), 0);
diff --git a/test/cxxtest_mingw.h b/test/cxxtest_mingw.h
index f407105..380f638 100644
--- a/test/cxxtest_mingw.h
+++ b/test/cxxtest_mingw.h
@@ -8,4 +8,4 @@
 #undef main
 #endif // main
 
-#endif // CXXTEST_MINGW
\ No newline at end of file
+#endif // CXXTEST_MINGW


Commit: 190a656c08914db94d09f1829312e78aa8084a87
    https://github.com/scummvm/scummvm/commit/190a656c08914db94d09f1829312e78aa8084a87
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2014-03-30T16:22:03+03:00

Commit Message:
Merge pull request #456 from fingolfin/clang-fixes

ALL: Resolve multiple clang warnings

Changed paths:
    audio/mixer.cpp
    engines/avalanche/dialogs.cpp
    engines/cruise/font.cpp
    engines/cruise/function.cpp
    engines/cruise/saveload.cpp
    engines/cruise/vars.cpp
    engines/cruise/vars.h
    engines/groovie/roq.cpp
    engines/groovie/roq.h
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/animation.h
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/data/sequence.h
    engines/parallaction/saveload.h
    engines/scumm/gfx.cpp
    engines/scumm/saveload.cpp
    engines/zvision/fonts/truetype_font.cpp
    engines/zvision/fonts/truetype_font.h
    test/common/util.h
    test/cxxtest_mingw.h









More information about the Scummvm-git-logs mailing list