From 3fb957a13e9ab998bb93c0d6a2bb30866c874ba4 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 2 Nov 2013 22:58:00 +0000 Subject: [PATCH] more vc++ compiler warning cleanup --- source/glest_game/main/intro.cpp | 6 +++--- source/glest_game/main/main.cpp | 10 +++++----- source/glest_game/network/network_message.cpp | 2 +- source/glest_game/type_instances/unit.cpp | 2 +- source/shared_lib/include/platform/sdl/platform_main.h | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/glest_game/main/intro.cpp b/source/glest_game/main/intro.cpp index 861a3128..ac3c7712 100644 --- a/source/glest_game/main/intro.cpp +++ b/source/glest_game/main/intro.cpp @@ -249,7 +249,7 @@ Intro::Intro(Program *program): //printf("picIndex = %d list count = %d\n",picIndex,coreData.getMiscTextureList().size()); modelList.push_back(models[index]); usedIndex[index]=true; - srand((unsigned int)seed.getCurTicks() / modelList.size()); + srand((unsigned int)seed.getCurTicks() / (unsigned int)modelList.size()); } models = modelList; } @@ -451,7 +451,7 @@ Intro::Intro(Program *program): //printf("picIndex = %d list count = %d\n",picIndex,coreData.getMiscTextureList().size()); intoTexList.push_back(coreData.getMiscTextureList()[picIndex]); usedIndex[picIndex]=true; - srand((unsigned int)seed.getCurTicks() / intoTexList.size()); + srand((unsigned int)seed.getCurTicks() / (unsigned int)intoTexList.size()); } } else { @@ -620,7 +620,7 @@ void Intro::renderModelBackground() { if(models.empty() == false) { int difTime= 1000 * timer / GameConstants::updateFps - modelShowTime; int totalModelShowTime = Intro::introTime - modelShowTime; - int individualModelShowTime = totalModelShowTime / models.size(); + int individualModelShowTime = totalModelShowTime / (int)models.size(); //printf("difTime = %d individualModelShowTime = %d modelIndex = %d\n",difTime,individualModelShowTime,modelIndex); diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index c98dab18..75b60685 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -1053,7 +1053,7 @@ void MainWindow::showLanguages() { } menuItems.push_back(lang.getString("Exit")); - cancelLanguageSelection = menuItems.size()-1; + cancelLanguageSelection = (int)menuItems.size()-1; popupMenu.setW(100); popupMenu.setH(100); @@ -3146,7 +3146,7 @@ void ShowINISettings(int argc, char **argv,Config &config,Config &configKeys) { } if(displayProperty == true) { - int requredTabs = (nameValue.first.length() / 8)+1; + int requredTabs = ((int)nameValue.first.length() / 8)+1; if(nameValue.first.length() % 8) { requredTabs++; } @@ -3169,7 +3169,7 @@ void ShowINISettings(int argc, char **argv,Config &config,Config &configKeys) { } if(displayProperty == true) { - int requredTabs = (nameValue.first.length() / 8)+1; + int requredTabs = ((int)nameValue.first.length() / 8)+1; if(nameValue.first.length() % 8) { requredTabs++; } @@ -3196,7 +3196,7 @@ void ShowINISettings(int argc, char **argv,Config &config,Config &configKeys) { if(displayProperty == true) { printf("Property Name [%s]",nameValue.first.c_str()); - int tabs = (nameValue.first.length() / 8) + 1; + int tabs = ((int)nameValue.first.length() / 8) + 1; for(int j = 0; j < (tabCount - tabs); ++j) { printf("\t"); } @@ -3229,7 +3229,7 @@ void ShowINISettings(int argc, char **argv,Config &config,Config &configKeys) { if(displayProperty == true) { printf("Property Name [%s]",nameValue.first.c_str()); - int tabs = (nameValue.first.length() / 8) + 1; + int tabs = ((int)nameValue.first.length() / 8) + 1; for(int j = 0; j < (tabCount - tabs); ++j) { printf("\t"); } diff --git a/source/glest_game/network/network_message.cpp b/source/glest_game/network/network_message.cpp index 1b04029c..28080120 100644 --- a/source/glest_game/network/network_message.cpp +++ b/source/glest_game/network/network_message.cpp @@ -619,7 +619,7 @@ void NetworkMessageLaunch::buildGameSettings(GameSettings *gameSettings) const { gameSettings->setGameUUID(data.gameUUID.getString()); - gameSettings->setNetworkAllowNativeLanguageTechtree((bool)data.networkAllowNativeLanguageTechtree); + gameSettings->setNetworkAllowNativeLanguageTechtree((data.networkAllowNativeLanguageTechtree != 0)); } vector > NetworkMessageLaunch::getFactionCRCList() const { diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index fda59588..ea59ff64 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -5237,7 +5237,7 @@ Checksum Unit::getCRC() { //Commands commands; if(commands.empty() == false) { - crcForUnit.addInt(commands.size()); + crcForUnit.addInt((int)commands.size()); for(Commands::const_iterator it= commands.begin(); it != commands.end(); ++it) { uint32 crc = (*it)->getCRC().getSum(); crcForUnit.addBytes(&crc,sizeof(uint32)); diff --git a/source/shared_lib/include/platform/sdl/platform_main.h b/source/shared_lib/include/platform/sdl/platform_main.h index 8a4fa4bb..2bf79f45 100644 --- a/source/shared_lib/include/platform/sdl/platform_main.h +++ b/source/shared_lib/include/platform/sdl/platform_main.h @@ -488,11 +488,11 @@ bool hasCommandArgument(int argc, char** argv,const string argName, int *foundIn if(foundIndex != NULL) { *foundIndex = -1; } - int compareLen = strlen(argName.c_str()); + int compareLen = (int)strlen(argName.c_str()); for(int idx = startLookupIndex; idx < argc; idx++) { if(useArgParamLen == true) { - compareLen = strlen(argv[idx]); + compareLen = (int)strlen(argv[idx]); } if(_strnicmp(argName.c_str(),argv[idx],compareLen) == 0) { result = true;