- cleaned up more compiler warnings in VC++

This commit is contained in:
Mark Vejvoda
2011-01-29 17:42:34 +00:00
parent 1a3545f8ab
commit 041289770e
3 changed files with 8 additions and 8 deletions

View File

@@ -273,7 +273,7 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
menuMode->Check(miModeGrid, true); menuMode->Check(miModeGrid, true);
menuCustomColor->Check(miColorRed, true); menuCustomColor->Check(miColorRed, true);
for(int i = 0; i < autoScreenShotParams.size(); ++i) { for(unsigned int i = 0; i < autoScreenShotParams.size(); ++i) {
if(autoScreenShotParams[i] == "transparent") { if(autoScreenShotParams[i] == "transparent") {
printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str()); printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str());
menuFile->Check(miFileToggleScreenshotTransparent,true); menuFile->Check(miFileToggleScreenshotTransparent,true);
@@ -692,7 +692,7 @@ void MainWindow::onMenumFileToggleScreenshotTransparent(wxCommandEvent &event) {
void MainWindow::saveScreenshot() { void MainWindow::saveScreenshot() {
try { try {
int autoSaveScreenshotIndex = -1; int autoSaveScreenshotIndex = -1;
for(int i = 0; i < autoScreenShotParams.size(); ++i) { for(unsigned int i = 0; i < autoScreenShotParams.size(); ++i) {
if(_strnicmp(autoScreenShotParams[i].c_str(),"saveas-",7) == 0) { if(_strnicmp(autoScreenShotParams[i].c_str(),"saveas-",7) == 0) {
printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str()); printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str());
autoSaveScreenshotIndex = i; autoSaveScreenshotIndex = i;
@@ -826,11 +826,11 @@ void MainWindow::loadUnit(string path, string skillName) {
const XmlNode *unitNode= xmlTree.getRootNode(); const XmlNode *unitNode= xmlTree.getRootNode();
bool foundSkillName = false; bool foundSkillName = false;
for(int skillIdx = 0; foundSkillName == false && skillIdx < this->unitPath.second.size(); ++skillIdx) { for(unsigned int skillIdx = 0; foundSkillName == false && skillIdx < this->unitPath.second.size(); ++skillIdx) {
string lookipForSkillName = this->unitPath.second[skillIdx]; string lookipForSkillName = this->unitPath.second[skillIdx];
const XmlNode *skillsNode= unitNode->getChild("skills"); const XmlNode *skillsNode= unitNode->getChild("skills");
for(int i = 0; foundSkillName == false && i < skillsNode->getChildCount(); ++i) { for(unsigned int i = 0; foundSkillName == false && i < skillsNode->getChildCount(); ++i) {
const XmlNode *sn= skillsNode->getChild("skill", i); const XmlNode *sn= skillsNode->getChild("skill", i);
const XmlNode *typeNode= sn->getChild("type"); const XmlNode *typeNode= sn->getChild("type");
const XmlNode *nameNode= sn->getChild("name"); const XmlNode *nameNode= sn->getChild("name");
@@ -1735,7 +1735,7 @@ bool App::OnInit(){
if(delimitedList.size() >= 2) { if(delimitedList.size() >= 2) {
unitToLoad.first = delimitedList[0]; unitToLoad.first = delimitedList[0];
for(int i = 1; i < delimitedList.size(); ++i) { for(unsigned int i = 1; i < delimitedList.size(); ++i) {
unitToLoad.second.push_back(delimitedList[i]); unitToLoad.second.push_back(delimitedList[i]);
} }
} }

View File

@@ -251,7 +251,7 @@ class TransitionHeuristic {
public: public:
TransitionHeuristic(const Vec2i &target) : dd(target) {} TransitionHeuristic(const Vec2i &target) : dd(target) {}
bool operator()(const Transition *t) const { bool operator()(const Transition *t) const {
return dd(t->nwPos); return (dd(t->nwPos) != 0);
} }
}; };

View File

@@ -458,7 +458,7 @@ void ScriptManager::stopAllSound() {
void ScriptManager::morphToUnit(int unitId,const string &morphName, int ignoreRequirements) { void ScriptManager::morphToUnit(int unitId,const string &morphName, int ignoreRequirements) {
SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%d] morphName [%s] forceUpgradesIfRequired = %d\n",__FILE__,__FUNCTION__,__LINE__,unitId,morphName.c_str(),ignoreRequirements); SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%d] morphName [%s] forceUpgradesIfRequired = %d\n",__FILE__,__FUNCTION__,__LINE__,unitId,morphName.c_str(),ignoreRequirements);
ScriptManager_STREFLOP_Wrapper streflopWrapper; ScriptManager_STREFLOP_Wrapper streflopWrapper;
world->morphToUnit(unitId,morphName,ignoreRequirements); world->morphToUnit(unitId,morphName,(ignoreRequirements == 1));
} }
void ScriptManager::giveResource(const string &resourceName, int factionIndex, int amount){ void ScriptManager::giveResource(const string &resourceName, int factionIndex, int amount){
@@ -494,7 +494,7 @@ void ScriptManager::giveUpgradeCommand(int unitId, const string &producedName){
void ScriptManager::giveAttackStoppedCommand(int unitId, const string &itemName,int ignoreRequirements) { void ScriptManager::giveAttackStoppedCommand(int unitId, const string &itemName,int ignoreRequirements) {
SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
ScriptManager_STREFLOP_Wrapper streflopWrapper; ScriptManager_STREFLOP_Wrapper streflopWrapper;
world->giveAttackStoppedCommand(unitId, itemName, ignoreRequirements); world->giveAttackStoppedCommand(unitId, itemName, (ignoreRequirements == 1));
} }
void ScriptManager::disableAi(int factionIndex){ void ScriptManager::disableAi(int factionIndex){