From 329bb58b0435bfe1f949e1507591d3d9af11834f Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 17 Apr 2012 19:42:53 +0000 Subject: [PATCH] - a few code cleanup items while doing some testing in VC++ 2010 --- mk/windoze/g3d_viewer.vcxproj | 4 ++-- mk/windoze/glest_game.vcxproj | 4 ++-- mk/windoze/shared_lib.vcxproj | 6 +++--- source/glest_game/menu/menu_state_connected_game.cpp | 2 +- source/glest_game/network/server_interface.cpp | 2 +- source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c | 2 +- source/shared_lib/sources/graphics/JPGReader.cpp | 2 +- source/shared_lib/sources/map/map_preview.cpp | 1 + source/shared_lib/sources/xml/xml_parser.cpp | 4 ++-- 9 files changed, 14 insertions(+), 13 deletions(-) diff --git a/mk/windoze/g3d_viewer.vcxproj b/mk/windoze/g3d_viewer.vcxproj index ee23427d..666b7371 100644 --- a/mk/windoze/g3d_viewer.vcxproj +++ b/mk/windoze/g3d_viewer.vcxproj @@ -84,8 +84,8 @@ /arch:SSE2 %(AdditionalOptions) - ..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd;..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc;..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;..\..\source\win32_deps\wxWidgets-2.8.10\include;..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;../../source/win32_deps/SDL-1.2.x/include;../../source/win32_deps/curl-7.21.3/include;..\..\source\glest_game\graphics;..\..\source\shared_lib\include\xml;../../source/win32_deps/xerces-c-3.0.1/src;..\..\source\glest_game\global;..\..\source\glest_game\sound;..\..\source\shared_lib\include\sound;..\..\source\glest_game\game;../../source/shared_lib/include/map;../../source/win32_deps/lpng141;..\..\source\glest_game\facilities;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;CURL_STATICLIB;%(PreprocessorDefinitions) + "..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;"../../source/win32_deps/SDL-1.2.x/include";"../../source/win32_deps/curl-7.21.3/include";..\..\source\glest_game\graphics;..\..\source\shared_lib\include\xml;"../../source/win32_deps/xerces-c-3.0.1/src";..\..\source\glest_game\global;..\..\source\glest_game\sound;..\..\source\shared_lib\include\sound;..\..\source\glest_game\game;../../source/shared_lib/include/map;../../source/win32_deps/lpng141;..\..\source\glest_game\facilities;"../../source/win32_deps/glew-1.7.0/include";%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;CURL_STATICLIB;UNICODE;GLEW_STATIC;%(PreprocessorDefinitions) true Async MultiThreaded diff --git a/mk/windoze/glest_game.vcxproj b/mk/windoze/glest_game.vcxproj index 4f97118a..40ef275c 100644 --- a/mk/windoze/glest_game.vcxproj +++ b/mk/windoze/glest_game.vcxproj @@ -106,9 +106,9 @@ Speed true false - ../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;../../source/win32_deps/xerces-c-3.0.1/src;../../source/win32_deps/SDL-1.2.x/include;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;../../source/win32_deps/openal-soft-1.12.854/include;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;../../source/win32_deps/curl-7.21.3/include;../../source/shared_lib/include/map;../../source/win32_deps/libircclient/include + ../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;../../source/win32_deps/xerces-c-3.0.1/src;../../source/win32_deps/SDL-1.2.x/include;../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;../../source/win32_deps/openal-soft-1.12.854/include;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/platform/common;../../source/win32_deps/curl-7.21.3/include;../../source/shared_lib/include/map;../../source/win32_deps/libircclient/include;../../source/win32_deps/glew-1.7.0/include %(AdditionalUsingDirectories) - WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS;USE_STREFLOP;STREFLOP_SSE;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;GLEW_STATIC%(PreprocessorDefinitions) true Async MultiThreaded diff --git a/mk/windoze/shared_lib.vcxproj b/mk/windoze/shared_lib.vcxproj index c95ebb65..e545d451 100644 --- a/mk/windoze/shared_lib.vcxproj +++ b/mk/windoze/shared_lib.vcxproj @@ -94,8 +94,8 @@ true Speed false - ../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;../../source/win32_deps/xerces-c-3.0.1/src;../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude;../../source/win32_deps/lpng141;../../source/win32_deps/jpeg-8a;../../source/win32_deps/SDL-1.2.x/include;../../source/shared_lib/include/platform/sdl;../../source/win32_deps/openal-soft-1.12.854/include;../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;../../source/win32_deps/curl-7.21.3/include;../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp - WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;%(PreprocessorDefinitions) + ../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude";../../source/win32_deps/lpng141;"../../source/win32_deps/jpeg-8a";"../../source/win32_deps/SDL-1.2.x/include";../../source/shared_lib/include/platform/sdl;"../../source/win32_deps/openal-soft-1.12.854/include";../../source/shared_lib/include/sound/openal;../../source/shared_lib/include/platform/posix;../../source/shared_lib/include/streflop;../../source/shared_lib/include/streflop/libm_flt32_source;../../source/shared_lib/include/platform/common;"../../source/win32_deps/curl-7.21.3/include";../../source/shared_lib/include/map;../../source/shared_lib/include/platform/miniupnpc;../../source/shared_lib/include/libircclient/include;../../source/shared_lib/include/feathery_ftp;"../../source/win32_deps/ftgl-2.1.3-rc5/src";"../../source/win32_deps/freetype-2.4.4/include";"../../source/win32_deps/glew-1.7.0/include";../../source/shared_lib/include/graphics/md5;"../../source/shared_lib/include/graphics/freetype-gl";../../source/shared_lib/include/streflop/softfloat; + WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1;USE_STREFLOP;STREFLOP_SSE;STREFLOP_RANDOM_GEN_SIZE=32;LIBM_COMPILING_FLT32;CURL_STATICLIB;UNICODE;USE_FTGL;TA3D_PLATFORM_MSVC;TA3D_PLATFORM_WINDOWS;STATICLIB;USE_FREETYPEGL;GLEW_STATIC%(PreprocessorDefinitions) true Async MultiThreaded @@ -167,6 +167,7 @@ CompileAsC + @@ -240,7 +241,6 @@ - diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 09504425..18a530fc 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -30,7 +30,7 @@ #include "cache_manager.h" #include "string_utils.h" #include "map_preview.h" - +#include #include "leak_dumper.h" namespace Glest{ namespace Game{ diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 8b02907d..aca903c2 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -27,7 +27,7 @@ #include #include #include "map_preview.h" - +#include #include "leak_dumper.h" using namespace std; diff --git a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c index 8d0ede72..83f1ed81 100644 --- a/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c +++ b/source/shared_lib/sources/feathery_ftp/ftpTargetWin32.c @@ -105,7 +105,7 @@ void* ftpOpenDir(const char* path) const char* ftpReadDir(void* dirHandle) { WIN32_FIND_DATA findData; - readDir_S* p = dirHandle; + readDir_S* p = (readDir_S *)dirHandle; if(dirHandle == NULL) return NULL; diff --git a/source/shared_lib/sources/graphics/JPGReader.cpp b/source/shared_lib/sources/graphics/JPGReader.cpp index 5b5e450a..2c3b13b2 100644 --- a/source/shared_lib/sources/graphics/JPGReader.cpp +++ b/source/shared_lib/sources/graphics/JPGReader.cpp @@ -75,7 +75,7 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const assert(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false); //Read file is.seekg(0, ios::end); - size_t length = is.tellg(); + streampos length = is.tellg(); if (length < 8) { return NULL; } diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index 0ac92985..3bef9dc8 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include "platform_util.h" #include "conversion.h" diff --git a/source/shared_lib/sources/xml/xml_parser.cpp b/source/shared_lib/sources/xml/xml_parser.cpp index 0ca51c76..a364d37a 100644 --- a/source/shared_lib/sources/xml/xml_parser.cpp +++ b/source/shared_lib/sources/xml/xml_parser.cpp @@ -285,12 +285,12 @@ XmlNode *XmlIoRapid::load(const string &path, std::map mapTagRepl // Determine stream size xmlFile.seekg(0, ios::end); - size_t size = xmlFile.tellg(); + streampos size = xmlFile.tellg(); xmlFile.seekg(0); // Load data and add terminating 0 vector buffer; - buffer.resize(size + 1); + buffer.resize(size + (streampos)1); xmlFile.read(&buffer.front(), static_cast(size)); buffer[size] = 0;