aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-11-21 03:48:53 +0000
committerJohannes Schickel2009-11-21 03:48:53 +0000
commit1ede080ed9020e62468b7e43e44c5747f19b9231 (patch)
tree691ff135b8ec82d072549857d659a2b5e107d0bc
parentcb1e66f21e74c8c4a8673a8756f05403e9b10e0c (diff)
downloadscummvm-rg350-1ede080ed9020e62468b7e43e44c5747f19b9231.tar.gz
scummvm-rg350-1ede080ed9020e62468b7e43e44c5747f19b9231.tar.bz2
scummvm-rg350-1ede080ed9020e62468b7e43e44c5747f19b9231.zip
Add proper error messages, in case some entries aren't found.
svn-id: r46035
-rw-r--r--tools/create_kyradat/create_kyradat.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 21d23378e4..e78c83f8f6 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -1349,13 +1349,16 @@ bool getExtractionData(const Game *g, Search &search, ExtractMap &map) {
results.clear();
searchMap.clear();
+ bool result = true;
+
for (const int *entry = needList; *entry != -1; ++entry) {
MatchList possibleMatches = filterPlatformMatches(g, temporaryExtractMap.equal_range(*entry));
- // This means, no matching entries were found, this is in general not a good sign, we might
- // think of nicer handling of this in the future. TODO: Error out?
- if (possibleMatches.empty())
+ if (possibleMatches.empty()) {
+ fprintf(stderr, "ERROR: No entry found for id %d/%s\n", *entry, getIdString(*entry));
+ result = false;
continue;
+ }
const ExtractFilename *fDesc = getFilenameDesc(*entry);
if (!fDesc)
@@ -1367,27 +1370,30 @@ bool getExtractionData(const Game *g, Search &search, ExtractMap &map) {
continue;
MatchList langMatches = filterLanguageMatches(g->lang[i], possibleMatches);
- if (langMatches.empty())
- printf("foo %s %d\n", getIdString(*entry), g->lang[i]);
MatchList::const_iterator bestMatch = filterOutBestMatch(langMatches);
- // TODO: Error out. This case means an entry was not found for a required language.
- if (bestMatch == langMatches.end())
+ if (bestMatch == langMatches.end()) {
+ // TODO: Add nice language name to output message.
+ fprintf(stderr, "ERROR: No entry found for id %d/%s for language %d\n", *entry, getIdString(*entry), g->lang[i]);
+ result = false;
continue;
+ }
map.insert(**bestMatch);
}
} else {
MatchList::const_iterator bestMatch = filterOutBestMatch(possibleMatches);
- // TODO: Error out. This case means an entry was not found.
- if (bestMatch == possibleMatches.end())
+ if (bestMatch == possibleMatches.end()) {
+ fprintf(stderr, "ERROR: No entry found for id %d/%s\n", *entry, getIdString(*entry));
+ result = false;
continue;
+ }
map.insert(**bestMatch);
}
}
- return true;
+ return result;
}