From f4514069f33ba6a0ec72756a1aa3b2ae7b9ff6d1 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 2 Jan 2013 19:28:25 +0100 Subject: 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. --- base/commandLine.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'base') 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()); -- cgit v1.2.3