diff options
| author | Max Horn | 2010-11-07 17:16:59 +0000 |
|---|---|---|
| committer | Max Horn | 2010-11-07 17:16:59 +0000 |
| commit | 4d3a07b4943fa173b8db93d54d89baa24b35e0c5 (patch) | |
| tree | 124287f718ce17d9c6dcafb9331eab7d8d9b405d /engines/tinsel | |
| parent | 036e88d382f653fd8590bb2edec2e45072f9d0be (diff) | |
| download | scummvm-rg350-4d3a07b4943fa173b8db93d54d89baa24b35e0c5.tar.gz scummvm-rg350-4d3a07b4943fa173b8db93d54d89baa24b35e0c5.tar.bz2 scummvm-rg350-4d3a07b4943fa173b8db93d54d89baa24b35e0c5.zip | |
COMMON: Rename and tweak MD5 functions
* names now comply to our naming conventions
* the function computeStreamMD5AsString which computes the MD5
as a hex string now returns it as a Common::String
* add doxygen comments
svn-id: r54121
Diffstat (limited to 'engines/tinsel')
| -rw-r--r-- | engines/tinsel/detection.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index cbd0ba267b..22e8806e7e 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -191,7 +191,7 @@ bool TinselMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGa struct SizeMD5 { int size; - char md5[32+1]; + Common::String md5; }; typedef Common::HashMap<Common::String, SizeMD5, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> SizeMD5Map; typedef Common::HashMap<Common::String, Common::FSNode, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap; @@ -268,11 +268,9 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & if (testFile.open(allFiles[fname])) { tmp.size = (int32)testFile.size(); - if (!md5_file_string(testFile, tmp.md5, detectionParams.md5Bytes)) - tmp.md5[0] = 0; + tmp.md5 = computeStreamMD5AsString(testFile, detectionParams.md5Bytes); } else { tmp.size = -1; - tmp.md5[0] = 0; } filesSizeMD5[fname] = tmp; @@ -318,7 +316,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const Common::FSList & break; } - if (fileDesc->md5 != NULL && 0 != strcmp(fileDesc->md5, filesSizeMD5[tstr].md5)) { + if (fileDesc->md5 != NULL && fileDesc->md5 != filesSizeMD5[tstr].md5) { fileMissing = true; break; } |
