Skip to content

Commit

Permalink
Address compile warnings (Xcode 12) in the editors
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Aug 10, 2024
1 parent 84b649a commit 30e583b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/pcedit/pc.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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
}

2 changes: 0 additions & 2 deletions src/scenedit/scen.actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 10 additions & 1 deletion src/scenedit/scen.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 30e583b

Please sign in to comment.