fix compiler warnings

This commit is contained in:
2025-01-20 09:41:29 -05:00
parent f545ce5333
commit 37640bf349
9 changed files with 9 additions and 9 deletions

View File

@@ -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;

View File

@@ -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){

View File

@@ -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;

View File

@@ -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"){

View File

@@ -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 << " ";

View File

@@ -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.

View File

@@ -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) {

View File

@@ -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() {

View File

@@ -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<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());
}
@@ -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());