From 0447aa9814449e0586f5625f92f046f0215c3667 Mon Sep 17 00:00:00 2001 From: joris <joris.dauphin@gmail.com> Date: Sun, 24 Mar 2013 14:58:32 +0100 Subject: [PATCH] Fix some cppcheck warnings. --- src/game/game.cpp | 2 +- src/stratagus/iolib.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 456e470df..e610cb178 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -122,7 +122,7 @@ void StartMap(const std::string &filename, bool clean) } GetDefaultTextColors(nc, rc); - CreateGame(filename.c_str(), &Map); + CreateGame(filename, &Map); UI.StatusLine.Set(NameLine); SetMessage("%s", _("Do it! Do it now!")); diff --git a/src/stratagus/iolib.cpp b/src/stratagus/iolib.cpp index e880061a4..6cc8b8be7 100644 --- a/src/stratagus/iolib.cpp +++ b/src/stratagus/iolib.cpp @@ -508,11 +508,12 @@ long CFile::PImpl::tell() */ static bool FindFileWithExtension(char *file, size_t filesize) { - char buf[PATH_MAX]; - if (!access(file, R_OK)) { return true; } +#if defined(USE_ZLIB) || defined(USE_BZ2LIB) + char buf[PATH_MAX]; +#endif #ifdef USE_ZLIB // gzip or bzip2 in global shared directory sprintf(buf, "%s.gz", file); if (!access(buf, R_OK)) {