From 2bf1f21c4d27a14f31c9dbb80331bbe1b56b4a7a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 19 Aug 2015 14:00:46 -0400 Subject: [PATCH] Squelch some MSVC warnings --- src/boe.dlgutil.cpp | 7 +++++++ src/boe.party.cpp | 14 +++++++------- src/classes/party.cpp | 3 ++- src/tools/winutil.win.cpp | 3 ++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/boe.dlgutil.cpp b/src/boe.dlgutil.cpp index 5c374546..c8529fc9 100644 --- a/src/boe.dlgutil.cpp +++ b/src/boe.dlgutil.cpp @@ -473,6 +473,10 @@ void handle_info_request(cShopItem item) { } void set_up_shop_array() { + #ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable:4258) + #endif int i = 0; for(int j = 0; i < 30 && j < 30; j++) { cShopItem entry = active_shop.getItem(j); @@ -548,6 +552,9 @@ void set_up_shop_array() { break; } } + #ifdef _MSC_VER + #pragma warning(pop) + #endif shop_sbar->setMaximum(i - 8); std::fill(shop_array + i, shop_array + 30, -1); } diff --git a/src/boe.party.cpp b/src/boe.party.cpp index 28c16c27..136ba3d0 100644 --- a/src/boe.party.cpp +++ b/src/boe.party.cpp @@ -898,7 +898,7 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) { } void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { - short r1,r2, target, i,item,store,adj,x,y; + short r1,r2, target,item,store,adj,x,y; location loc; location where; @@ -972,7 +972,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { if(!freebie) univ.party[pc_num].cur_sp -= (*spell_num).cost; r1 = level / 6 + adj / 3 + get_ran(1,0,1); - for(i = 0; i < r1; i++) { + for(int i = 0; i < r1; i++) { r2 = get_ran(1,0,7); store = get_ran(2,1,5) + adj; if(!summon_monster((r2 == 1) ? 100 : 99,where,store,eAttitude::FRIENDLY,true)) @@ -985,7 +985,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { store = get_ran(2,1,4) + adj; if(!summon_monster(126,where,store,eAttitude::FRIENDLY,true)) add_string_to_buf(" Summon failed."); - for(i = 0; i < 4; i++) { + for(int i = 0; i < 4; i++) { store = get_ran(2,1,4) + adj; if(!summon_monster(125,where,store,eAttitude::FRIENDLY,true)) add_string_to_buf(" Summon failed."); @@ -1188,7 +1188,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { } else sout << " wasn't stoned."; } else if(spell_num == eSpell::CURSE_REMOVE) { - for(i = 0; i < 24; i++) + for(int i = 0; i < 24; i++) if(univ.party[target].items[i].cursed){ r1 = get_ran(1,0,200) - 10 * adj; if(r1 < 60) { @@ -1215,7 +1215,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { } else { univ.party[target].main_status = eMainStatus::ALIVE; - for(i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) if(get_ran(1,0,2) < 2) { eSkill skill = eSkill(i); univ.party[target].skills[skill] -= (univ.party[target].skills[skill] > 1) ? 1 : 0; @@ -1230,7 +1230,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { } else if(spell_num == eSpell::RESURRECT) { if(univ.party[target].main_status != eMainStatus::ALIVE) { univ.party[target].main_status = eMainStatus::ALIVE; - for(i = 0; i < 3; i++) + for(int i = 0; i < 3; i++) if(get_ran(1,0,2) < 1) { eSkill skill = eSkill(i); univ.party[target].skills[skill] -= (univ.party[target].skills[skill] > 1) ? 1 : 0; @@ -1285,7 +1285,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { break; } - for(i = 0; i < 6; i++) + for(int i = 0; i < 6; i++) if(univ.party[i].main_status == eMainStatus::ALIVE) { if(spell_num == eSpell::SANCTUARY_MASS) { store = get_ran(0,1,3) + level / 6 + adj; diff --git a/src/classes/party.cpp b/src/classes/party.cpp index 191562c0..64632086 100644 --- a/src/classes/party.cpp +++ b/src/classes/party.cpp @@ -821,7 +821,8 @@ void cParty::readFrom(std::istream& file){ } else if(cur == "TOWNSAVE") { int i; std::string str; - bin >> i >> creature_save[i].which_town >> str; + bin >> i; + bin >> creature_save[i].which_town >> str; creature_save[i].hostile = str == "HOSTILE"; } else if(cur == "TOWNVISIBLE") { int i; diff --git a/src/tools/winutil.win.cpp b/src/tools/winutil.win.cpp index 5eca545d..6c434ff1 100644 --- a/src/tools/winutil.win.cpp +++ b/src/tools/winutil.win.cpp @@ -352,7 +352,8 @@ void set_clipboard_img(sf::Image& img) { } info->bV5Size = sizeof(BITMAPV5HEADER); info->bV5Width = img.getSize().x; - info->bV5Height = -img.getSize().y; + info->bV5Height = img.getSize().y; + info->bV5Height *= -1; info->bV5Planes = 1; info->bV5BitCount = 32; info->bV5Compression = BI_BITFIELDS;