[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.103,1.104 bundle.cpp,1.38,1.39 bundle.h,1.15,1.16 debugger.cpp,1.46,1.47 debugger.h,1.22,1.23 gfx.cpp,2.114,2.115 imuse.cpp,2.46,2.47 imuse_digi.cpp,1.12,1.13 object.cpp,1.101,1.102 resource.cpp,1.83,1.84 script_v2.cpp,2.97,2.98 script_v5.cpp,1.92,1.93 script_v6.cpp,1.122,1.123 script_v8.cpp,2.163,2.164 scumm.h,1.207,1.208 scummvm.cpp,2.172,2.173 sound.cpp,1.118,1.119 sound.h,1.29,1.30 string.cpp,1.114,1.115 verbs.cpp,1.45,1.46

Max Horn fingolfin at users.sourceforge.net
Wed May 21 11:10:11 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv4103

Modified Files:
	actor.cpp bundle.cpp bundle.h debugger.cpp debugger.h gfx.cpp 
	imuse.cpp imuse_digi.cpp object.cpp resource.cpp script_v2.cpp 
	script_v5.cpp script_v6.cpp script_v8.cpp scumm.h scummvm.cpp 
	sound.cpp sound.h string.cpp verbs.cpp 
Log Message:
many pedantic warning fixes (and some actual potential buglets fixed, too)

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- actor.cpp	20 May 2003 23:05:33 -0000	1.103
+++ actor.cpp	21 May 2003 18:09:46 -0000	1.104
@@ -1138,7 +1138,7 @@
 }
 
 void Scumm::clearMsgQueue() {
-	_messagePtr = (byte *)" ";
+	_messagePtr = (const byte *)" ";
 	stopTalk();
 }
 
@@ -1425,8 +1425,9 @@
 
 byte *Actor::getActorName() {
 	byte *ptr = _vm->getResourceAddress(rtActorName, number);
-	if (ptr == NULL)
-		return (byte *)" ";
+	if (ptr == NULL) {
+		warning("Failed to find name of actor %d\n", number);
+	}
 	return ptr;
 }
 

Index: bundle.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bundle.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- bundle.cpp	20 May 2003 11:56:36 -0000	1.38
+++ bundle.cpp	21 May 2003 18:09:46 -0000	1.39
@@ -353,7 +353,7 @@
 	return final_size;
 }
 
