From 37640bf3497dd0479523fd2b9a741cb325559d33 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 20 Jan 2025 09:41:29 -0500 Subject: [PATCH] fix compiler warnings --- src/fileio/fileio.cpp | 1 + src/game/boe.actions.cpp | 2 +- src/game/boe.dlgutil.cpp | 2 +- src/game/boe.main.cpp | 3 +-- src/game/boe.text.cpp | 2 +- src/gfx/render_text.cpp | 1 - src/pcedit/pc.action.cpp | 1 + src/scenedit/scen.actions.cpp | 1 + src/scenedit/scen.main.cpp | 5 ++--- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fileio/fileio.cpp b/src/fileio/fileio.cpp index c7ea40ea..69a2c149 100644 --- a/src/fileio/fileio.cpp +++ b/src/fileio/fileio.cpp @@ -21,6 +21,7 @@ #include "fileio/resmgr/res_strings.hpp" #include "fileio/resmgr/res_sound.hpp" +bool mac_is_intel(); // to suppress "no prototype" warning bool mac_is_intel(){ static bool checked_for_intel = false; static bool _mac_is_intel; diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index 33f958e3..85b1b4c7 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -319,7 +319,7 @@ void handle_spellcast(eSkill which_type, bool& did_something, bool& need_redraw, } // Recenter the camera after look is finished or canceled: -void end_look(bool right_button, bool& need_redraw) { +static void end_look(bool right_button, bool& need_redraw) { if(overall_mode == MODE_LOOK_COMBAT) { overall_mode = MODE_COMBAT; if(!right_button){ diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index 351bbc37..82b949f4 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -1238,7 +1238,7 @@ static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { return true; } -static bool reset_help(cDialog& me, std::string id, eKeyMod) { +static bool reset_help(cDialog& me, std::string, eKeyMod) { if(cChoiceDlog("confirm-reset-help", {"yes", "no"}, &me).show() == "yes") clear_pref("ReceivedHelp"); return true; diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 48423b3c..9145ae5c 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -528,12 +528,11 @@ std::map startup_button_names_v1 = { {2, "Preferences"}, }; -void replay_action(Element& action) { +static void replay_action(Element& action) { bool did_something = false, need_redraw = false, need_reprint = false; std::string _last_action_type = last_action_type; std::string t = action.Value(); - int enum_v; // NOTE: Action replay blocks need to return early unless the action advances time if(overall_mode == MODE_STARTUP && t == "startup_button_click"){ diff --git a/src/game/boe.text.cpp b/src/game/boe.text.cpp index 617ccc02..a973acb3 100644 --- a/src/game/boe.text.cpp +++ b/src/game/boe.text.cpp @@ -839,7 +839,7 @@ cVehicle* out_horse_there(location where) { return nullptr; } -void print_monster_count(std::string m_name, short num){ +static void print_monster_count(std::string m_name, short num){ if(num > 0){ std::ostringstream sout; sout << " "; diff --git a/src/gfx/render_text.cpp b/src/gfx/render_text.cpp index 2de57da2..e7a6d22c 100644 --- a/src/gfx/render_text.cpp +++ b/src/gfx/render_text.cpp @@ -100,7 +100,6 @@ break_info_t calculate_line_wrapping(rectangle dest_rect, std::string str, TextS unsigned short last_line_break = 0,last_word_break = 0; str_to_draw.setString(str); - short total_width = str_to_draw.getLocalBounds().width; // Even if the text is only one line, break_info is required for calculating word boundaries. // So we can't skip the rest of this. diff --git a/src/pcedit/pc.action.cpp b/src/pcedit/pc.action.cpp index ae9075ac..16f299de 100644 --- a/src/pcedit/pc.action.cpp +++ b/src/pcedit/pc.action.cpp @@ -29,6 +29,7 @@ extern rectangle name_rect; extern rectangle pc_race_rect; extern rectangle edit_rect[5]; +bool check_for_interrupt(std::string); // to suppress "missing prototype" warning bool check_for_interrupt(std::string) { return false; } bool handle_action(const sf::Event & event) { diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index 39606407..052093b3 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -102,6 +102,7 @@ short special_to_paste = -1; bool monst_on_space(location loc,short m_num); static bool terrain_matches(unsigned char x, unsigned char y, ter_num_t ter); +bool check_for_interrupt(std::string); // to suppress "missing prototype" warning bool check_for_interrupt(std::string) { return false; } void init_screen_locs() { diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index 17be5225..bcfe1774 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -101,7 +101,7 @@ extern std::string last_load_file; enum class eLaunchType {LOC,START,ENTRANCE}; -void launch_scenario(eLaunchType type) { +static void launch_scenario(eLaunchType type) { if(boost::ends_with(last_load_file, ".exs")){ showError("The scenario editor cannot launch an unpacked scenario directly. You'll need to re-open the scenario from its .boes archive."); return; @@ -807,7 +807,6 @@ static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { else if(scale == "3") set_pref("UIScale", 3.0); else if(scale == "4") set_pref("UIScale", 4.0); set_pref("PlaySounds", dynamic_cast(me["nosound"]).getState() == led_off); - bool v = dynamic_cast(me["force-default-party"]).getState() == led_red; set_pref("ForceDefaultParty", dynamic_cast(me["force-default-party"]).getState() == led_red); set_pref("DefaultPartyPath", dynamic_cast(me["party-path"]).getText()); } @@ -881,7 +880,7 @@ void pick_preferences() { }); cButton& choose_button = dynamic_cast(prefsDlog["choose-party"]); - choose_button.attachClickHandler([&default_party_field](cDialog& me, std::string, eKeyMod) -> bool { + choose_button.attachClickHandler([&default_party_field](cDialog&, std::string, eKeyMod) -> bool { fs::path new_path = nav_get_party(); if(!new_path.empty()){ default_party_field.setText(new_path.string());