From 433f4e84ced2451dc92a9ff86a5c36e09defaf63 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Wed, 28 Mar 2012 06:34:34 +0000 Subject: [PATCH] - a few more fixes found using cppcheck --- mk/linux/mg_cppcheck.sh | 2 +- source/glest_game/world/map.cpp | 2 +- source/shared_lib/sources/platform/common/platform_common.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mk/linux/mg_cppcheck.sh b/mk/linux/mg_cppcheck.sh index 30cd5477..bcf9c894 100755 --- a/mk/linux/mg_cppcheck.sh +++ b/mk/linux/mg_cppcheck.sh @@ -4,7 +4,7 @@ # Written by Mark Vejvoda # Copyright (c) 2011 Mark Vejvoda under GNU GPL v3.0+ -cppcheck ../../source/ -i ../../source/win32_deps -i ../../source/configurator -j 5 --enable=all 2> cppcheck.log +cppcheck ../../source/ -i ../../source/win32_deps -i ../../source/configurator -j 5 --enable=all --force --verbose 2> cppcheck.log echo "Results from cppcheck were written to cppcheck.log" diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 7d439b2c..aa0c8998 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -1963,7 +1963,7 @@ void Map::loadGame(const XmlNode *rootNode, World *world) { //XmlNode *surfaceCellNode = mapNode->getChild("SurfaceCell"); string exploredList = surfaceCellNode->getAttribute("exploredList")->getValue(); string visibleList = surfaceCellNode->getAttribute("visibleList")->getValue(); - int batchIndex = surfaceCellNode->getAttribute("batchIndex")->getIntValue(); + //int batchIndex = surfaceCellNode->getAttribute("batchIndex")->getIntValue(); vector tokensExplored; Tokenize(exploredList,tokensExplored,","); diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index d5b2f958..7b29035b 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -617,7 +617,7 @@ pair hasCachedFileCRCValue(string crcCacheFile, int32 &value) { time_t refreshDate = 0; int32 crcValue = 0; time_t lastUpdateDate = 0; - int readbytes = fscanf(fp,"%ld,%d,%ld",&refreshDate,&crcValue,&lastUpdateDate); + int readbytes = fscanf(fp,"%20ld,%20d,%20ld",&refreshDate,&crcValue,&lastUpdateDate); fclose(fp); result.second = lastUpdateDate;