diff --git a/source/glest_game/ai/ai.cpp b/source/glest_game/ai/ai.cpp index a2244b8e..c75c6bd8 100644 --- a/source/glest_game/ai/ai.cpp +++ b/source/glest_game/ai/ai.cpp @@ -535,7 +535,7 @@ bool Ai::findAbleUnit(int *unitIndex, CommandClass ability, bool idleOnly){ return false; } else{ - *unitIndex= units[random.randRange(0, units.size()-1)]; + *unitIndex= units[random.randRange(0, (int)units.size()-1)]; return true; } } @@ -634,7 +634,7 @@ bool Ai::findAbleUnit(int *unitIndex, CommandClass ability, CommandClass current return false; } else{ - *unitIndex= units[random.randRange(0, units.size()-1)]; + *unitIndex= units[random.randRange(0, (int)units.size()-1)]; return true; } } @@ -721,7 +721,7 @@ Vec2i Ai::getRandomHomePosition() { return aiInterface->getHomeLocation(); } - return expansionPositions[random.randRange(0, expansionPositions.size()-1)]; + return expansionPositions[random.randRange(0, (int)expansionPositions.size()-1)]; } // ==================== actions ==================== @@ -781,7 +781,7 @@ void Ai::sendScoutPatrol(){ std::vector warningEnemyList = aiInterface->getEnemyWarningPositionList(); if( (possibleTargetFound == false) && (warningEnemyList.empty() == false)) { - for(int i = warningEnemyList.size() - 1; i <= 0; --i) { + for(int i = (int)warningEnemyList.size() - 1; i <= 0; --i) { Vec2i &checkPos = warningEnemyList[i]; if (random.randRange(0, 1) == 1 ) { pos = checkPos; diff --git a/source/glest_game/ai/ai_interface.cpp b/source/glest_game/ai/ai_interface.cpp index 0caec7c0..557dd4ac 100644 --- a/source/glest_game/ai/ai_interface.cpp +++ b/source/glest_game/ai/ai_interface.cpp @@ -833,7 +833,7 @@ bool AiInterface::isFreeCells(const Vec2i &pos, int size, Field field){ } void AiInterface::removeEnemyWarningPositionFromList(Vec2i &checkPos) { - for(int i = enemyWarningPositionList.size() - 1; i >= 0; --i) { + for(int i = (int)enemyWarningPositionList.size() - 1; i >= 0; --i) { Vec2i &pos = enemyWarningPositionList[i]; if(checkPos == pos) { diff --git a/source/glest_game/ai/ai_rule.cpp b/source/glest_game/ai/ai_rule.cpp index 72928d98..d68b4195 100644 --- a/source/glest_game/ai/ai_rule.cpp +++ b/source/glest_game/ai/ai_rule.cpp @@ -981,7 +981,7 @@ void AiRuleProduce::produceGenericNew(const ProduceTask *pt) { } //normal case - int randomUnitTypeIndex = ai->getRandom()->randRange(0, ableUnits.size()-1); + int randomUnitTypeIndex = ai->getRandom()->randRange(0, (int)ableUnits.size()-1); if(aiInterface->isLogLevelEnabled(4) == true) { char szBuf[8096]=""; snprintf(szBuf,8096,"In produceGeneric randomUnitTypeIndex = %d of " MG_SIZE_T_SPECIFIER " equals unit type [%s]",randomUnitTypeIndex,ableUnits.size()-1,ableUnits[randomUnitTypeIndex]->getName(false).c_str()); @@ -1117,7 +1117,7 @@ void AiRuleProduce::produceGeneric(const ProduceTask *pt) { } //normal case - ai->addTask(new ProduceTask(ableUnits[ai->getRandom()->randRange(0, ableUnits.size()-1)])); + ai->addTask(new ProduceTask(ableUnits[ai->getRandom()->randRange(0, (int)ableUnits.size()-1)])); } } @@ -1257,7 +1257,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if( aiInterface->getControlType() == ctCpuMega || aiInterface->getControlType() == ctNetworkCpuMega) {// mega cpu trys to balance the commands to the producers - int randomstart=ai->getRandom()->randRange(0, producers.size()-1); + int randomstart=ai->getRandom()->randRange(0, (int)producers.size()-1); int lowestCommandCount=1000000; int currentProducerIndex=producers[randomstart]; int bestIndex=-1; @@ -1266,7 +1266,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ for(unsigned int i=randomstart; i= producers.size()) { - prIndex = (i - producers.size()); + prIndex = (i - (int)producers.size()); } currentProducerIndex=producers[prIndex]; @@ -1323,14 +1323,14 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ } } if(!backupProducers.empty()) { - int randomstart=ai->getRandom()->randRange(0, backupProducers.size()-1); + int randomstart=ai->getRandom()->randRange(0, (int)backupProducers.size()-1); int lowestCommandCount=1000000; int currentProducerIndex=backupProducers[randomstart]; int bestIndex=-1; for(unsigned int i=randomstart; i= backupProducers.size()) { - prIndex = (i - backupProducers.size()); + prIndex = (i - (int)backupProducers.size()); } currentProducerIndex=backupProducers[prIndex]; @@ -1375,7 +1375,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ } } } - int commandIndex=productionCommandIndexes[ai->getRandom()->randRange(0, productionCommandIndexes.size()-1)]; + int commandIndex=productionCommandIndexes[ai->getRandom()->randRange(0, (int)productionCommandIndexes.size()-1)]; if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); if(ai->outputAIBehaviourToConsole()) printf("mega #1 produceSpecific giveCommand to unit [%s] commandType [%s]\n",aiInterface->getMyUnit(bestIndex)->getType()->getName().c_str(),ut->getCommandType(commandIndex)->getName().c_str()); @@ -1392,7 +1392,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); defCt = NULL; if(producersDefaultCommandType.find(bestIndex) != producersDefaultCommandType.end()) { - int bestCommandTypeCount = producersDefaultCommandType[bestIndex].size(); + int bestCommandTypeCount = (int)producersDefaultCommandType[bestIndex].size(); int bestCommandTypeIndex = ai->getRandom()->randRange(0, bestCommandTypeCount-1); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] bestCommandTypeIndex = %d, bestCommandTypeCount = %d\n",__FILE__,__FUNCTION__,__LINE__,bestCommandTypeIndex,bestCommandTypeCount); @@ -1416,7 +1416,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ defCt = NULL; if(producersDefaultCommandType.find(bestIndex) != producersDefaultCommandType.end()) { //defCt = producersDefaultCommandType[bestIndex]; - int bestCommandTypeCount = producersDefaultCommandType[bestIndex].size(); + int bestCommandTypeCount = (int)producersDefaultCommandType[bestIndex].size(); int bestCommandTypeIndex = ai->getRandom()->randRange(0, bestCommandTypeCount-1); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] bestCommandTypeIndex = %d, bestCommandTypeCount = %d\n",__FILE__,__FUNCTION__,__LINE__,bestCommandTypeIndex,bestCommandTypeCount); @@ -1437,7 +1437,7 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ defCt = NULL; if(producersDefaultCommandType.find(bestIndex) != producersDefaultCommandType.end()) { //defCt = producersDefaultCommandType[bestIndex]; - int bestCommandTypeCount = producersDefaultCommandType[bestIndex].size(); + int bestCommandTypeCount = (int)producersDefaultCommandType[bestIndex].size(); int bestCommandTypeIndex = ai->getRandom()->randRange(0, bestCommandTypeCount-1); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] bestCommandTypeIndex = %d, bestCommandTypeCount = %d\n",__FILE__,__FUNCTION__,__LINE__,bestCommandTypeIndex,bestCommandTypeCount); @@ -1455,12 +1455,12 @@ void AiRuleProduce::produceSpecific(const ProduceTask *pt){ } } else { - int pIndex = ai->getRandom()->randRange(0, producers.size()-1); + int pIndex = ai->getRandom()->randRange(0, (int)producers.size()-1); int producerIndex= producers[pIndex]; defCt = NULL; if(producersDefaultCommandType.find(producerIndex) != producersDefaultCommandType.end()) { //defCt = producersDefaultCommandType[producerIndex]; - int bestCommandTypeCount = producersDefaultCommandType[producerIndex].size(); + int bestCommandTypeCount = (int)producersDefaultCommandType[producerIndex].size(); int bestCommandTypeIndex = ai->getRandom()->randRange(0, bestCommandTypeCount-1); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] bestCommandTypeIndex = %d, bestCommandTypeCount = %d\n",__FILE__,__FUNCTION__,__LINE__,bestCommandTypeIndex,bestCommandTypeCount); @@ -1781,7 +1781,7 @@ void AiRuleBuild::buildSpecific(const BuildTask *bt) { //use random builder to build if(builders.empty() == false) { - int bIndex = ai->getRandom()->randRange(0, builders.size()-1); + int bIndex = ai->getRandom()->randRange(0, (int)builders.size()-1); int builderIndex= builders[bIndex]; Vec2i pos; Vec2i searchPos = bt->getForcePos()? bt->getPos(): ai->getRandomHomePosition(); @@ -1828,7 +1828,7 @@ void AiRuleBuild::buildSpecific(const BuildTask *bt) { defBct = NULL; if(buildersDefaultCommandType.find(builderIndex) != buildersDefaultCommandType.end()) { //defBct = buildersDefaultCommandType[builderIndex]; - int bestCommandTypeCount = buildersDefaultCommandType[builderIndex].size(); + int bestCommandTypeCount = (int)buildersDefaultCommandType[builderIndex].size(); int bestCommandTypeIndex = ai->getRandom()->randRange(0, bestCommandTypeCount-1); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] bestCommandTypeIndex = %d, bestCommandTypeCount = %d\n",__FILE__,__FUNCTION__,__LINE__,bestCommandTypeIndex,bestCommandTypeCount); @@ -1991,7 +1991,7 @@ void AiRuleUpgrade::upgradeGeneric(const UpgradeTask *upgt){ //add specific upgrade task if(!upgrades.empty()){ - ai->addTask(new UpgradeTask(upgrades[ai->getRandom()->randRange(0, upgrades.size()-1)])); + ai->addTask(new UpgradeTask(upgrades[ai->getRandom()->randRange(0, (int)upgrades.size()-1)])); } } diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index 76700575..5aadf2dc 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -552,7 +552,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { } } if(bFound == false) { - for(int i = items.size() - 1; i >= selectedItemIndex; --i) { + for(int i = (int)items.size() - 1; i >= selectedItemIndex; --i) { string item = items[i]; if(translated_items.size()>i) item=translated_items[i]; //printf("Trying to match [%s] with item [%s]\n",advanceToItemStartingWith.c_str(),item.c_str()); @@ -568,7 +568,7 @@ bool GraphicListBox::mouseClick(int x, int y,string advanceToItemStartingWith) { selectedItemIndex--; } if(selectedItemIndex<0){ - selectedItemIndex=items.size()-1; + selectedItemIndex = (int)items.size()-1; } } else if(b2) { @@ -1001,7 +1001,7 @@ void PopupMenu::init(string menuHeader,std::vector menuItems) { } int offsetH = (yStartOffset - y); - int maxH = (offsetH + ((menuItems.size() -1 ) * (textHeight + textHeightSpacing))); + int maxH = (offsetH + (((int)menuItems.size() -1 ) * (textHeight + textHeightSpacing))); if(maxH >= h) { h = maxH; y= (metrics.getVirtualH()-h)/2; diff --git a/source/glest_game/facilities/components.h b/source/glest_game/facilities/components.h index f57b3af1..9bc43b69 100644 --- a/source/glest_game/facilities/components.h +++ b/source/glest_game/facilities/components.h @@ -247,7 +247,7 @@ public: GraphicListBox(std::string containerName="", std::string objName=""); void init(int x, int y, int w=defW, int h=defH, Vec3f textColor=GraphicComponent::customTextColor); - int getItemCount() const {return items.size();} + int getItemCount() const {return (int)items.size();} string getItem(int index) const {return items[index];} int getSelectedItemIndex() const {return selectedItemIndex;} string getSelectedItem() const {return items[selectedItemIndex];} @@ -305,7 +305,7 @@ public: bool getAutoWordWrap() const { return autoWordWrap; } void setAutoWordWrap(bool value) { autoWordWrap = value; } - int getButtonCount() const {return buttons.size();} + int getButtonCount() const {return (int)buttons.size();} GraphicButton *getButton(int index) {return buttons[index];} string getHeader() const {return header;} diff --git a/source/glest_game/facilities/game_util.cpp b/source/glest_game/facilities/game_util.cpp index c456e228..6d0086c9 100644 --- a/source/glest_game/facilities/game_util.cpp +++ b/source/glest_game/facilities/game_util.cpp @@ -36,7 +36,7 @@ const string SVN_Rev = string("Rev: ") + string(SVNVERSION); const string SVN_RawRev = string(SVNVERSION); const string SVN_Rev = string("Rev: ") + string(SVNVERSION); #else -const string SVN_RawRev = "$4533$"; +const string SVN_RawRev = "$4682$"; const string SVN_Rev = "$Rev$"; #endif diff --git a/source/glest_game/game/chat_manager.cpp b/source/glest_game/game/chat_manager.cpp index 5e6fc7f2..b41c9373 100644 --- a/source/glest_game/game/chat_manager.cpp +++ b/source/glest_game/game/chat_manager.cpp @@ -178,7 +178,7 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) { string currentAutoCompleteName = ""; int startPos = -1; - for(int i = text.size()-1; i >= 0; --i) { + for(int i = (int)text.size()-1; i >= 0; --i) { if(text[i] != ' ') { startPos = i; } @@ -292,7 +292,7 @@ void ChatManager::keyDown(SDL_KeyboardEvent key) { if(autoCompleteResult != "") { if(replaceCurrentAutoCompleteName >= 0) { - deleteText(currentAutoCompleteName.length(), false); + deleteText((int)currentAutoCompleteName.length(), false); autoCompleteResult = autoCompleteName + autoCompleteResult; @@ -355,8 +355,8 @@ void ChatManager::deleteText(int deleteCount,bool addToAutoCompleteBuffer) { if(textCharLength.empty() == false) { //printf("BEFORE DEL textCharLength.size() = %d textCharLength[textCharLength.size()-1] = %d text.length() = %d\n",textCharLength.size(),textCharLength[textCharLength.size()-1],text.length()); - if(textCharLength[textCharLength.size()-1] > text.length()) { - textCharLength[textCharLength.size()-1] = text.length(); + if(textCharLength[textCharLength.size()-1] > (int)text.length()) { + textCharLength[(int)textCharLength.size()-1] = (int)text.length(); } for(unsigned int i = 0; i < textCharLength[textCharLength.size()-1]; ++i) { text.erase(text.end() -1); @@ -411,7 +411,7 @@ void ChatManager::appendText(const wchar_t *addText, bool validateChars, bool ad void ChatManager::updateAutoCompleteBuffer() { if(text.empty() == false) { int startPos = -1; - for(int i = text.size()-1; i >= 0; --i) { + for(int i = (int)text.size()-1; i >= 0; --i) { if(text[i] != ' ') { startPos = i; } diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 75e4b15d..f7a4ade0 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -517,7 +517,7 @@ bool Commander::hasReplayCommandListForFrame() const { } int Commander::getReplayCommandListForFrameCount() const { - return replayCommandList.size(); + return (int)replayCommandList.size(); } void Commander::updateNetwork(Game *game) { diff --git a/source/glest_game/game/console.h b/source/glest_game/game/console.h index 4e8b6087..bde4b22f 100644 --- a/source/glest_game/game/console.h +++ b/source/glest_game/game/console.h @@ -80,8 +80,8 @@ private: public: Console(); - int getStoredLineCount() const {return storedLines.size();} - int getLineCount() const {return lines.size();} + int getStoredLineCount() const {return (int)storedLines.size();} + int getLineCount() const {return (int)lines.size();} bool getOnlyChatMessagesInStoredLines() const { return onlyChatMessagesInStoredLines ;} void setOnlyChatMessagesInStoredLines(bool value) {this->onlyChatMessagesInStoredLines= value;} diff --git a/source/glest_game/graphics/renderer.h b/source/glest_game/graphics/renderer.h index d37ac6f5..63e071c4 100644 --- a/source/glest_game/graphics/renderer.h +++ b/source/glest_game/graphics/renderer.h @@ -635,7 +635,7 @@ public: static Texture2D * findTexture(string logoFilename); static Texture2D * preloadTexture(string logoFilename); - inline int getCachedSurfaceDataSize() const { return mapSurfaceData.size(); } + inline int getCachedSurfaceDataSize() const { return (int)mapSurfaceData.size(); } //void setCustom3dMenuList(GLuint *customlist3dMenu) { this->customlist3dMenu = customlist3dMenu; } //inline GLuint * getCustom3dMenuList() const { return this->customlist3dMenu; } diff --git a/source/glest_game/gui/selection.h b/source/glest_game/gui/selection.h index 293cbb85..eda08639 100644 --- a/source/glest_game/gui/selection.h +++ b/source/glest_game/gui/selection.h @@ -81,7 +81,7 @@ public: bool isCommandable() const; bool isCancelable() const; bool isMeetable() const; - int getCount() const {return selectedUnits.size();} + int getCount() const {return (int)selectedUnits.size();} const Unit *getUnit(int i) const {return selectedUnits[i];} Unit *getUnitPtr(int i) {return selectedUnits[i];} const Unit *getFrontUnit() const {return selectedUnits.front();} diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 1886b374..c98dab18 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -392,11 +392,17 @@ void write_file_and_line(string & out, HANDLE process, DWORD64 program_counter) } void generate_stack_trace(string &out, CONTEXT ctx, int skip) { STACKFRAME64 sf = {}; +#if !defined(_WIN64) sf.AddrPC.Offset = ctx.Eip; +#endif sf.AddrPC.Mode = AddrModeFlat; +#if !defined(_WIN64) sf.AddrStack.Offset = ctx.Esp; +#endif sf.AddrStack.Mode = AddrModeFlat; +#if !defined(_WIN64) sf.AddrFrame.Offset = ctx.Ebp; +#endif sf.AddrFrame.Mode = AddrModeFlat; HANDLE process = GetCurrentProcess(); @@ -416,11 +422,17 @@ void generate_stack_trace(string &out, CONTEXT ctx, int skip) { if(tryThreadContext == true) { tryThreadContext = false; if(GetThreadContext(thread, &threadContext) != 0) { +#if !defined(_WIN64) sf.AddrPC.Offset = threadContext.Eip; +#endif sf.AddrPC.Mode = AddrModeFlat; +#if !defined(_WIN64) sf.AddrStack.Offset = threadContext.Esp; +#endif sf.AddrStack.Mode = AddrModeFlat; +#if !defined(_WIN64) sf.AddrFrame.Offset = threadContext.Ebp; +#endif sf.AddrFrame.Mode = AddrModeFlat; } else { diff --git a/source/glest_game/menu/menu_state_custom_game.cpp b/source/glest_game/menu/menu_state_custom_game.cpp index 76680de6..c1ead26c 100644 --- a/source/glest_game/menu/menu_state_custom_game.cpp +++ b/source/glest_game/menu/menu_state_custom_game.cpp @@ -978,7 +978,7 @@ void MenuStateCustomGame::mouseClick(int x, int y, MouseButton mouseButton) { string advanceToItemStartingWith = ""; if(Shared::Platform::Window::isKeyStateModPressed(KMOD_SHIFT) == true) { const wchar_t lastKey = Shared::Platform::Window::extractLastKeyPressed(); - xxx: +// xxx: // string hehe=lastKey; // printf("lastKey = %d [%c] '%s'\n",lastKey,lastKey,hehe); advanceToItemStartingWith = lastKey; diff --git a/source/glest_game/menu/menu_state_keysetup.cpp b/source/glest_game/menu/menu_state_keysetup.cpp index c1600db2..2d43eea5 100644 --- a/source/glest_game/menu/menu_state_keysetup.cpp +++ b/source/glest_game/menu/menu_state_keysetup.cpp @@ -186,7 +186,7 @@ MenuStateKeysetup::MenuStateKeysetup(Program *program, MainMenu *mainMenu, keyScrollBar.init(keyButtonsXBase+keyButtonsWidth+labelWidth+20,200,false,200,20); keyScrollBar.setLength(400); - keyScrollBar.setElementCount(keyButtons.size()); + keyScrollBar.setElementCount((int)keyButtons.size()); keyScrollBar.setVisibleSize(keyButtonsToRender); keyScrollBar.setVisibleStart(0); } diff --git a/source/glest_game/menu/menu_state_load_game.cpp b/source/glest_game/menu/menu_state_load_game.cpp index 6c166d68..35e06db7 100644 --- a/source/glest_game/menu/menu_state_load_game.cpp +++ b/source/glest_game/menu/menu_state_load_game.cpp @@ -119,7 +119,7 @@ MenuStateLoadGame::MenuStateLoadGame(Program *program, MainMenu *mainMenu): slotsScrollBar.setVisibleStart(0); listFiles(); - slotsScrollBar.setElementCount(filenames.size()); + slotsScrollBar.setElementCount((int)filenames.size()); mainMessageBox.registerGraphicComponent(containerName,"mainMessageBox"); mainMessageBox.init(lang.getString("Ok"),450); @@ -167,7 +167,7 @@ void MenuStateLoadGame::listFiles() { findAll(paths, "*.xml", filenames, true, false, true); sort(filenames.begin(),filenames.end()); //printf("filenames = %d\n",filenames.size()); - for(int i = filenames.size()-1; i > -1; i--) { + for(int i = (int)filenames.size()-1; i > -1; i--) { GraphicButton *button=new GraphicButton(); button->init( keyButtonsXBase, keyButtonsYBase, keyButtonsWidth,keyButtonsHeight); button->setText(filenames[i]); @@ -237,7 +237,7 @@ void MenuStateLoadGame::mouseClick(int x, int y, MouseButton mouseButton){ previewTexture=NULL; infoTextLabel.setText(""); listFiles(); - slotsScrollBar.setElementCount(filenames.size()); + slotsScrollBar.setElementCount((int)filenames.size()); selectedButton = NULL; } diff --git a/source/glest_game/menu/menu_state_masterserver.cpp b/source/glest_game/menu/menu_state_masterserver.cpp index d3638789..a2d55c6f 100644 --- a/source/glest_game/menu/menu_state_masterserver.cpp +++ b/source/glest_game/menu/menu_state_masterserver.cpp @@ -861,7 +861,7 @@ void MenuStateMasterserver::update() { userButtons.push_back(button); } - userScrollBar.setElementCount(userButtons.size()); + userScrollBar.setElementCount((int)userButtons.size()); oldNickList = nickList; chatManager.setAutoCompleteTextList(oldNickList); } @@ -878,7 +878,7 @@ void MenuStateMasterserver::update() { serverInfoString="empty"; } - serverScrollBar.setElementCount(serverLines.size()); + serverScrollBar.setElementCount((int)serverLines.size()); if(serverScrollBar.getElementCount()!=0 ) { for(int i = serverScrollBar.getVisibleStart(); i <= serverScrollBar.getVisibleEnd(); ++i) { serverLines[i]->setY(serverLinesYBase-serverLinesLineHeight*(i-serverScrollBar.getVisibleStart())); @@ -1025,7 +1025,7 @@ void MenuStateMasterserver::simpleTask(BaseThread *callingThread) { } void MenuStateMasterserver::rebuildServerLines(const string &serverInfo) { - int numberOfOldServerLines=serverLines.size(); + int numberOfOldServerLines = (int)serverLines.size(); clearServerLines(); Lang &lang= Lang::getInstance(); try { diff --git a/source/glest_game/menu/menu_state_mods.cpp b/source/glest_game/menu/menu_state_mods.cpp index f13bd327..d674fd1d 100644 --- a/source/glest_game/menu/menu_state_mods.cpp +++ b/source/glest_game/menu/menu_state_mods.cpp @@ -630,7 +630,7 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) { button->setCustomTexture(CoreData::getInstance().getCustomTexture()); keyTechButtons.push_back(button); - int techFactionCount = factions.size(); + int techFactionCount = (int)factions.size(); GraphicLabel *label=new GraphicLabel(); label->init(techInfoXPos + keyButtonsWidth+10,keyButtonsYBase,labelWidth,20); label->setText(intToStr(techFactionCount)); @@ -785,25 +785,25 @@ void MenuStateMods::simpleTask(BaseThread *callingThread) { keyTilesetScrollBar.init(tilesetInfoXPos + keyButtonsWidth,scrollListsYPos-listBoxLength+keyButtonsLineHeight,false,200,20); keyTilesetScrollBar.setLength(listBoxLength); - keyTilesetScrollBar.setElementCount(keyTilesetButtons.size()); + keyTilesetScrollBar.setElementCount((int)keyTilesetButtons.size()); keyTilesetScrollBar.setVisibleSize(keyButtonsToRender); keyTilesetScrollBar.setVisibleStart(0); keyTechScrollBar.init(techInfoXPos + keyButtonsWidth + labelWidth + 20,scrollListsYPos-listBoxLength+keyButtonsLineHeight,false,200,20); keyTechScrollBar.setLength(listBoxLength); - keyTechScrollBar.setElementCount(keyTechButtons.size()); + keyTechScrollBar.setElementCount((int)keyTechButtons.size()); keyTechScrollBar.setVisibleSize(keyButtonsToRender); keyTechScrollBar.setVisibleStart(0); keyMapScrollBar.init(mapInfoXPos + keyButtonsWidth + labelWidth + 20,scrollListsYPos-listBoxLength+keyButtonsLineHeight,false,200,20); keyMapScrollBar.setLength(listBoxLength); - keyMapScrollBar.setElementCount(keyMapButtons.size()); + keyMapScrollBar.setElementCount((int)keyMapButtons.size()); keyMapScrollBar.setVisibleSize(keyButtonsToRender); keyMapScrollBar.setVisibleStart(0); keyScenarioScrollBar.init(scenarioInfoXPos + keyButtonsWidth,scrollListsYPos-listBoxLength+keyButtonsLineHeight,false,200,20); keyScenarioScrollBar.setLength(listBoxLength); - keyScenarioScrollBar.setElementCount(keyScenarioButtons.size()); + keyScenarioScrollBar.setElementCount((int)keyScenarioButtons.size()); keyScenarioScrollBar.setVisibleSize(keyButtonsToRender); keyScenarioScrollBar.setVisibleStart(0); @@ -1296,7 +1296,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) { delete button; keyMapButtons.erase(keyMapButtons.begin() + i); labelsMap.erase(labelsMap.begin() + i); - keyMapScrollBar.setElementCount(keyMapButtons.size()); + keyMapScrollBar.setElementCount((int)keyMapButtons.size()); break; } } @@ -1345,7 +1345,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) { if(button != NULL && button->getText() == selectedTilesetName) { delete button; keyTilesetButtons.erase(keyTilesetButtons.begin() + i); - keyTilesetScrollBar.setElementCount(keyTilesetButtons.size()); + keyTilesetScrollBar.setElementCount((int)keyTilesetButtons.size()); break; } } @@ -1403,7 +1403,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) { delete button; keyTechButtons.erase(keyTechButtons.begin() + i); labelsTech.erase(labelsTech.begin() + i); - keyTechScrollBar.setElementCount(keyTechButtons.size()); + keyTechScrollBar.setElementCount((int)keyTechButtons.size()); break; } } @@ -1462,7 +1462,7 @@ void MenuStateMods::mouseClick(int x, int y, MouseButton mouseButton) { if(button != NULL && button->getText() == selectedScenarioName) { delete button; keyScenarioButtons.erase(keyScenarioButtons.begin() + i); - keyScenarioScrollBar.setElementCount(keyScenarioButtons.size()); + keyScenarioScrollBar.setElementCount((int)keyScenarioButtons.size()); break; } } diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 2bbf7408..a745bd70 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -541,7 +541,7 @@ void ClientInterface::updateLobby() { serverFTPPort = networkMessageIntro.getFtpPort(); MutexSafeWrapper safeMutexFlags(flagAccessor,CODE_AT_LINE); - this->joinGameInProgress = networkMessageIntro.getGameInProgress(); + this->joinGameInProgress = (networkMessageIntro.getGameInProgress() != 0); this->joinGameInProgressLaunch = false; safeMutexFlags.ReleaseLock(); diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index 5f39dce3..62ae3bf4 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -126,7 +126,7 @@ void ConnectionSlotThread::setAllEventsCompleted() { void ConnectionSlotThread::purgeCompletedEvents() { MutexSafeWrapper safeMutex(triggerIdMutex,CODE_AT_LINE); //event->eventCompleted = true; - for(int i = eventList.size() - 1; i >= 0; i--) { + for(int i = (int)eventList.size() - 1; i >= 0; i--) { ConnectionSlotEvent &slotEvent = eventList[i]; if(slotEvent.eventCompleted == true) { eventList.erase(eventList.begin() + i); @@ -341,7 +341,7 @@ void ConnectionSlotThread::execute() { } MutexSafeWrapper safeMutex(triggerIdMutex,CODE_AT_LINE); - int eventCount = eventList.size(); + int eventCount = (int)eventList.size(); //printf("Slot thread slotIndex: %d eventCount: %d\n",slotIndex,eventCount); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] Slot thread slotIndex: %d eventCount: %d\n",__FILE__,__FUNCTION__,__LINE__,slotIndex,eventCount); @@ -1246,7 +1246,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { //for(int i = 0; i < vctFileList.size(); i++) //{ - NetworkMessageSynchNetworkGameDataFileCRCCheck networkMessageSynchNetworkGameDataFileCRCCheck(vctFileList.size(), 1, vctFileList[0].second, vctFileList[0].first); + NetworkMessageSynchNetworkGameDataFileCRCCheck networkMessageSynchNetworkGameDataFileCRCCheck((int)vctFileList.size(), 1, vctFileList[0].second, vctFileList[0].first); sendMessage(&networkMessageSynchNetworkGameDataFileCRCCheck); //} } @@ -1290,7 +1290,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { if(receiveMessage(&networkMessageSynchNetworkGameDataFileCRCCheck)) { int fileIndex = networkMessageSynchNetworkGameDataFileCRCCheck.getFileIndex(); - NetworkMessageSynchNetworkGameDataFileCRCCheck networkMessageSynchNetworkGameDataFileCRCCheck(vctFileList.size(), fileIndex, vctFileList[fileIndex-1].second, vctFileList[fileIndex-1].first); + NetworkMessageSynchNetworkGameDataFileCRCCheck networkMessageSynchNetworkGameDataFileCRCCheck((int)vctFileList.size(), fileIndex, vctFileList[fileIndex-1].second, vctFileList[fileIndex-1].first); sendMessage(&networkMessageSynchNetworkGameDataFileCRCCheck); } else { diff --git a/source/glest_game/network/network_interface.h b/source/glest_game/network/network_interface.h index 3a808c97..40e952c8 100644 --- a/source/glest_game/network/network_interface.h +++ b/source/glest_game/network/network_interface.h @@ -323,7 +323,7 @@ public: //access functions void requestCommand(const NetworkCommand *networkCommand, bool insertAtStart=false); - int getPendingCommandCount() const {return pendingCommands.size();} + int getPendingCommandCount() const {return (int)pendingCommands.size();} NetworkCommand* getPendingCommand(int i) {return &pendingCommands[i];} void clearPendingCommands() {pendingCommands.clear();} bool getQuit() const {return quit;} diff --git a/source/glest_game/network/network_message.cpp b/source/glest_game/network/network_message.cpp index 29f870bd..42039d03 100644 --- a/source/glest_game/network/network_message.cpp +++ b/source/glest_game/network/network_message.cpp @@ -609,7 +609,7 @@ void NetworkMessageLaunch::buildGameSettings(GameSettings *gameSettings) const { gameSettings->setGameUUID(data.gameUUID.getString()); - gameSettings->setNetworkAllowNativeLanguageTechtree(data.networkAllowNativeLanguageTechtree); + gameSettings->setNetworkAllowNativeLanguageTechtree((bool)data.networkAllowNativeLanguageTechtree); } vector > NetworkMessageLaunch::getFactionCRCList() const { diff --git a/source/glest_game/network/network_protocol.cpp b/source/glest_game/network/network_protocol.cpp index fbf0064b..edfe8261 100644 --- a/source/glest_game/network/network_protocol.cpp +++ b/source/glest_game/network/network_protocol.cpp @@ -368,7 +368,7 @@ unsigned int pack(unsigned char *buf, const char *format, ...) { case 's': // string s = va_arg(ap, char*); - len = strlen(s); + len = (uint16)strlen(s); if (maxstrlen > 0 && len < maxstrlen) len = maxstrlen - 1; diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 1f34389a..76b470ce 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -2581,7 +2581,7 @@ void ServerInterface::validateGameSettings(GameSettings *serverGameSettings) { { printf("mapFile-1; i--) { + for (int i= (int)mapFiles.size()-1 ;i>-1; i--) { string current=mapFiles[i]; if(currentsend(data.c_str(),data.length()); + cli->send(data.c_str(),(int)data.length()); cli->disconnectSocket(); } } diff --git a/source/glest_game/sound/sound_container.cpp b/source/glest_game/sound/sound_container.cpp index 9dad3b5c..2b1f2f40 100644 --- a/source/glest_game/sound/sound_container.cpp +++ b/source/glest_game/sound/sound_container.cpp @@ -33,7 +33,7 @@ StaticSound *SoundContainer::getRandSound() const{ case 1: return sounds[0]; default: - int soundIndex= random.randRange(0, sounds.size()-1); + int soundIndex= random.randRange(0, (int)sounds.size()-1); if(soundIndex==lastSound){ soundIndex= (lastSound+1) % sounds.size(); } diff --git a/source/glest_game/type_instances/faction.cpp b/source/glest_game/type_instances/faction.cpp index d5f8dcdf..866d95c9 100644 --- a/source/glest_game/type_instances/faction.cpp +++ b/source/glest_game/type_instances/faction.cpp @@ -172,7 +172,7 @@ void Faction::sortUnitsByCommandGroups() { //printf("====== Done sorting for faction # %d [%s] unitCount = %d\n",this->getIndex(),this->getType()->getName().c_str(),units.size()); - unsigned int originalUnitSize = units.size(); + unsigned int originalUnitSize = (unsigned int)units.size(); std::vector unitIds; for(unsigned int i = 0; i < units.size(); ++i) { @@ -559,7 +559,7 @@ void Faction::removeUnitFromMovingList(int unitId) { } int Faction::getUnitMovingListCount() { - return unitsMovingList.size(); + return (int)unitsMovingList.size(); } void Faction::addUnitToPathfindingList(int unitId) { @@ -573,7 +573,7 @@ void Faction::removeUnitFromPathfindingList(int unitId) { int Faction::getUnitPathfindingListCount() { //printf("GET Faction [%d - %s] threaded updates for [%d] units\n",this->getStartLocationIndex(),this->getType()->getName().c_str(),unitsPathfindingList.size()); - return unitsPathfindingList.size(); + return (int)unitsPathfindingList.size(); } void Faction::clearUnitsPathfinding() { @@ -2351,7 +2351,7 @@ std::pair Faction::getCRC_DetailsForWorldFrameIndex(int worldFrameIn if(iterMap == crcWorldFrameDetails.end()) { return make_pair(0,""); } - return make_pair(iterMap->first,iterMap->second); + return std::pair(iterMap->first,iterMap->second); } string Faction::getCRC_DetailsForWorldFrames() const { diff --git a/source/glest_game/type_instances/faction.h b/source/glest_game/type_instances/faction.h index 404b0809..ff6c7c8d 100644 --- a/source/glest_game/type_instances/faction.h +++ b/source/glest_game/type_instances/faction.h @@ -286,7 +286,7 @@ public: return result; } inline int getUnitCount() const { - int result = units.size(); + int result = (int)units.size(); return result; } inline Mutex * getUnitMutex() {return unitsMutex;} @@ -340,7 +340,7 @@ public: Vec2i getClosestResourceTypeTargetFromCache(Unit *unit, const ResourceType *type,int frameIndex); Vec2i getClosestResourceTypeTargetFromCache(const Vec2i &pos, const ResourceType *type); void cleanupResourceTypeTargetCache(std::vector *deleteListPtr,int frameIndex); - inline int getCacheResourceTargetListSize() const { return cacheResourceTargetList.size(); } + inline int getCacheResourceTargetListSize() const { return (int)cacheResourceTargetList.size(); } Unit * findClosestUnitWithSkillClass(const Vec2i &pos,const CommandClass &cmdClass, const std::vector &skillClassList, diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index 13ebc89c..fda59588 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -217,8 +217,8 @@ Checksum UnitPathBasic::getCRC() { Checksum crcForPath; crcForPath.addInt(blockCount); - crcForPath.addInt(pathQueue.size()); - crcForPath.addInt(lastPathCacheQueue.size()); + crcForPath.addInt((int)pathQueue.size()); + crcForPath.addInt((int)lastPathCacheQueue.size()); return crcForPath; } @@ -1579,7 +1579,7 @@ void Unit::replaceCurrCommand(Command *cmd) { //returns the size of the commands unsigned int Unit::getCommandSize() const { - return commands.size(); + return (unsigned int)commands.size(); } //return current command, assert that there is always one command @@ -2292,7 +2292,7 @@ void Unit::updateAttackBoostProgress(const Game* game) { // Now remove any units that were in the list of boosted units but // are no longer in range if(currentAttackBoostOriginatorEffect.currentAttackBoostUnits.empty() == false) { - for (int i = currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size() -1; i >= 0; --i) { + for (int i = (int)currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size() -1; i >= 0; --i) { int findUnitId = currentAttackBoostOriginatorEffect.currentAttackBoostUnits[i]; std::vector::iterator iterFound = std::find( @@ -2576,7 +2576,7 @@ void Unit::updateTimedParticles() { //!!! // Start new particle systems based on start time if(queuedUnitParticleSystemTypes.empty() == false) { - for(int i = queuedUnitParticleSystemTypes.size() - 1; i >= 0; i--) { + for(int i = (int)queuedUnitParticleSystemTypes.size() - 1; i >= 0; i--) { UnitParticleSystemType *pst = queuedUnitParticleSystemTypes[i]; if(pst != NULL) { if(truncateDecimal(pst->getStartTime(),6) <= truncateDecimal(getAnimProgressAsFloat(),6)) { @@ -2602,7 +2602,7 @@ void Unit::updateTimedParticles() { // End existing systems based on end time if(unitParticleSystems.empty() == false) { - for(int i = unitParticleSystems.size() - 1; i >= 0; i--) { + for(int i = (int)unitParticleSystems.size() - 1; i >= 0; i--) { UnitParticleSystem *ps = unitParticleSystems[i]; if(ps != NULL) { if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) { @@ -3314,7 +3314,7 @@ void Unit::checkUnitLevel() { void Unit::morphAttackBoosts(Unit *unit) { // Remove any units that were previously in range if(currentAttackBoostOriginatorEffect.currentAttackBoostUnits.empty() == false && currentAttackBoostOriginatorEffect.skillType != NULL) { - for(int i = currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size() - 1; i >= 0; --i) { + for(int i = (int)currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size() - 1; i >= 0; --i) { // Remove attack boost upgrades from unit int findUnitId = currentAttackBoostOriginatorEffect.currentAttackBoostUnits[i]; @@ -3361,7 +3361,7 @@ bool Unit::morph(const MorphCommandType *mct) { //printf("Now unapply attack-boost for unit [%d - %s]\n",this->getId(),this->getType()->getName().c_str()); // De apply attack boosts for morphed unit - for(int i = currentAttackBoostEffects.size() - 1; i >= 0; --i) { + for(int i = (int)currentAttackBoostEffects.size() - 1; i >= 0; --i) { UnitAttackBoostEffect *effect = currentAttackBoostEffects[i]; if(effect != NULL) { Unit *sourceUnit = game->getWorld()->findUnitById(effect->source->getId()); @@ -3719,7 +3719,7 @@ void Unit::stopDamageParticles(bool force) { if(smokeParticleSystems.empty() == false) { //printf("Checking to stop smokeparticles for unit [%s - %d] hp = %d\n",this->getType()->getName().c_str(),this->getId(),hp); - for(int i = smokeParticleSystems.size()-1; i >= 0; --i) { + for(int i = (int)smokeParticleSystems.size()-1; i >= 0; --i) { UnitParticleSystem *ps = smokeParticleSystems[i]; if(Renderer::getInstance().validateParticleSystemStillExists(ps,rsGame) == true) { ps->fade(); @@ -3731,7 +3731,7 @@ void Unit::stopDamageParticles(bool force) { if(damageParticleSystems.empty() == false) { //printf("Checking to stop damageparticles for unit [%s - %d] hp = %d\n",this->getType()->getName().c_str(),this->getId(),hp); - for(int i = damageParticleSystems.size()-1; i >= 0; --i) { + for(int i = (int)damageParticleSystems.size()-1; i >= 0; --i) { UnitParticleSystem *ps = damageParticleSystems[i]; UnitParticleSystemType *pst = NULL; int foundParticleIndexType = -2; @@ -3764,7 +3764,7 @@ void Unit::stopDamageParticles(bool force) { void Unit::checkCustomizedParticleTriggers(bool force) { // Now check if we have special hp triggered particles if(damageParticleSystems.empty() == false) { - for(int i = damageParticleSystems.size()-1; i >= 0; --i) { + for(int i = (int)damageParticleSystems.size()-1; i >= 0; --i) { UnitParticleSystem *ps = damageParticleSystems[i]; UnitParticleSystemType *pst = NULL; int foundParticleIndexType = -2; @@ -5255,7 +5255,7 @@ Checksum Unit::getCRC() { //vector queuedUnitParticleSystemTypes; //UnitParticleSystems damageParticleSystems; - crcForUnit.addInt(damageParticleSystems.size()); + crcForUnit.addInt((int)damageParticleSystems.size()); if(consoleDebug) printf("#12 Unit: %d CRC: %u\n",id,crcForUnit.getSum()); @@ -5283,7 +5283,7 @@ Checksum Unit::getCRC() { crcForUnit.addInt(inBailOutAttempt); - crcForUnit.addInt(badHarvestPosList.size()); + crcForUnit.addInt((int)badHarvestPosList.size()); //crcForUnit.addInt(lastHarvestResourceTarget.first()); if(consoleDebug) printf("#14 Unit: %d CRC: %u\n",id,crcForUnit.getSum()); @@ -5303,7 +5303,7 @@ Checksum Unit::getCRC() { //int maxQueuedCommandDisplayCount; //UnitAttackBoostEffectOriginator currentAttackBoostOriginatorEffect; - crcForUnit.addInt(currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size()); + crcForUnit.addInt((int)currentAttackBoostOriginatorEffect.currentAttackBoostUnits.size()); if(consoleDebug) printf("#15 Unit: %d CRC: %u\n",id,crcForUnit.getSum()); @@ -5341,7 +5341,7 @@ Checksum Unit::getCRC() { crcForUnit.addString(this->getParticleInfo()); } - crcForUnit.addInt(attackParticleSystems.size()); + crcForUnit.addInt((int)attackParticleSystems.size()); if(isNetworkCRCEnabled() == true) { for(unsigned int index = 0; index < attackParticleSystems.size(); ++index) { ParticleSystem *ps = attackParticleSystems[index]; diff --git a/source/glest_game/type_instances/unit.h b/source/glest_game/type_instances/unit.h index 1a3f3c6e..3cb192df 100644 --- a/source/glest_game/type_instances/unit.h +++ b/source/glest_game/type_instances/unit.h @@ -201,9 +201,9 @@ public: void addToLastPathCache(const Vec2i &path); Vec2i pop(bool removeFrontPos=true); virtual int getBlockCount() const { return blockCount; } - virtual int getQueueCount() const { return pathQueue.size(); } + virtual int getQueueCount() const { return (int)pathQueue.size(); } - int getLastPathCacheQueueCount() const { return lastPathCacheQueue.size(); } + int getLastPathCacheQueueCount() const { return (int)lastPathCacheQueue.size(); } vector getLastPathCacheQueue() const { return lastPathCacheQueue; } virtual vector getQueue() const { return pathQueue; } @@ -241,7 +241,7 @@ public: virtual bool isEmpty() const {return list::empty();} /**< is path empty */ virtual bool isStuck() const {return false; } - int size() const {return list::size();} /**< size of path */ + int size() const {return (int)list::size();} /**< size of path */ virtual void clear() {list::clear(); blockCount = 0;} /**< clear the path */ virtual void clearBlockCount() { blockCount = 0; } virtual void incBlockCount() {++blockCount;} /**< increment block counter */ diff --git a/source/glest_game/type_instances/upgrade.cpp b/source/glest_game/type_instances/upgrade.cpp index f5b4bc53..4e6d1e9d 100644 --- a/source/glest_game/type_instances/upgrade.cpp +++ b/source/glest_game/type_instances/upgrade.cpp @@ -108,7 +108,7 @@ UpgradeManager::~UpgradeManager() { void UpgradeManager::startUpgrade(const UpgradeType *upgradeType, int factionIndex) { Upgrade *upgrade = new Upgrade(upgradeType, factionIndex); upgrades.push_back(upgrade); - upgradesLookup[upgradeType] = upgrades.size()-1; + upgradesLookup[upgradeType] = (int)upgrades.size()-1; } void UpgradeManager::cancelUpgrade(const UpgradeType *upgradeType) { @@ -278,7 +278,7 @@ void UpgradeManager::loadGame(const XmlNode *rootNode,Faction *faction) { XmlNode *node = upgradeNodeList[i]; Upgrade *newUpgrade = Upgrade::loadGame(node,faction); upgrades.push_back(newUpgrade); - upgradesLookup[newUpgrade->getType()] = upgrades.size()-1; + upgradesLookup[newUpgrade->getType()] = (int)upgrades.size()-1; } } diff --git a/source/glest_game/type_instances/upgrade.h b/source/glest_game/type_instances/upgrade.h index 2fa7c075..71492b12 100644 --- a/source/glest_game/type_instances/upgrade.h +++ b/source/glest_game/type_instances/upgrade.h @@ -90,7 +90,7 @@ private: public: ~UpgradeManager(); - int getUpgradeCount() const {return upgrades.size();} + int getUpgradeCount() const {return (int)upgrades.size();} void startUpgrade(const UpgradeType *upgradeType, int factionIndex); void cancelUpgrade(const UpgradeType *upgradeType); diff --git a/source/glest_game/types/command_type.cpp b/source/glest_game/types/command_type.cpp index a30a78a0..20a68c92 100644 --- a/source/glest_game/types/command_type.cpp +++ b/source/glest_game/types/command_type.cpp @@ -434,7 +434,7 @@ void BuildCommandType::load(int id, const XmlNode *n, const string &dir, //start sound const XmlNode *startSoundNode= n->getChild("start-sound"); if(startSoundNode->getAttribute("enabled")->getBoolValue()){ - startSounds.resize(startSoundNode->getChildCount()); + startSounds.resize((int)startSoundNode->getChildCount()); for(int i=0; igetChildCount(); ++i){ const XmlNode *soundFileNode= startSoundNode->getChild("sound-file", i); string currentPath = dir; @@ -452,7 +452,7 @@ void BuildCommandType::load(int id, const XmlNode *n, const string &dir, //built sound const XmlNode *builtSoundNode= n->getChild("built-sound"); if(builtSoundNode->getAttribute("enabled")->getBoolValue()){ - builtSounds.resize(builtSoundNode->getChildCount()); + builtSounds.resize((int)builtSoundNode->getChildCount()); for(int i=0; igetChildCount(); ++i){ const XmlNode *soundFileNode= builtSoundNode->getChild("sound-file", i); string currentPath = dir; diff --git a/source/glest_game/types/command_type.h b/source/glest_game/types/command_type.h index 27c77c99..fc4bbae3 100644 --- a/source/glest_game/types/command_type.h +++ b/source/glest_game/types/command_type.h @@ -248,7 +248,7 @@ public: //get const MoveSkillType *getMoveSkillType() const {return moveSkillType;} const BuildSkillType *getBuildSkillType() const {return buildSkillType;} - int getBuildingCount() const {return buildings.size();} + int getBuildingCount() const {return (int)buildings.size();} const UnitType * getBuilding(int i) const {return buildings[i];} StaticSound *getStartSound() const {return startSounds.getRandSound();} StaticSound *getBuiltSound() const {return builtSounds.getRandSound();} @@ -288,7 +288,7 @@ public: const StopSkillType *getStopLoadedSkillType() const {return stopLoadedSkillType;} int getMaxLoad() const {return maxLoad;} int getHitsPerUnit() const {return hitsPerUnit;} - int getHarvestedResourceCount() const {return harvestedResources.size();} + int getHarvestedResourceCount() const {return (int)harvestedResources.size();} const ResourceType* getHarvestedResource(int i) const {return harvestedResources[i];} bool canHarvest(const ResourceType *resourceType) const; @@ -342,7 +342,7 @@ public: const RepairSkillType *getRepairSkillType() const {return repairSkillType;}; bool isRepairableUnitType(const UnitType *unitType) const; - int getRepairCount() const {return repairableUnits.size();} + int getRepairCount() const {return (int)repairableUnits.size();} const UnitType * getRepair(int i) const {return repairableUnits[i];} virtual bool usesPathfinder() const { return true; } diff --git a/source/glest_game/types/element_type.h b/source/glest_game/types/element_type.h index d22a402a..bc13bcfa 100644 --- a/source/glest_game/types/element_type.h +++ b/source/glest_game/types/element_type.h @@ -77,8 +77,8 @@ protected: public: //get - int getUpgradeReqCount() const {return upgradeReqs.size();} - int getUnitReqCount() const {return unitReqs.size();} + int getUpgradeReqCount() const {return (int)upgradeReqs.size();} + int getUnitReqCount() const {return (int)unitReqs.size();} const UpgradeType *getUpgradeReq(int i) const {return upgradeReqs[i];} const UnitType *getUnitReq(int i) const {return unitReqs[i];} @@ -109,7 +109,7 @@ public: virtual ~ProducibleType(); //get - int getCostCount() const {return costs.size();} + int getCostCount() const {return (int)costs.size();} const Resource *getCost(int i) const {return &costs[i];} const Resource *getCost(const ResourceType *rt) const; int getProductionTime() const {return productionTime;} diff --git a/source/glest_game/types/faction_type.h b/source/glest_game/types/faction_type.h index bba54c88..e111cb72 100644 --- a/source/glest_game/types/faction_type.h +++ b/source/glest_game/types/faction_type.h @@ -109,13 +109,13 @@ public: //get bool getIsLinked() const { return isLinked; } - int getUnitTypeCount() const {return unitTypes.size();} - int getUpgradeTypeCount() const {return upgradeTypes.size();} + int getUnitTypeCount() const {return (int)unitTypes.size();} + int getUpgradeTypeCount() const {return (int)upgradeTypes.size();} virtual string getName(bool translatedValue=false) const; const UnitType *getUnitType(int i) const {return &unitTypes[i];} const UpgradeType *getUpgradeType(int i) const {return &upgradeTypes[i];} StrSound *getMusic() const {return music;} - int getStartingUnitCount() const {return startingUnits.size();} + int getStartingUnitCount() const {return (int)startingUnits.size();} const UnitType *getStartingUnit(int i) const {return startingUnits[i].first;} int getStartingUnitAmount(int i) const {return startingUnits[i].second;} diff --git a/source/glest_game/types/object_type.h b/source/glest_game/types/object_type.h index 4f4f9828..355dffe9 100644 --- a/source/glest_game/types/object_type.h +++ b/source/glest_game/types/object_type.h @@ -67,7 +67,7 @@ public: string parentLoader=""); inline TilesetModelType *getTilesetModelType(int i) {return modeltypes[i];} - inline int getModelCount() const {return modeltypes.size();} + inline int getModelCount() const {return (int)modeltypes.size();} inline const Vec3f &getColor() const {return color;} inline int getClass() const {return objectClass;} inline bool getWalkable() const {return walkable;} diff --git a/source/glest_game/types/skill_type.cpp b/source/glest_game/types/skill_type.cpp index f42ea7a7..bb9f2276 100644 --- a/source/glest_game/types/skill_type.cpp +++ b/source/glest_game/types/skill_type.cpp @@ -478,7 +478,7 @@ void SkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, const XmlNode *soundNode= sn->getChild("sound"); if(soundNode->getAttribute("enabled")->getBoolValue()) { soundStartTime= soundNode->getAttribute("start-time")->getFloatValue(); - sounds.resize(soundNode->getChildCount()); + sounds.resize((int)soundNode->getChildCount()); for(int i = 0; i < soundNode->getChildCount(); ++i) { const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); @@ -823,7 +823,7 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode, const XmlNode *soundNode= projectileNode->getChild("sound"); if(soundNode->getAttribute("enabled")->getBoolValue()){ - projSounds.resize(soundNode->getChildCount()); + projSounds.resize((int)soundNode->getChildCount()); for(int i=0; igetChildCount(); ++i){ const XmlNode *soundFileNode= soundNode->getChild("sound-file", i); string path= soundFileNode->getAttribute("path")->getRestrictedValue(currentPath, true); diff --git a/source/glest_game/types/skill_type.h b/source/glest_game/types/skill_type.h index e9e71ea5..0bd9c56b 100644 --- a/source/glest_game/types/skill_type.h +++ b/source/glest_game/types/skill_type.h @@ -166,7 +166,7 @@ public: static void resetNextAttackBoostId() { nextAttackBoostId=0; } const AnimationAttributes getAnimationAttribute(int index) const; - int getAnimationCount() const { return animations.size(); } + int getAnimationCount() const { return (int)animations.size(); } //get const string &getName() const {return name;} diff --git a/source/glest_game/types/tech_tree.cpp b/source/glest_game/types/tech_tree.cpp index 40a61e2a..fbf71963 100644 --- a/source/glest_game/types/tech_tree.cpp +++ b/source/glest_game/types/tech_tree.cpp @@ -282,7 +282,7 @@ void TechTree::load(const string &dir, set &factions, Checksum* checksum } //damage multipliers - damageMultiplierTable.init(attackTypes.size(), armorTypes.size()); + damageMultiplierTable.init((int)attackTypes.size(), (int)armorTypes.size()); const XmlNode *damageMultipliersNode= techTreeNode->getChild("damage-multipliers"); for(int i = 0; i < damageMultipliersNode->getChildCount(); ++i) { const XmlNode *damageMultiplierNode= damageMultipliersNode->getChild("damage-multiplier", i); @@ -391,7 +391,7 @@ std::vector TechTree::validateResourceTypes() { // Check if the faction uses the resources in this techtree // Now lets find a matching faction resource type for the unit - for(int j = resourceTypesNotUsed.size() -1; j >= 0; --j) { + for(int j = (int)resourceTypesNotUsed.size() -1; j >= 0; --j) { const ResourceType &rt = resourceTypesNotUsed[j]; //printf("Validating [%d / %d] resourcetype [%s]\n",j,(int)resourceTypesNotUsed.size(),rt.getName().c_str()); diff --git a/source/glest_game/types/tech_tree.h b/source/glest_game/types/tech_tree.h index c2fa1b18..586e0e27 100644 --- a/source/glest_game/types/tech_tree.h +++ b/source/glest_game/types/tech_tree.h @@ -70,8 +70,8 @@ public: Checksum * getChecksumValue() { return &checksumValue; } //get - int getResourceTypeCount() const {return resourceTypes.size();} - int getTypeCount() const {return factionTypes.size();} + int getResourceTypeCount() const {return (int)resourceTypes.size();} + int getTypeCount() const {return (int)factionTypes.size();} const FactionType *getType(int i) const {return &factionTypes[i];} const ResourceType *getResourceType(int i) const {return &resourceTypes[i];} string getName(bool translatedValue=false); @@ -94,9 +94,9 @@ public: const ArmorType *getArmorType(const string &name) const; const AttackType *getAttackType(const string &name) const; - int getArmorTypeCount() const { return armorTypes.size(); } + int getArmorTypeCount() const { return (int)armorTypes.size(); } const ArmorType * getArmorTypeByIndex(int index) const { return &armorTypes[index]; } - int getAttackTypeCount() const { return attackTypes.size(); } + int getAttackTypeCount() const { return (int)attackTypes.size(); } const AttackType * getAttackTypeByIndex(int index) const { return &attackTypes[index]; } double getDamageMultiplier(const AttackType *att, const ArmorType *art) const; diff --git a/source/glest_game/types/unit_type.cpp b/source/glest_game/types/unit_type.cpp index ad538226..629656f4 100644 --- a/source/glest_game/types/unit_type.cpp +++ b/source/glest_game/types/unit_type.cpp @@ -578,7 +578,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, const //selection sounds const XmlNode *selectionSoundNode= parametersNode->getChild("selection-sounds"); if(selectionSoundNode->getAttribute("enabled")->getBoolValue()){ - selectionSounds.resize(selectionSoundNode->getChildCount()); + selectionSounds.resize((int)selectionSoundNode->getChildCount()); for(int i = 0; i < selectionSounds.getSounds().size(); ++i) { const XmlNode *soundNode= selectionSoundNode->getChild("sound", i); string path= soundNode->getAttribute("path")->getRestrictedValue(currentPath); @@ -592,7 +592,7 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree, const //command sounds const XmlNode *commandSoundNode= parametersNode->getChild("command-sounds"); if(commandSoundNode->getAttribute("enabled")->getBoolValue()) { - commandSounds.resize(commandSoundNode->getChildCount()); + commandSounds.resize((int)commandSoundNode->getChildCount()); for(int i = 0; i < commandSoundNode->getChildCount(); ++i) { const XmlNode *soundNode= commandSoundNode->getChild("sound", i); string path= soundNode->getAttribute("path")->getRestrictedValue(currentPath); diff --git a/source/glest_game/types/unit_type.h b/source/glest_game/types/unit_type.h index cabc5f7c..93b2d802 100644 --- a/source/glest_game/types/unit_type.h +++ b/source/glest_game/types/unit_type.h @@ -186,9 +186,9 @@ public: const CommandType *getCommandType(int i) const; inline const Level *getLevel(int i) const {return &levels[i];} const Level *getLevel(string name) const; - inline int getSkillTypeCount() const {return skillTypes.size();} - inline int getCommandTypeCount() const {return commandTypes.size();} - inline int getLevelCount() const {return levels.size();} + inline int getSkillTypeCount() const {return (int)skillTypes.size();} + inline int getCommandTypeCount() const {return (int)commandTypes.size();} + inline int getLevelCount() const {return (int)levels.size();} inline bool getLight() const {return light;} inline bool getRotationAllowed() const {return rotationAllowed;} inline Vec3f getLightColor() const {return lightColor;} @@ -196,7 +196,7 @@ public: inline int getSight() const {return sight;} inline int getSize() const {return size;} int getHeight() const {return height;} - int getStoredResourceCount() const {return storedResources.size();} + int getStoredResourceCount() const {return (int)storedResources.size();} inline const Resource *getStoredResource(int i) const {return &storedResources[i];} bool getCellMapCell(int x, int y, CardinalDir facing) const; inline bool getMeetingPoint() const {return meetingPoint;} diff --git a/source/glest_game/types/upgrade_type.h b/source/glest_game/types/upgrade_type.h index 10475f5e..f75f304f 100644 --- a/source/glest_game/types/upgrade_type.h +++ b/source/glest_game/types/upgrade_type.h @@ -209,7 +209,7 @@ public: virtual string getName(bool translatedValue=false) const; //get all - int getEffectCount() const {return effects.size();} + int getEffectCount() const {return (int)effects.size();} const UnitType * getEffect(int i) const {return effects[i];} bool isAffected(const UnitType *unitType) const; diff --git a/source/glest_game/world/map.cpp b/source/glest_game/world/map.cpp index 1baa5339..7a285fb3 100644 --- a/source/glest_game/world/map.cpp +++ b/source/glest_game/world/map.cpp @@ -101,7 +101,7 @@ void Cell::loadGame(const XmlNode *rootNode, int index, World *world) { if(rootNode->hasChild("Cell" + intToStr(index)) == true) { const XmlNode *cellNode = rootNode->getChild("Cell" + intToStr(index)); - int unitCount = cellNode->getChildCount(); + int unitCount = (int)cellNode->getChildCount(); for(unsigned int i = 0; i < unitCount; ++i) { if(cellNode->hasChildAtIndex("units",i) == true) { const XmlNode *unitsNode = cellNode->getChild("units",i); diff --git a/source/glest_game/world/scenario.h b/source/glest_game/world/scenario.h index 5711998d..58cc564b 100644 --- a/source/glest_game/world/scenario.h +++ b/source/glest_game/world/scenario.h @@ -130,7 +130,7 @@ public: Checksum load(const string &path); Checksum * getChecksumValue() { return &checksumValue; } - int getScriptCount() const {return scripts.size();} + int getScriptCount() const {return (int)scripts.size();} const Script* getScript(int i) const {return &scripts[i];} ScenarioInfo getInfo() const { return info; } diff --git a/source/glest_game/world/tileset.cpp b/source/glest_game/world/tileset.cpp index 7ad70bff..cd14aa70 100644 --- a/source/glest_game/world/tileset.cpp +++ b/source/glest_game/world/tileset.cpp @@ -205,7 +205,7 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck } if(partsize==0){ - int childCount= surfaceNode->getChildCount(); + int childCount= (int)surfaceNode->getChildCount(); surfPixmaps[i].resize(childCount); surfProbs[i].resize(childCount); @@ -298,7 +298,7 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck const XmlNode *objectsNode= tilesetNode->getChild("objects"); for(int i=0; igetChild("object", i); - int childCount= objectNode->getChildCount(); + int childCount= (int)objectNode->getChildCount(); int objectHeight = 0; bool walkable = objectNode->getAttribute("walkable")->getBoolValue(); @@ -391,7 +391,7 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); - int waterFrameCount= waterNode->getChildCount(); + int waterFrameCount= (int)waterNode->getChildCount(); if(waterTex) { waterTex->getPixmap()->init(waterFrameCount, 4); } @@ -504,7 +504,7 @@ Tileset::~Tileset() { } const Pixmap2D *Tileset::getSurfPixmap(int type, int var) const{ - int vars= surfPixmaps[type].size(); + int vars= (int)surfPixmaps[type].size(); return surfPixmaps[type][var % vars]; } diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 5a621aa1..63c7efa1 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2631,7 +2631,7 @@ bool UnitUpdater::unitOnRange(Unit *unit, int range, Unit **rangedPtr, float nearestDistance = 0.f; MutexSafeWrapper safeMutex(&mutexAttackWarnings,string(__FILE__) + "_" + intToStr(__LINE__)); - for(int i = attackWarnings.size() - 1; i >= 0; --i) { + for(int i = (int)attackWarnings.size() - 1; i >= 0; --i) { if(world->getFrameCount() - attackWarnings[i]->lastFrameCount > 200) { //after 200 frames attack break we warn again AttackWarningData *toDelete =attackWarnings[i]; attackWarnings.erase(attackWarnings.begin()+i); @@ -2816,7 +2816,7 @@ string UnitUpdater::getUnitRangeCellsLookupItemCacheStats() { iterMap3 != iterMap2->second.end(); ++iterMap3) { rangeCount++; - rangeCountCellCount += iterMap3->second.rangeCellList.size(); + rangeCountCellCount += (int)iterMap3->second.rangeCellList.size(); } } } diff --git a/source/glest_game/world/unit_updater.h b/source/glest_game/world/unit_updater.h index 784d2ce7..6182d77d 100644 --- a/source/glest_game/world/unit_updater.h +++ b/source/glest_game/world/unit_updater.h @@ -122,7 +122,7 @@ public: void clearUnitPrecache(Unit *unit); void removeUnitPrecache(Unit *unit); - inline unsigned int getAttackWarningCount() const { return attackWarnings.size(); } + inline unsigned int getAttackWarningCount() const { return (unsigned int)attackWarnings.size(); } std::pair unitBeingAttacked(const Unit *unit); void unitBeingAttacked(std::pair &result, const Unit *unit, const AttackSkillType *ast,float *currentDistToUnit=NULL); vector enemyUnitsOnRange(const Unit *unit,const AttackSkillType *ast); diff --git a/source/glest_game/world/water_effects.h b/source/glest_game/world/water_effects.h index 6cd85030..70c703a0 100644 --- a/source/glest_game/world/water_effects.h +++ b/source/glest_game/world/water_effects.h @@ -73,7 +73,7 @@ public: float getAmin() const {return anim;} void addWaterSplash(const Vec2f &pos, int size); - int getWaterSplashCount() const {return waterSplashes.size();} + int getWaterSplashCount() const {return (int)waterSplashes.size();} const WaterSplash *getWaterSplash(int i) const {return &waterSplashes[i];} }; diff --git a/source/glest_game/world/world.cpp b/source/glest_game/world/world.cpp index bf330e7e..e29bfac2 100644 --- a/source/glest_game/world/world.cpp +++ b/source/glest_game/world/world.cpp @@ -2695,8 +2695,8 @@ string World::getExploredCellsLookupItemCacheStats() { iterMap2 != iterMap1->second.end(); ++iterMap2) { sightCount++; - exploredCellCount += iterMap2->second.exploredCellList.size(); - visibleCellCount += iterMap2->second.visibleCellList.size(); + exploredCellCount += (int)iterMap2->second.exploredCellList.size(); + visibleCellCount += (int)iterMap2->second.visibleCellList.size(); } } @@ -2724,8 +2724,8 @@ string World::getFowAlphaCellsLookupItemCacheStats() { const Unit *unit= faction->getUnit(j); const FowAlphaCellsLookupItem &cache = unit->getCachedFow(); - surfPosCount += cache.surfPosList.size(); - alphaListCount += cache.alphaList.size(); + surfPosCount += (int)cache.surfPosList.size(); + alphaListCount += (int)cache.alphaList.size(); } } } diff --git a/source/glest_game/world/world.h b/source/glest_game/world/world.h index d87d5a51..4771ec6f 100644 --- a/source/glest_game/world/world.h +++ b/source/glest_game/world/world.h @@ -173,7 +173,7 @@ public: inline const Faction *getThisFaction() const {return factions[thisFactionIndex];} inline Faction *getThisFactionPtr() {return factions[thisFactionIndex];} - inline int getFactionCount() const {return factions.size();} + inline int getFactionCount() const {return (int)factions.size();} inline const Map *getMap() const {return ↦} inline Map *getMapPtr() {return ↦} diff --git a/source/shared_lib/include/platform/common/math_wrapper.h b/source/shared_lib/include/platform/common/math_wrapper.h index e90550b8..117350e5 100644 --- a/source/shared_lib/include/platform/common/math_wrapper.h +++ b/source/shared_lib/include/platform/common/math_wrapper.h @@ -15,7 +15,7 @@ #ifdef USE_STREFLOP #include -#include +//#include #else diff --git a/source/shared_lib/include/platform/sdl/factory_repository.h b/source/shared_lib/include/platform/sdl/factory_repository.h index 6e57596d..a4382b5c 100644 --- a/source/shared_lib/include/platform/sdl/factory_repository.h +++ b/source/shared_lib/include/platform/sdl/factory_repository.h @@ -22,7 +22,7 @@ #ifdef WIN32 #include "graphics_factory_gl2.h" -#include "sound_factory_ds8.h" +//#include "sound_factory_ds8.h" #endif @@ -39,7 +39,7 @@ using Shared::Graphics::Gl::GraphicsFactoryGl; #ifdef WIN32 using Shared::Graphics::Gl::GraphicsFactoryGl2; -using Shared::Sound::Ds8::SoundFactoryDs8; +//using Shared::Sound::Ds8::SoundFactoryDs8; #endif @@ -64,7 +64,7 @@ private: #ifdef WIN32 GraphicsFactoryGl2 graphicsFactoryGl2; - SoundFactoryDs8 soundFactoryDs8; + //SoundFactoryDs8 soundFactoryDs8; #endif diff --git a/source/shared_lib/sources/platform/win32/platform_util.cpp b/source/shared_lib/sources/platform/win32/platform_util.cpp index 337f899d..54fe5ca4 100644 --- a/source/shared_lib/sources/platform/win32/platform_util.cpp +++ b/source/shared_lib/sources/platform/win32/platform_util.cpp @@ -199,9 +199,13 @@ string PlatformExceptionHandler::getStackTrace() { HANDLE hThread = GetCurrentThread(); if (GetThreadContext(hThread, &context)) { STACKFRAME stackframe = { 0 }; +#if !defined(_WIN64) stackframe.AddrPC.Offset = context.Eip; +#endif stackframe.AddrPC.Mode = AddrModeFlat; +#if !defined(_WIN64) stackframe.AddrFrame.Offset = context.Ebp; +#endif stackframe.AddrFrame.Mode = AddrModeFlat; SymInitialize(hProcess, NULL, TRUE); @@ -218,10 +222,14 @@ string PlatformExceptionHandler::getStackTrace() { NULL, NULL, NULL); - +#if !defined(_WIN64) DWORD dwDisplacement = 0; +#else + DWORD64 dwDisplacement = 0; +#endif + DWORD dwDisplacement2 = 0; SymGetSymFromAddr(hProcess, stackframe.AddrPC.Offset, &dwDisplacement, pSym); - SymGetLineFromAddr(hProcess, stackframe.AddrPC.Offset, &dwDisplacement, &line); + SymGetLineFromAddr(hProcess, stackframe.AddrPC.Offset, &dwDisplacement2, &line); SymGetModuleInfo(hProcess, stackframe.AddrPC.Offset, &module); // RetAddr Arg1 Arg2 Arg3 module!funtion FileName(line)+offset @@ -385,7 +393,9 @@ void init_win32() { #ifndef __MINGW32__ LONG iconPtr = (LONG)icon; +#if !defined(_WIN64) ::SetClassLong(hwnd, GCL_HICON, iconPtr); +#endif #endif ontop_win32(0, 0);