Skip to content

Commit

Permalink
fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jan 20, 2025
1 parent f545ce5 commit 37640bf
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/fileio/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/game/boe.actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion src/game/boe.dlgutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/game/boe.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,12 +528,11 @@ std::map<int, std::string> 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"){
Expand Down
2 changes: 1 addition & 1 deletion src/game/boe.text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 << " ";
Expand Down
1 change: 0 additions & 1 deletion src/gfx/render_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/pcedit/pc.action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/scenedit/scen.actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 2 additions & 3 deletions src/scenedit/scen.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<cLed&>(me["nosound"]).getState() == led_off);
bool v = dynamic_cast<cLed&>(me["force-default-party"]).getState() == led_red;
set_pref("ForceDefaultParty", dynamic_cast<cLed&>(me["force-default-party"]).getState() == led_red);
set_pref("DefaultPartyPath", dynamic_cast<cTextField&>(me["party-path"]).getText());
}
Expand Down Expand Up @@ -881,7 +880,7 @@ void pick_preferences() {
});

cButton& choose_button = dynamic_cast<cButton&>(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());
Expand Down

0 comments on commit 37640bf

Please sign in to comment.