From 0714004f1c0b3c1abfe072372a8bb9d14cd5a1db Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Fri, 6 Jan 2023 22:02:05 -0500 Subject: [PATCH] Fix a few compiler warnings --- src/dialogxml/widgets/control.cpp | 2 +- src/scenedit/scen.core.cpp | 4 +++- src/scenedit/scen.keydlgs.cpp | 2 +- src/scenedit/scen.townout.cpp | 10 +++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/dialogxml/widgets/control.cpp b/src/dialogxml/widgets/control.cpp index 090b1c65..a0ebf551 100644 --- a/src/dialogxml/widgets/control.cpp +++ b/src/dialogxml/widgets/control.cpp @@ -73,7 +73,7 @@ xHandlerNotSupported::xHandlerNotSupported(eDlogEvt t){ this->evt = t; } const char* xHandlerNotSupported::what() const throw() { - assert("A handler not supported message is missing!" && evt < 4); + assert("A handler not supported message is missing!" && int(evt) < 4); return msg[evt]; } diff --git a/src/scenedit/scen.core.cpp b/src/scenedit/scen.core.cpp index ea04eb75..796e1840 100644 --- a/src/scenedit/scen.core.cpp +++ b/src/scenedit/scen.core.cpp @@ -1257,7 +1257,7 @@ static bool edit_monst_abil_detail(cDialog& me, std::string hit, cMonster& monst }); if(cat == eMonstAbilCat::MISSILE || cat == eMonstAbilCat::GENERAL || cat == eMonstAbilCat::SUMMON) { - int first, last; + int first = 0, last = 0; if(cat == eMonstAbilCat::MISSILE) first = 110, last = 119; else if(cat == eMonstAbilCat::GENERAL) first = 120, last = 124; else if(cat == eMonstAbilCat::SUMMON) first = 150, last = 152; @@ -2454,6 +2454,8 @@ static bool add_shop_entry(cDialog& me, std::string type, cShop& shop, size_t wh } else if(type == "heal") { list = STRT_HEALING; prompt = "What kind of healing?"; + } else { + return false; } int i = choose_text(list, -1, &me, prompt); if(i == -1) return true; diff --git a/src/scenedit/scen.keydlgs.cpp b/src/scenedit/scen.keydlgs.cpp index d7ffb34f..01fcbbb1 100644 --- a/src/scenedit/scen.keydlgs.cpp +++ b/src/scenedit/scen.keydlgs.cpp @@ -808,7 +808,7 @@ static bool edit_spec_enc_value(cDialog& me, std::string item_hit, node_stack_t& PIC_FULL }; std::string field = item_hit.substr(0, item_hit.find_first_of('-')); - char btn; + char btn = '\0'; eSpecType type = edit_stack.top().node.type; if(field == "sdf1") btn = (*type).sd1_btn; else if(field == "sdf2") btn = (*type).sd2_btn; diff --git a/src/scenedit/scen.townout.cpp b/src/scenedit/scen.townout.cpp index a7171810..cf5ec747 100644 --- a/src/scenedit/scen.townout.cpp +++ b/src/scenedit/scen.townout.cpp @@ -587,7 +587,7 @@ static bool edit_out_wand_monst(cDialog& me, std::string hit, short which, cOutd me.untoast(); save_out_wand(me, which, wand, 100); std::string fld = hit.substr(7); - short i; + short i = 0; if(fld[0] == 'f') { i = choose_text(STRT_MONST,wand.monst[fld[3] - '1']-1,&me,"Choose Which Monster:") + 1; if(i >= 0) wand.monst[fld[3] - '1'] = i; @@ -1483,22 +1483,22 @@ bool resize_outdoors() { if(mod.top > 0) { int y = new_h - mod.top; while(y--) { - scenario.outdoors.row(y + mod.top) = std::move(scenario.outdoors.row(y)); + scenario.outdoors.row(y + mod.top) = scenario.outdoors.row(y); } } else if(mod.top < 0) { for(int y = -mod.top; y < old_h; y++) { - scenario.outdoors.row(y + mod.top) = std::move(scenario.outdoors.row(y)); + scenario.outdoors.row(y + mod.top) = scenario.outdoors.row(y); } } if(mod.left > 0) { int x = new_w - mod.left; while(x--) { - scenario.outdoors.col(x + mod.left) = std::move(scenario.outdoors.col(x)); + scenario.outdoors.col(x + mod.left) = scenario.outdoors.col(x); } } else if(mod.left < 0) { for(int x = -mod.left; x < old_w; x++) { - scenario.outdoors.col(x + mod.left) = std::move(scenario.outdoors.col(x)); + scenario.outdoors.col(x + mod.left) = scenario.outdoors.col(x); } }