-int32 Bundle::decompressVoiceSampleByName(char *name, byte **comp_final) {
+int32 Bundle::decompressVoiceSampleByName(const char *name, byte **comp_final) {
 	int32 final_size = 0, i;
 
 	if (_voiceFile.isOpen() == false) {
@@ -371,7 +371,7 @@
 	return final_size;
 }
 
-int32 Bundle::decompressMusicSampleByName(char *name, int32 number, byte *comp_final) {
+int32 Bundle::decompressMusicSampleByName(const char *name, int32 number, byte *comp_final) {
 	int32 final_size = 0, i;
 
 	if (!name) {
@@ -405,7 +405,7 @@
 	return _musicFile.readUint32BE();
 }
 
-int32 Bundle::getNumberOfMusicSamplesByName(char *name) {
+int32 Bundle::getNumberOfMusicSamplesByName(const char *name) {
 	int32 number = 0, i;
 
 	if (_musicFile.isOpen() == false) {

Index: bundle.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/bundle.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- bundle.h	20 May 2003 11:56:36 -0000	1.15
+++ bundle.h	21 May 2003 18:09:46 -0000	1.16
@@ -67,12 +67,12 @@
 	bool openMusicFile(const char *filename, const char *directory);
 	void closeVoiceFile() { _voiceFile.close(); }
 	void closeMusicFile() { _musicFile.close(); }
-	int32 decompressVoiceSampleByName(char *name, byte **comp_final);
+	int32 decompressVoiceSampleByName(const char *name, byte **comp_final);
 	int32 decompressVoiceSampleByIndex(int32 index, byte **comp_final);
-	int32 decompressMusicSampleByName(char *name, int32 number, byte *comp_final);
+	int32 decompressMusicSampleByName(const char *name, int32 number, byte *comp_final);
 	int32 decompressMusicSampleByIndex(int32 index, int32 number, byte *comp_final);
 	int32 getNumberOfMusicSamplesByIndex(int32 index);
-	int32 getNumberOfMusicSamplesByName(char *name);
+	int32 getNumberOfMusicSamplesByName(const char *name);
 };
 
 #endif

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- debugger.cpp	20 May 2003 20:58:24 -0000	1.46
+++ debugger.cpp	21 May 2003 18:09:46 -0000	1.47
@@ -143,7 +143,7 @@
 bool ScummDebugger::debuggerInputCallback(ConsoleDialog *console, const char *input, void *refCon) {
 	ScummDebugger *debugger = (ScummDebugger *)refCon;
 	
-	return debugger->RunCommand((char*)input);
+	return debugger->RunCommand(input);
 }
 
 
@@ -229,10 +229,11 @@
 }
 
 // Command execution loop
-bool ScummDebugger::RunCommand(char *input) {
+bool ScummDebugger::RunCommand(const char *inputOrig) {
 	int i = 0, num_params = 0;
 	const char *param[256];
-
+	char *input = strdup(inputOrig);	// One of the rare occasions using strdup is OK (although avoiding strtok might be more elegant here).
+	
 	// Parse out any params
 	char *tok = strtok(input, " ");
 	if (tok) {
@@ -245,6 +246,7 @@
 
 	for(i=0; i < _dcmd_count; i++) {
 		if (!strcmp(_dcmds[i].name, param[0])) {
+			free(input);
 			return (this->*_dcmds[i].function)(num_params, param);
 		}
 	}
@@ -321,11 +323,13 @@
 				}
 			}
 
+			free(input);
 			return true;
 		}
 	}
 
 	Debug_Printf("Unknown command or variable\n");
+	free(input);
 	return true;
 }
 

Index: debugger.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- debugger.h	17 May 2003 19:03:25 -0000	1.22
+++ debugger.h	21 May 2003 18:09:46 -0000	1.23
@@ -67,7 +67,7 @@
 
 	void DVar_Register(const char *varname, void *pointer, int type, int optional);
 	void DCmd_Register(const char *cmdname, DebugProc pointer);
-	bool RunCommand(char *input);
+	bool RunCommand(const char *input);
 
 	// Commands
 	bool Cmd_Exit(int argc, const char **argv);

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.114
retrieving revision 2.115
diff -u -d -r2.114 -r2.115
--- gfx.cpp	21 May 2003 14:00:04 -0000	2.114
+++ gfx.cpp	21 May 2003 18:09:46 -0000	2.115
@@ -1292,9 +1292,8 @@
 				if(run == 0) {
 					run = *src++;
 				}
-				const register byte colors[2] = { color >> 4, color & 0xf };
 				for(z = 0; z < run; z++) {
-					*(dst + y * _vm->_screenWidth + x) = colors[z&1];
+					*(dst + y * _vm->_screenWidth + x) = (z&1) ? (color & 0xf) : (color >> 4);
 
 					y++;
 					if(y >= height) {

Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.46
retrieving revision 2.47
diff -u -d -r2.46 -r2.47
--- imuse.cpp	20 May 2003 01:12:40 -0000	2.46
+++ imuse.cpp	21 May 2003 18:09:46 -0000	2.47
@@ -1192,9 +1192,6 @@
 int IMuseInternal::set_music_volume(uint vol) {
 	if (vol > 255)
 		vol = 255;
-	else if (vol < 0)
-		vol = 0;
-
 	if (_music_volume == vol)
 		return 0;
 	_music_volume = vol;
@@ -1210,11 +1207,8 @@
 int IMuseInternal::set_master_volume (uint vol) {
 	if (vol > 255)
 		vol = 255;
-	else if (vol < 0)
-		vol = 0;
 	if (_master_volume == vol)
 		return 0;
-
 	_master_volume = vol;
 	vol = vol * _music_volume / 255;
 	for (uint i = 0; i < ARRAYSIZE (_channel_volume); i++) {
@@ -2755,7 +2749,7 @@
 	uint32 curpos, topos;
 	uint32 pos;
 
-	assert(totrack >= 0 && tobeat >= 0 && totick >= 0);
+//	assert(totrack >= 0 && tobeat >= 0 && totick >= 0);	// Those are all unsigned numbers anyway...
 
 	if (!_active)
 		return -1;

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- imuse_digi.cpp	30 Apr 2003 13:23:29 -0000	1.12
+++ imuse_digi.cpp	21 May 2003 18:09:46 -0000	1.13
@@ -1072,7 +1072,7 @@
 						int16 music = _digStateMusicMap[l].table_index;
 						debug(2, "Play imuse music: %s, %s, %s", _digStateMusicTable[music].name, _digStateMusicTable[music].title, _digStateMusicTable[music].filename);
 						if (_digStateMusicTable[music].filename[0] != 0) {
-							_scumm->_sound->playBundleMusic((char*)&_digStateMusicTable[music].filename);
+							_scumm->_sound->playBundleMusic((const char *)_digStateMusicTable[music].filename);
 						}
 						return 0;
 					}
@@ -1091,7 +1091,7 @@
 					if ((_comiStateMusicTable[l].index == b)) {
 						debug(2, "Play imuse music: %s, %s, %s", _comiStateMusicTable[l].name, _comiStateMusicTable[l].title, _comiStateMusicTable[l].filename);
 						if (_comiStateMusicTable[l].filename[0] != 0) {
-							_scumm->_sound->playBundleMusic((char*)&_comiStateMusicTable[l].filename);
+							_scumm->_sound->playBundleMusic((const char *)_comiStateMusicTable[l].filename);
 						}
 						return 0;
 					}
@@ -1125,7 +1125,7 @@
 					if ((_digSeqMusicTable[l].index == b)) {
 						debug(2, "Play imuse music: %s, %s, %s", _digSeqMusicTable[l].name, _digSeqMusicTable[l].title, _digSeqMusicTable[l].filename);
 						if (_digSeqMusicTable[l].filename[0] != 0) {
-							_scumm->_sound->playBundleMusic((char*)&_digSeqMusicTable[l].filename);
+							_scumm->_sound->playBundleMusic((const char *)_digSeqMusicTable[l].filename);
 						}
 						return 0;
 					}
@@ -1138,7 +1138,7 @@
 					if ((_comiSeqMusicTable[l].index == b)) {
 						debug(2, "Play imuse music: %s, %s, %s", _comiSeqMusicTable[l].name, _comiSeqMusicTable[l].title, _comiSeqMusicTable[l].filename);
 						if (_comiSeqMusicTable[l].filename[0] != 0) {
-							_scumm->_sound->playBundleMusic((char*)&_comiSeqMusicTable[l].filename);
+							_scumm->_sound->playBundleMusic((const char *)_comiSeqMusicTable[l].filename);
 						}
 						return 0;
 					}

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- object.cpp	20 May 2003 20:42:27 -0000	1.101
+++ object.cpp	21 May 2003 18:09:46 -0000	1.102
@@ -899,7 +899,7 @@
 
 	objptr = getOBCDFromObject(obj);
 	if (objptr == NULL)
-		return (byte *)" ";
+		return NULL;
 
 	return findResourceData(MKID('OBNA'), objptr);
 }
@@ -1596,7 +1596,7 @@
 int32 Scumm::setupBompScale(byte * scalling, int32 size, byte scale) {
 	uint32 tmp = (256 - (size >> 1));
 	int32 count = (size + 7) >> 3;
-	assert(0 <= tmp && tmp < sizeof(_bompScaleTable));
+	assert(tmp < sizeof(_bompScaleTable));
 	byte * tmp_ptr = _bompScaleTable + tmp;
 	byte * tmp_scalling = scalling;
 	byte a = 0;
@@ -1656,7 +1656,7 @@
 	byte ret_value = 0;
 	while(count--) {
 		tmp = *scalling++;
-		assert(0 <= tmp && tmp < sizeof(_bompBitsTable));
+		assert(tmp < sizeof(_bompBitsTable));
 		ret_value += _bompBitsTable[tmp];
 	}
 

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/resource.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- resource.cpp	20 May 2003 15:03:47 -0000	1.83
+++ resource.cpp	21 May 2003 18:09:46 -0000	1.84
@@ -1597,7 +1597,7 @@
 	}
 }
 
-void Scumm::loadPtrToResource(int type, int resindex, byte *source) {
+void Scumm::loadPtrToResource(int type, int resindex, const byte *source) {
 	byte *alloced;
 	int i, len;
 

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.97
retrieving revision 2.98
diff -u -d -r2.97 -r2.98
--- script_v2.cpp	21 May 2003 17:34:01 -0000	2.97
+++ script_v2.cpp	21 May 2003 18:09:46 -0000	2.98
@@ -882,7 +882,7 @@
 void Scumm_v2::o2_drawSentence() {
 	ScummVM::Rect sentenceline;
 	static char sentence[80];
-	byte *temp;
+	const byte *temp;
 	int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB),0);
 
 	if (!(_userState & 32))
@@ -893,7 +893,7 @@
 		temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT1));
 		if (temp) {
 			strcat(sentence, " ");
-			strcat(sentence, (char*)temp);
+			strcat(sentence, (const char*)temp);
 		}
 	}
 
@@ -901,7 +901,7 @@
 		temp = getObjOrActorName(VAR(VAR_SENTENCE_OBJECT2));
 		if (temp) {
 			strcat(sentence, " with ");
-			strcat(sentence, (char*)temp);
+			strcat(sentence, (const char*)temp);
 		}
 	}
 
@@ -1263,6 +1263,8 @@
 		error("Can't set actor %d name with new-name-of", obj);
 
 	name = getObjOrActorName(obj);
+	if (name == NULL)
+		return;	// Silently abort
 
 	byte *objptr;
 	byte offset = 0;

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- script_v5.cpp	21 May 2003 16:28:01 -0000	1.92
+++ script_v5.cpp	21 May 2003 18:09:46 -0000	1.93
@@ -1933,6 +1933,8 @@
 	}
 
 	name = getObjOrActorName(obj);
+	if (name == NULL)
+		return;	// Silently abort
 
 	if (_features & GF_SMALL_HEADER) {
 		// FIXME this is hack to make MonkeyVGA work. needed at least for the german

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- script_v6.cpp	20 May 2003 23:05:34 -0000	1.122
+++ script_v6.cpp	21 May 2003 18:09:47 -0000	1.123
@@ -1761,7 +1761,7 @@
 void Scumm_v6::o6_verbOps() {
 	int slot, a, b;
 	VerbSlot *vs;
-	byte *ptr, op;
+	byte op;
 
 	// Full Throttle implements conversation by creating new verbs, one
 	// for each option, but it never tells when to actually draw them.
@@ -1853,11 +1853,10 @@
 	case 137:
 		a = pop();
 		if (a == 0) {
-			ptr = (byte *)"";
+			loadPtrToResource(rtVerb, slot, (const byte *)"");
 		} else {
-			ptr = getStringAddress(a);
+			loadPtrToResource(rtVerb, slot, getStringAddress(a));
 		}
-		loadPtrToResource(rtVerb, slot, ptr);
 		vs->type = kTextVerbType;
 		vs->imgindex = 0;
 		break;

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.163
retrieving revision 2.164
diff -u -d -r2.163 -r2.164
--- script_v8.cpp	21 May 2003 10:38:45 -0000	2.163
+++ script_v8.cpp	21 May 2003 18:09:47 -0000	2.164
@@ -1291,7 +1291,7 @@
 	case 0xA4:		// SO_VERB_NAME_STR Set verb name
 		a = pop();
 		if (a == 0) {
-			loadPtrToResource(rtVerb, _curVerbSlot, (byte *)"");
+			loadPtrToResource(rtVerb, _curVerbSlot, (const byte *)"");
 		} else {
 			loadPtrToResource(rtVerb, _curVerbSlot, getStringAddress(a));
 		}
@@ -1343,10 +1343,10 @@
 void Scumm_v8::o8_startVideo() {
 	int len = resStrLen(_scriptPointer);
 	
-	warning("o8_startVideo(%s/%s)", getGameDataPath(), (char*)_scriptPointer);
+	warning("o8_startVideo(%s/%s)", getGameDataPath(), (const char*)_scriptPointer);
 	
 	SmushPlayer *sp = new SmushPlayer(this, 83333, !_noSubtitles);
-	sp->play((char*)_scriptPointer, getGameDataPath());
+	sp->play((const char*)_scriptPointer, getGameDataPath());
 	delete sp;
 
 	_scriptPointer += len + 1;

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.207
retrieving revision 1.208
diff -u -d -r1.207 -r1.208
--- scumm.h	21 May 2003 16:28:01 -0000	1.207
+++ scumm.h	21 May 2003 18:09:48 -0000	1.208
@@ -579,7 +579,7 @@
 	bool openResourceFile(const char *filename);
 
 protected:
-	void loadPtrToResource(int type, int i, byte *ptr);
+	void loadPtrToResource(int type, int i, const byte *ptr);
 	void readResTypeList(int id, uint32 tag, const char *name);
 	char *resTypeFromId(int id);
 	void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.172
retrieving revision 2.173
diff -u -d -r2.172 -r2.173
--- scummvm.cpp	21 May 2003 14:00:13 -0000	2.172
+++ scummvm.cpp	21 May 2003 18:09:48 -0000	2.173
@@ -525,8 +525,8 @@
 	_debugLevel = detector->_debugLevel;
 	_dumpScripts = detector->_dumpScripts;
 	_bootParam = detector->_bootParam;
-	_exe_name = (char*)detector->_gameRealName.c_str();
-	_game_name = (char*)detector->_gameFileName.c_str();
+	_exe_name = strdup(detector->_gameRealName.c_str());	// FIXME: probably should use String class here
+	_game_name = strdup(detector->_gameFileName.c_str());
 	_gameId = detector->_gameId;
 	_features = detector->_features;
 	_noSubtitles = detector->_noSubtitles;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- sound.cpp	20 May 2003 11:56:36 -0000	1.118
+++ sound.cpp	21 May 2003 18:09:48 -0000	1.119
@@ -520,7 +520,7 @@
 }
 
 static int compareMP3OffsetTable(const void *a, const void *b) {
-	return ((MP3OffsetTable *)a)->org_offset - ((MP3OffsetTable *)b)->org_offset;
+	return ((const MP3OffsetTable *)a)->org_offset - ((const MP3OffsetTable *)b)->org_offset;
 }
 
 int Sound::startTalkSound(uint32 offset, uint32 b, int mode) {
@@ -1030,7 +1030,7 @@
 	g_scumm->_sound->bundleMusicHandler(g_scumm);
 }
 
-void Sound::playBundleMusic(char *song) {
+void Sound::playBundleMusic(const char *song) {
 	if (_scumm->_silentDigitalImuse == true) {
 		return;
 	}

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- sound.h	1 May 2003 00:04:05 -0000	1.29
+++ sound.h	21 May 2003 18:09:48 -0000	1.30
@@ -42,8 +42,8 @@
 	bool _soundsPaused2;
 	bool _soundVolumePreset;
 
-	char *_nameBundleMusic;
-	char *_newNameBundleMusic;
+	const char *_nameBundleMusic;
+	const char *_newNameBundleMusic;
 	byte _musicDisk;
 	byte _voiceDisk;
 	int32 _currentSampleBundleMusic;
@@ -162,7 +162,7 @@
 	void stopSfxSound();
 	bool isSfxFinished();
 	uint32 decode12BitsSample(byte *src, byte **dst, uint32 size, bool stereo);
-	void playBundleMusic(char *song);
+	void playBundleMusic(const char *song);
 	void pauseBundleMusic(bool state);
 	void bundleMusicHandler(Scumm *scumm);
 	void stopBundleMusic();

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- string.cpp	21 May 2003 16:28:01 -0000	1.114
+++ string.cpp	21 May 2003 18:09:48 -0000	1.115
@@ -677,17 +677,19 @@
 			}
 		}
 	} else {
-		addMessageToStack((byte *)"");
+		addMessageToStack((const byte *)"");
 	}
 }
 
 void Scumm::addNameToStack(int var)
 {
 	int num;
+	byte *ptr = 0;
 
 	num = readVar(var);
-	if (num) {
-		byte *ptr = getObjOrActorName(num);
+	if (num)
+		ptr = getObjOrActorName(num);
+	if (ptr) {
 		if ((_features & GF_AFTER_V8) && (ptr[0] == '/')) {
 			char pointer[20];
 			int i, j;
@@ -704,7 +706,7 @@
 			addMessageToStack(ptr);
 		}
 	} else {
-		addMessageToStack((byte *)"");
+		addMessageToStack((const byte *)"");
 	}
 }
 
@@ -735,7 +737,7 @@
 			}
 		}
 	} else
