From 30e583b1d4d1ce890a15cc493dc0ef499a0798b2 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 10 Aug 2024 12:58:01 -0400 Subject: [PATCH] Address compile warnings (Xcode 12) in the editors --- src/pcedit/pc.main.cpp | 11 ++++++++++- src/scenedit/scen.actions.cpp | 2 -- src/scenedit/scen.main.cpp | 11 ++++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index e4197e603..fa595b57c 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -80,7 +80,7 @@ extern fs::path progDir; short specials_res_id; char start_name[256]; -void process_args(int argc, char* argv[]) { +static void process_args(int argc, char* argv[]) { if(argc > 1) { if(load_party(argv[1], univ)) { file_in_mem = argv[1]; @@ -563,7 +563,16 @@ void pick_preferences() { prefsDlog.run(); + // Suppress the float comparison warning. + // We know it's safe here - we're just comparing static values. + #ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" + #endif if(get_float_pref("UIScale") != ui_scale) changed_display_mode = true; + #ifdef __GNUC__ + #pragma GCC diagnostic pop + #endif } diff --git a/src/scenedit/scen.actions.cpp b/src/scenedit/scen.actions.cpp index f02ccd7bb..7883a090d 100644 --- a/src/scenedit/scen.actions.cpp +++ b/src/scenedit/scen.actions.cpp @@ -2511,8 +2511,6 @@ extern size_t num_strs(short mode); // defined in scen.keydlgs.cpp // mode 0 - scen 1 - out 2 - town 3 - journal // if just_redo_text not 0, simply need to update text portions void start_string_editing(eStrMode mode,short just_redo_text) { - long pos; - if(just_redo_text == 0) { if(overall_mode < MODE_MAIN_SCREEN) set_up_main_screen(); diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index 550c5e729..02116f5d7 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -187,7 +187,7 @@ void adjust_windows (sf::RenderWindow & mainPtr, sf::View & mainView) { adjust_window_for_menubar(5, width, height); } -void process_args(int argc, char* argv[]) { +static void process_args(int argc, char* argv[]) { if(argc > 1) { if(load_scenario(argv[1], scenario)) { set_current_town(scenario.last_town_edited); @@ -726,8 +726,17 @@ void pick_preferences() { prefsDlog.run(); + // Suppress the float comparison warning. + // We know it's safe here - we're just comparing static values. + #ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" + #endif if(get_float_pref("UIScale") != ui_scale) changed_display_mode = true; + #ifdef __GNUC__ + #pragma GCC diagnostic pop + #endif } void Mouse_Pressed(const sf::Event & event) {