[Scummvm-cvs-logs] SF.net SVN: scummvm: [23559] scummvm/trunk/common

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sat Jul 22 16:59:57 CEST 2006


Revision: 23559
Author:   lordhoto
Date:     2006-07-22 07:59:44 -0700 (Sat, 22 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23559&view=rev

Log Message:
-----------
- let md5_file accept a FilesystemNode too 
- changes some engine detectors to use it

Modified Paths:
--------------
    scummvm/trunk/common/md5.cpp
    scummvm/trunk/common/md5.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/kyra/plugin.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/saga/game.cpp
    scummvm/trunk/engines/simon/game.cpp
Modified: scummvm/trunk/common/md5.cpp
===================================================================
--- scummvm/trunk/common/md5.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/common/md5.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -233,6 +233,10 @@
 	PUT_UINT32(ctx->state[3], digest, 12);
 }
 
+bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length) {
+	return md5_file(file.path().c_str(), digest, length);
+}
+
 bool md5_file(const char *name, uint8 digest[16], uint32 length) {
 	File f;
 

Modified: scummvm/trunk/common/md5.h
===================================================================
--- scummvm/trunk/common/md5.h	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/common/md5.h	2006-07-22 14:59:44 UTC (rev 23559)
@@ -23,6 +23,7 @@
 #define COMMON_MD5_H
 
 #include "common/scummsys.h"
+#include "common/fs.h"
 
 namespace Common {
 
@@ -37,6 +38,7 @@
 void md5_finish(md5_context *ctx, uint8 digest[16]);
 
 bool md5_file(const char *name, uint8 digest[16], uint32 length = 0);
+bool md5_file(const FilesystemNode &file, uint8 digest[16], uint32 length = 0);
 
 } // End of namespace Common
 

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/engines/gob/gob.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -348,7 +348,7 @@
 	uint8 md5sum[16];
 	char md5str[32 + 1];
 
-	if (Common::md5_file(file->path().c_str(), md5sum, kMD5FileSizeLimit)) {
+	if (Common::md5_file(*file, md5sum, kMD5FileSizeLimit)) {
 		for (int i = 0; i < 16; i++) {
 			sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
 		}

Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/engines/kyra/plugin.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -195,7 +195,7 @@
 	uint8 md5sum[16];
 	char md5str[32 + 1];
 
-	if (Common::md5_file(file->path().c_str(), md5sum, kMD5FileSizeLimit)) {
+	if (Common::md5_file(*file, md5sum, kMD5FileSizeLimit)) {
 		for (int i = 0; i < 16; i++) {
 			sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
 		}

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/engines/lure/lure.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -129,7 +129,7 @@
 	uint8 md5sum[16];
 	char md5str[32 + 1];
 
-	if (Common::md5_file(file->path().c_str(), md5sum, kMD5FileSizeLimit)) {
+	if (Common::md5_file(*file, md5sum, kMD5FileSizeLimit)) {
 		for (int i = 0; i < 16; i++) {
 			sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
 		}

Modified: scummvm/trunk/engines/saga/game.cpp
===================================================================
--- scummvm/trunk/engines/saga/game.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/engines/saga/game.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -132,7 +132,7 @@
 
 			if (!filesList.contains(tstr)) continue;
 
-			if (!Common::md5_file(file->path().c_str(), md5sum, FILE_MD5_BYTES)) continue;
+			if (!Common::md5_file(*file, md5sum, FILE_MD5_BYTES)) continue;
 			for (j = 0; j < 16; j++) {
 				sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
 			}

Modified: scummvm/trunk/engines/simon/game.cpp
===================================================================
--- scummvm/trunk/engines/simon/game.cpp	2006-07-22 14:50:50 UTC (rev 23558)
+++ scummvm/trunk/engines/simon/game.cpp	2006-07-22 14:59:44 UTC (rev 23559)
@@ -1386,7 +1386,7 @@
 
 			if (!filesList.contains(tstr) && !filesList.contains(tstr2)) continue;
 
-			if (!Common::md5_file(file->path().c_str(), md5sum, FILE_MD5_BYTES)) continue;
+			if (!Common::md5_file(*file, md5sum, FILE_MD5_BYTES)) continue;
 			for (j = 0; j < 16; j++) {
 				sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
 			}


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