-		addMessageToStack((byte *)"");
+		addMessageToStack((const byte *)"");
 }
 
 void Scumm::initCharset(int charsetno) {
@@ -752,8 +754,8 @@
 }
 
 int indexCompare(const void *p1, const void *p2) {
-	struct langIndexNode *i1 = (struct langIndexNode *) p1;
-	struct langIndexNode *i2 = (struct langIndexNode *) p2;
+	const struct langIndexNode *i1 = (const struct langIndexNode *) p1;
+	const struct langIndexNode *i2 = (const struct langIndexNode *) p2;
 
 	return strcmp(i1->tag, i2->tag);
 }
@@ -885,7 +887,7 @@
 				}
 			}
 		}
-		byte *pointer = (byte *)strchr((char *)text + 1, '/');
+		byte *pointer = (byte *)strchr((const char *)text + 1, '/');
 		if (pointer != NULL) {
 			pointer++;
 			memcpy(trans_buff, pointer, resStrLen(pointer) + 1);
@@ -918,7 +920,7 @@
 			// skip translation if flag 'h' exist
 			if (buf[pos] == 'h') {
 				pos += 3;
-				byte *pointer = (byte *)strchr((char *)text + 1, '/');
+				byte *pointer = (byte *)strchr((const char *)text + 1, '/');
 				if (pointer != NULL)
 					memcpy(trans_buff, pointer + 1, resStrLen(pointer + 1) + 1);
 				else
@@ -976,7 +978,7 @@
 				}
 			}
 		}
-		byte *pointer = (byte *)strchr((char *)text + 1, '/');
+		byte *pointer = (byte *)strchr((const char *)text + 1, '/');
 		if (pointer != NULL) {
 			pointer++;
 			l = 0;

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- verbs.cpp	21 May 2003 16:28:02 -0000	1.45
+++ verbs.cpp	21 May 2003 18:09:49 -0000	1.46
@@ -70,6 +70,7 @@
 			_string[1].xpos = 0;
 
 		_messagePtr = getObjOrActorName(obj);
+		assert(_messagePtr);
 		drawString(1);
 		items++;
 





More information about the Scummvm-git-logs mailing list