[Scummvm-cvs-logs] SF.net SVN: scummvm:[34702] scummvm/trunk/common/advancedDetector.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Sep 30 14:38:47 CEST 2008


Revision: 34702
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34702&view=rev
Author:   fingolfin
Date:     2008-09-30 12:38:44 +0000 (Tue, 30 Sep 2008)

Log Message:
-----------
AdvancedDetector: Do not (ab)use paths to keep track of files, rather, use FSNodes -- partial (?) fix for bug #2137680

Modified Paths:
--------------
    scummvm/trunk/common/advancedDetector.cpp

Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp	2008-09-30 12:37:28 UTC (rev 34701)
+++ scummvm/trunk/common/advancedDetector.cpp	2008-09-30 12:38:44 UTC (rev 34702)
@@ -290,6 +290,7 @@
 
 typedef HashMap<String, bool, IgnoreCase_Hash, IgnoreCase_EqualTo> StringSet;
 typedef HashMap<String, int32, IgnoreCase_Hash, IgnoreCase_EqualTo> IntMap;
+typedef HashMap<String, FilesystemNode, IgnoreCase_Hash, IgnoreCase_EqualTo> FileMap;
 
 static void reportUnknown(const StringMap &filesMD5, const IntMap &filesSize) {
 	// TODO: This message should be cleaned up / made more specific.
@@ -307,10 +308,10 @@
 	printf("\n");
 }
 
-static ADGameDescList detectGameFilebased(const StringMap &allFiles, const Common::ADParams &params);
+static ADGameDescList detectGameFilebased(const FileMap &allFiles, const Common::ADParams &params);
 
 static ADGameDescList detectGame(const FSList &fslist, const Common::ADParams &params, Language language, Platform platform, const Common::String extra) {
-	StringMap allFiles;
+	FileMap allFiles;
 
 	StringSet detectFiles;
 	StringMap filesMD5;
@@ -334,7 +335,7 @@
 		if (tstr.lastChar() == '.')
 			tstr.deleteLastChar();
 
-		allFiles[tstr] = file->getPath();	// Record the presence of this file
+		allFiles[tstr] = *file;	// Record the presence of this file
 	}
 
 	// Compute the set of files for which we need MD5s for. I.e. files which are
@@ -356,7 +357,7 @@
 		debug(3, "+ %s", fname.c_str());
 
 		char md5str[32+1];
-		if (!md5_file_string(allFiles[fname].c_str(), md5str, params.md5Bytes))
+		if (!md5_file_string(allFiles[fname], md5str, params.md5Bytes))
 			continue;
 		filesMD5[fname] = md5str;
 
@@ -464,7 +465,7 @@
  * the maximal number of matching files. In case of a tie, the entry
  * coming first in the list is chosen.
  */
-static ADGameDescList detectGameFilebased(const StringMap &allFiles, const Common::ADParams &params) {
+static ADGameDescList detectGameFilebased(const FileMap &allFiles, const Common::ADParams &params) {
 	const ADFileBasedFallback *ptr;
 	const char* const* filenames;
 


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