aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2018-05-10 09:26:26 +0200
committerBastien Bouclet2018-05-10 09:26:26 +0200
commit1dcb8076db64420ab28722a73583f89b38314e71 (patch)
tree84b14cadcdc06c9fcb161a1f81b3918f2b5b6729 /engines
parent2fe060e5c9491ddd7c8f639aab5d7c58c7c73092 (diff)
downloadscummvm-rg350-1dcb8076db64420ab28722a73583f89b38314e71.tar.gz
scummvm-rg350-1dcb8076db64420ab28722a73583f89b38314e71.tar.bz2
scummvm-rg350-1dcb8076db64420ab28722a73583f89b38314e71.zip
ENGINES: Remove usage of C++11 extended initializer lists
Diffstat (limited to 'engines')
-rw-r--r--engines/advancedDetector.cpp2
-rw-r--r--engines/game.cpp14
-rw-r--r--engines/game.h4
-rw-r--r--engines/obsolete.cpp6
-rw-r--r--engines/sky/detection.cpp2
-rw-r--r--engines/sword1/detection.cpp2
-rw-r--r--engines/sword2/sword2.cpp4
7 files changed, 24 insertions, 10 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index c7b5c18892..3167dd9581 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -589,7 +589,7 @@ PlainGameDescriptor AdvancedMetaEngine::findGame(const char *gameId) const {
return *g;
// No match found
- return PlainGameDescriptor();
+ return PlainGameDescriptor::empty();
}
AdvancedMetaEngine::AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds, const ADExtraGuiOptionsMap *extraGuiOptions)
diff --git a/engines/game.cpp b/engines/game.cpp
index 3823000bce..ee14acf7c8 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -35,6 +35,20 @@ const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const Pla
return 0;
}
+PlainGameDescriptor PlainGameDescriptor::empty() {
+ PlainGameDescriptor pgd;
+ pgd.gameId = nullptr;
+ pgd.description = nullptr;
+ return pgd;
+}
+
+PlainGameDescriptor PlainGameDescriptor::of(const char *gameId, const char *description) {
+ PlainGameDescriptor pgd;
+ pgd.gameId = gameId;
+ pgd.description = description;
+ return pgd;
+}
+
DetectedGame::DetectedGame() :
engineName(nullptr),
hasUnknownFiles(false),
diff --git a/engines/game.h b/engines/game.h
index 660a94ad6c..14f9962ce6 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -39,8 +39,8 @@ struct PlainGameDescriptor {
const char *gameId;
const char *description;
- PlainGameDescriptor() : gameId(nullptr), description(nullptr) {}
- PlainGameDescriptor(const char *id, const char *desc) : gameId(id), description(desc) {}
+ static PlainGameDescriptor empty();
+ static PlainGameDescriptor of(const char *gameId, const char *description);
};
/**
diff --git a/engines/obsolete.cpp b/engines/obsolete.cpp
index 48809df712..ea96cff42e 100644
--- a/engines/obsolete.cpp
+++ b/engines/obsolete.cpp
@@ -73,16 +73,16 @@ PlainGameDescriptor findGameID(
if (0 == scumm_stricmp(gameid, o->from)) {
g = findPlainGameDescriptor(o->to, gameids);
if (g && g->description)
- return PlainGameDescriptor(gameid, g->description);
+ return PlainGameDescriptor::of(gameid, g->description);
else
- return PlainGameDescriptor(gameid, "Obsolete game ID");
+ return PlainGameDescriptor::of(gameid, "Obsolete game ID");
}
o++;
}
}
// No match found
- return PlainGameDescriptor();
+ return PlainGameDescriptor::empty();
}
} // End of namespace Engines
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 6beaf02fdc..642e4d31a7 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -138,7 +138,7 @@ const ExtraGuiOptions SkyMetaEngine::getExtraGuiOptions(const Common::String &ta
PlainGameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
if (0 == scumm_stricmp(gameid, skySetting.gameId))
return skySetting;
- return PlainGameDescriptor();
+ return PlainGameDescriptor::empty();
}
DetectedGames SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 6504806423..52394cec41 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -140,7 +140,7 @@ PlainGameDescriptor SwordMetaEngine::findGame(const char *gameId) const {
return sword1PSXSettings;
if (0 == scumm_stricmp(gameId, sword1PSXDemoSettings.gameId))
return sword1PSXDemoSettings;
- return PlainGameDescriptor();
+ return PlainGameDescriptor::empty();
}
void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound, bool recursion = false) {
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 0ec0e3f726..4d8399e630 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -123,7 +123,7 @@ PlainGameList Sword2MetaEngine::getSupportedGames() const {
const Sword2::GameSettings *g = Sword2::sword2_settings;
PlainGameList games;
while (g->gameid) {
- games.push_back(PlainGameDescriptor(g->gameid, g->description));
+ games.push_back(PlainGameDescriptor::of(g->gameid, g->description));
g++;
}
return games;
@@ -142,7 +142,7 @@ PlainGameDescriptor Sword2MetaEngine::findGame(const char *gameid) const {
break;
g++;
}
- return PlainGameDescriptor(g->gameid, g->description);
+ return PlainGameDescriptor::of(g->gameid, g->description);
}
bool isFullGame(const Common::FSList &fslist) {