[Scummvm-cvs-logs] SF.net SVN: scummvm: [32575] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Jun 6 15:34:34 CEST 2008


Revision: 32575
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32575&view=rev
Author:   lordhoto
Date:     2008-06-06 06:34:34 -0700 (Fri, 06 Jun 2008)

Log Message:
-----------
- Fixed a valgrind waring
- Formatting
- Removed an assert

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/resource.cpp
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp	2008-06-06 10:01:14 UTC (rev 32574)
+++ scummvm/trunk/engines/kyra/resource.cpp	2008-06-06 13:34:34 UTC (rev 32575)
@@ -156,7 +156,6 @@
 
 	const ResArchiveLoader *loader = getLoader(iter->_value.type);
 	if (!loader) {
-		assert(loader);
 		error("no archive loader for file '%s' found which is of type %d", filename.c_str(), iter->_value.type);
 		return false;
 	}

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-06-06 10:01:14 UTC (rev 32574)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-06-06 13:34:34 UTC (rev 32575)
@@ -1200,31 +1200,31 @@
 	_ingamePakList = _staticres->loadStrings(k2IngamePakFiles, _ingamePakListSize);
 	_sequenceStrings = _staticres->loadStrings(k2SeqplayStrings, _sequenceStringsSize);	
 	_ingameSoundList = _staticres->loadStrings(k2IngameSfxFiles, _ingameSoundListSize);
-	_ingameSoundIndex = (const uint16*) _staticres->loadRawData(k2IngameSfxIndex, _ingameSoundIndexSize);
+	_ingameSoundIndex = (const uint16 *)_staticres->loadRawData(k2IngameSfxIndex, _ingameSoundIndexSize);
 	_musicFileListIntro = _staticres->loadStrings(k2SeqplayIntroTracks, _musicFileListIntroSize);
 	_musicFileListIngame = _staticres->loadStrings(k2IngameTracks, _musicFileListIngameSize);
 	_musicFileListFinale = _staticres->loadStrings(k2SeqplayFinaleTracks, _musicFileListFinaleSize);
 	_cdaTrackTableIntro = _staticres->loadRawData(k2SeqplayIntroCDA, _cdaTrackTableIntroSize);
 	_cdaTrackTableIngame = _staticres->loadRawData(k2IngameCDA, _cdaTrackTableIngameSize);
 	_cdaTrackTableFinale = _staticres->loadRawData(k2SeqplayFinaleCDA, _cdaTrackTableFinaleSize);
-	_ingameTalkObjIndex = (const uint16*) _staticres->loadRawData(k2IngameTalkObjIndex, _ingameTalkObjIndexSize);
+	_ingameTalkObjIndex = (const uint16 *)_staticres->loadRawData(k2IngameTalkObjIndex, _ingameTalkObjIndexSize);
 	_ingameTimJpStr = _staticres->loadStrings(k2IngameTimJpStrings, _ingameTimJpStrSize);
 	_itemAnimData = _staticres->loadShapeAnimData_v2(k2IngameShapeAnimData, _itemAnimDataSize);
 
 	// replace sequence talkie files with localized versions
-	const char* const* seqSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
-	const char* const* tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmpSize);
-	char ** tmpSndLst = new char*[_sequenceSoundListSize];
+	const char *const *seqSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
+	const char *const *tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmpSize);
+	char **tmpSndLst = new char*[_sequenceSoundListSize];
 
 	for (int i = 0; i < _sequenceSoundListSize; i++) {
-		int len = strlen(seqSoundList[i]);
+		const int len = strlen(seqSoundList[i]);
 
 		tmpSndLst[i] = new char[len + 1];
 		tmpSndLst[i][0] = 0;
 
 		if (tlkfiles && len > 1) {
 			for (int ii = 0; ii < tmpSize; ii++) {
-				if (!scumm_stricmp(&seqSoundList[i][1], &tlkfiles[ii][1]))
+				if (strlen(tlkfiles[ii]) > 1 && !scumm_stricmp(&seqSoundList[i][1], &tlkfiles[ii][1]))
 						strcpy(tmpSndLst[i], tlkfiles[ii]);
 			}
 		}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list