aboutsummaryrefslogtreecommitdiff
path: root/common/advancedDetector.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2006-12-19 04:35:08 +0000
committerEugene Sandulenko2006-12-19 04:35:08 +0000
commit457ebfea3c3e630b50f8e2ccf38ec340036c0010 (patch)
tree2c5323e00e544004310833d2b7d41bb14fe9cc93 /common/advancedDetector.cpp
parent18ce3810609ada7d1aded6a6ba551991bc556ba6 (diff)
downloadscummvm-rg350-457ebfea3c3e630b50f8e2ccf38ec340036c0010.tar.gz
scummvm-rg350-457ebfea3c3e630b50f8e2ccf38ec340036c0010.tar.bz2
scummvm-rg350-457ebfea3c3e630b50f8e2ccf38ec340036c0010.zip
Get rif od ARRAYSIZE in ADGameDescription
svn-id: r24882
Diffstat (limited to 'common/advancedDetector.cpp')
-rw-r--r--common/advancedDetector.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 24c3c13d5c..4ae7422322 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -217,8 +217,6 @@ String AdvancedDetector::getDescription(int num) const {
}
ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Platform platform) {
- int filesCount;
-
typedef HashMap<String, bool, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringSet;
StringSet filesList;
@@ -243,7 +241,7 @@ ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Pla
// First we compose list of files which we need MD5s for
for (i = 0; i < _gameDescriptions.size(); i++) {
- for (j = 0; j < _gameDescriptions[i]->filesCount; j++) {
+ for (j = 0; _gameDescriptions[i]->filesDescriptions[j].fileName; j++) {
tstr = String(_gameDescriptions[i]->filesDescriptions[j].fileName);
tstr.toLowercase();
tstr2 = tstr + ".";
@@ -293,11 +291,10 @@ ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Pla
}
for (i = 0; i < _gameDescriptions.size(); i++) {
- filesCount = _gameDescriptions[i]->filesCount;
fileMissing = false;
// Try to open all files for this game
- for (j = 0; j < filesCount; j++) {
+ for (j = 0; _gameDescriptions[i]->filesDescriptions[j].fileName; j++) {
fileDesc = &_gameDescriptions[i]->filesDescriptions[j];
tstr = fileDesc->fileName;
tstr.toLowercase();
@@ -336,7 +333,10 @@ ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Pla
// Search max number
int maxcount = 0;
for (i = 0; i < matchedCount; i++) {
- maxcount = MAX(_gameDescriptions[matched[i]]->filesCount, maxcount);
+ int fCount = 0;
+ for (j = 0; _gameDescriptions[i]->filesDescriptions[j].fileName; j++)
+ fCount++;
+ maxcount = MAX(fCount, maxcount);
}
// Now purge targets with number of files lesser than max
@@ -348,7 +348,11 @@ ADList AdvancedDetector::detectGame(const FSList *fslist, Language language, Pla
continue;
}
- if (_gameDescriptions[matched[i]]->filesCount < maxcount) {
+ int fCount = 0;
+ for (j = 0; _gameDescriptions[matched[i]]->filesDescriptions[j].fileName; j++)
+ fCount++;
+
+ if (fCount < maxcount) {
debug(2, "Purged: %s", getDescription(matched[i]).c_str());
matched[i] = -1;
}