diff --git a/osx/BoE.xcodeproj/project.pbxproj b/osx/BoE.xcodeproj/project.pbxproj index 7ae5689d..f187a66a 100644 --- a/osx/BoE.xcodeproj/project.pbxproj +++ b/osx/BoE.xcodeproj/project.pbxproj @@ -2758,6 +2758,7 @@ "-ferror-limit=0", "-Werror=format", "-ftemplate-backtrace-limit=0", + "-Werror=return-type", ); OTHER_LDFLAGS = ( "-lboost_filesystem", @@ -2810,6 +2811,7 @@ "-ferror-limit=0", "-Werror=format", "-ftemplate-backtrace-limit=0", + "-Werror=return-type", ); OTHER_LDFLAGS = ( "-lboost_filesystem", diff --git a/osx/boe.dlgutil.cpp b/osx/boe.dlgutil.cpp index 217d3189..8b799a83 100644 --- a/osx/boe.dlgutil.cpp +++ b/osx/boe.dlgutil.cpp @@ -1183,6 +1183,7 @@ bool prefs_event_filter (cDialog& me, std::string id, eKeyMod mods) give_delays = PSD[SDF_NO_FRILLS]; save_prefs(reset_help); } + return true; } void pick_preferences() diff --git a/osx/boe.infodlg.cpp b/osx/boe.infodlg.cpp index a5429a25..32513951 100644 --- a/osx/boe.infodlg.cpp +++ b/osx/boe.infodlg.cpp @@ -121,6 +121,7 @@ bool display_spells_event_filter(cDialog& me, std::string item_hit, eKeyMod mods else priest_spell_pos = store; put_spell_info(me, display_mode); } + return true; } void display_spells(short mode,short force_spell,cDialog* parent) //short mode; // 0 - mage 1 - priest @@ -180,6 +181,7 @@ bool display_skills_event_filter(cDialog& me, std::string item_hit, eKeyMod mods } put_skill_info(me); } + return true; } void display_skills(short force_skill,cDialog* parent) @@ -235,6 +237,7 @@ bool display_pc_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) which_pc_displayed = pc_num; put_pc_spells(me); } + return true; } void display_pc(short pc_num,short mode,cDialog* parent) @@ -413,6 +416,7 @@ bool display_pc_item_event_filter(cDialog& me, std::string item_hit, eKeyMod mod store_i = univ.party[pc_num].items[item]; put_item_info(me,pc_num,item); } + return true; } void display_pc_item(short pc_num,short item,cItemRec si,short parent) @@ -555,6 +559,7 @@ bool display_monst_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) // TODO: It may not be redudndant, but it looks pretty stupid; change it put_monst_info(me); } + return true; } void display_monst(short array_pos,cCreature *which_m,short mode) @@ -632,6 +637,7 @@ bool display_alchemy_event_filter(cDialog& me, std::string item_hit, eKeyMod mod } get_text = get_str("alchemy", cur_entry); me["str"].setText(get_text); + return true; } void display_alchemy(cDialog* parent) @@ -875,6 +881,7 @@ bool give_pc_info_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) while (univ.party[store_pc_num].main_status != 1); display_pc_info(me); } + return true; } bool give_pc_extra_info(cDialog& me, std::string item_hit, eKeyMod mods) { @@ -883,6 +890,7 @@ bool give_pc_extra_info(cDialog& me, std::string item_hit, eKeyMod mods) { else if(item_hit == "seepriest") display_pc(pc,1,&me); else if(item_hit == "trait") pick_race_abil(&univ.party[pc],1,&me); else if(item_hit == "alch") display_alchemy(); + return true; } void give_pc_info(short pc_num) @@ -978,6 +986,7 @@ bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mod me["del" + n].hide(); } } + return true; } void adventure_notes() @@ -1087,6 +1096,7 @@ bool talk_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) univ.party.talk_save[store_page_on].personality = -1; } put_talk(me); + return true; } void talk_notes() @@ -1146,7 +1156,7 @@ bool journal_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) me["day" + n].setText(""); } } - + return true; } void journal() diff --git a/osx/boe.items.cpp b/osx/boe.items.cpp index c3d451ad..3b6c77a6 100644 --- a/osx/boe.items.cpp +++ b/osx/boe.items.cpp @@ -1014,7 +1014,7 @@ bool display_item_event_filter(cDialog& me, std::string id, eKeyMod mods) total_items_gettable--; put_item_graphics(me); } - + return true; } // TODO: Move this to a more appropriate place @@ -1112,6 +1112,7 @@ short custom_choice_dialog(std::array& strs,short pic_num,ePicTy if(btn && item_hit == btn->label) return i; } + return -1; } //short fancy_choice_dialog(short which_dlog,short parent) diff --git a/osx/boe.party.cpp b/osx/boe.party.cpp index e0cb41e7..e31a4083 100644 --- a/osx/boe.party.cpp +++ b/osx/boe.party.cpp @@ -1085,6 +1085,7 @@ bool spend_xp_navigate_filter(cDialog& me, std::string item_hit, eKeyMod mods) if (talk_done == true) { me.toast(); } + return true; } bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) { @@ -1193,6 +1194,7 @@ bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) { } } } + return true; } bool spend_xp(short pc_num, short mode, cDialog* parent) @@ -2498,6 +2500,7 @@ bool pick_spell_caster(cDialog& me, std::string id, eKeyMod mods) { put_pc_caster_buttons(me); put_pc_target_buttons(me); } + return true; } bool pick_spell_target(cDialog& me, std::string id, eKeyMod mods) { @@ -2517,6 +2520,7 @@ bool pick_spell_target(cDialog& me, std::string id, eKeyMod mods) { draw_spell_info(me); put_pc_target_buttons(me); } + return true; } void finish_pick_spell(cDialog& me, bool spell_toast); @@ -2537,6 +2541,7 @@ bool pick_spell_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) { give_help(207,8,me); } if(dialog_done) finish_pick_spell(me, spell_toast); + return true; } bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) { @@ -2578,6 +2583,7 @@ bool pick_spell_select_led(cDialog& me, std::string id, eKeyMod mods) { } } + return true; } void finish_pick_spell(cDialog& me, bool spell_toast) { @@ -2910,6 +2916,7 @@ bool alch_choice_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) me.setResult(item_hit[6] - '1'); } me.toast(); + return true; } short alch_choice(short pc_num) @@ -2986,7 +2993,7 @@ bool pc_name_event_filter(cDialog& me, std::string item_hit, eKeyMod mods) univ.party[store_train_pc].name = pcName; me.toast(); } - + return true; } bool pick_pc_name(short pc_num,cDialog* parent) diff --git a/osx/dialogxml/button.cpp b/osx/dialogxml/button.cpp index 19306425..55e912e0 100644 --- a/osx/dialogxml/button.cpp +++ b/osx/dialogxml/button.cpp @@ -104,6 +104,7 @@ void cButton::setColour(sf::Color clr) throw(xUnsupportedProp) { sf::Color cButton::getColour() throw(xUnsupportedProp) { // TODO: Colour is not supported + return sf::Color(); } void cButton::setBtnType(eBtnType newType) { @@ -397,6 +398,7 @@ void cLedGroup::setColour(sf::Color clr) throw(xUnsupportedProp) { sf::Color cLedGroup::getColour() throw(xUnsupportedProp) { // TODO: Colour is not supported + return sf::Color(); } bool cLedGroup::isClickable(){ diff --git a/osx/dialogxml/dialog.cpp b/osx/dialogxml/dialog.cpp index 241d3b0a..f3432c4b 100644 --- a/osx/dialogxml/dialog.cpp +++ b/osx/dialogxml/dialog.cpp @@ -1130,7 +1130,7 @@ bool cDialog::addLabelFor(std::string key, std::string label, eLabelPos where, s labelCtrl->setFormat(TXT_FONT, bold ? SILOM : GENEVA); // TODO: Do we need to set colour to white if background is dark? labelCtrl->setColour(ctrl.getColour()); - add(labelCtrl, labelRect, key); + return add(labelCtrl, labelRect, key); } std::string cDialog::process_keystroke(cKey keyHit){ diff --git a/osx/dialogxml/dialog.h b/osx/dialogxml/dialog.h index cfb57df6..175f34b2 100644 --- a/osx/dialogxml/dialog.h +++ b/osx/dialogxml/dialog.h @@ -41,7 +41,7 @@ class cDialog { void loadFromFile(std::string path); public: static void init(); - static bool noAction(cDialog&,std::string,eKeyMod) {} + static bool noAction(cDialog&,std::string,eKeyMod) {return true;} static const short BG_LIGHT, BG_DARK; explicit cDialog(cDialog* p = NULL); // dialog with no items explicit cDialog(std::string path); // cd_create_dialog diff --git a/osx/dialogxml/pict.cpp b/osx/dialogxml/pict.cpp index de518b61..750a845b 100644 --- a/osx/dialogxml/pict.cpp +++ b/osx/dialogxml/pict.cpp @@ -101,6 +101,7 @@ void cPict::setColour(sf::Color clr) throw(xUnsupportedProp) { sf::Color cPict::getColour() throw(xUnsupportedProp) { // TODO: Colour is not supported + return sf::Color(); } void cPict::setPict(pic_num_t num, ePicType type){ diff --git a/osx/dialogxml/scrollbar.cpp b/osx/dialogxml/scrollbar.cpp index b68eb201..0a23601b 100644 --- a/osx/dialogxml/scrollbar.cpp +++ b/osx/dialogxml/scrollbar.cpp @@ -61,6 +61,7 @@ void cScrollbar::setColour(sf::Color clr) throw(xUnsupportedProp) { sf::Color cScrollbar::getColour() throw(xUnsupportedProp) { // TODO: Colour is unsupported + return sf::Color(); } void cScrollbar::draw() { diff --git a/osx/tools/graphtool.cpp b/osx/tools/graphtool.cpp index eb6b6303..bbcb12df 100644 --- a/osx/tools/graphtool.cpp +++ b/osx/tools/graphtool.cpp @@ -877,6 +877,9 @@ public: case 3: return sf::Vector2f(r*sin(t), h + r*cos(t)); } + // Unreachable + printf("Whoops, rounded rectangle had bad point!"); + return sf::Vector2f(); } // TODO: Additional functions? @@ -1017,6 +1020,7 @@ Region& Region::operator-=(Region& other) { else shape->setFillColor(sf::Color::Black); shapes.push_back(shape); } + return *this; } void tileImage(sf::RenderTarget& target, RECT area, sf::Texture& img, sf::BlendMode mode){