diff options
author | Torbjörn Andersson | 2013-01-02 19:28:25 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2013-01-02 19:31:05 +0100 |
commit | f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1 (patch) | |
tree | 67b50cadd20ce503ce3420c1eabb5404df96a841 /base/commandLine.cpp | |
parent | 840633c5085e794d9323d947440fec6d39dcf79f (diff) | |
download | scummvm-rg350-f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1.tar.gz scummvm-rg350-f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1.tar.bz2 scummvm-rg350-f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1.zip |
JANITORIAL: Fix or silence a couple of Clang analyzer warnings
Clang will produce plenty of warnings (most of them seem to be of
the "if the stars align the wrong way, this may happen" variety),
but I don't have the time or patience to look at all of them.
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r-- | base/commandLine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 44007c494a..7f88dc0b63 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -145,7 +145,7 @@ static const char HELP_STRING[] = static const char *s_appName = "scummvm"; -static void usage(const char *s, ...) GCC_PRINTF(1, 2); +static void NORETURN_PRE usage(const char *s, ...) GCC_PRINTF(1, 2) NORETURN_POST; static void usage(const char *s, ...) { char buf[STRINGBUFLEN]; @@ -314,8 +314,11 @@ void registerDefaults() { Common::String parseCommandLine(Common::StringMap &settings, int argc, const char * const *argv) { const char *s, *s2; + if (!argv) + return Common::String(); + // argv[0] contains the name of the executable. - if (argv && argv[0]) { + if (argv[0]) { s = strrchr(argv[0], '/'); s_appName = s ? (s+1) : argv[0]; } @@ -579,8 +582,7 @@ static void listGames() { "-------------------- ------------------------------------------------------\n"); const EnginePlugin::List &plugins = EngineMan.getPlugins(); - EnginePlugin::List::const_iterator iter = plugins.begin(); - for (iter = plugins.begin(); iter != plugins.end(); ++iter) { + for (EnginePlugin::List::const_iterator iter = plugins.begin(); iter != plugins.end(); ++iter) { GameList list = (**iter)->getSupportedGames(); for (GameList::iterator v = list.begin(); v != list.end(); ++v) { printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str()); |