diff --git a/src/gfx.c b/src/gfx.c index c6c265029d..8c14b8c932 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -83,7 +83,7 @@ int gfx_load_g1() } // Unsuccessful - RCT2_ERR("Unable to load g1.dat"); + RCT2_ERROR("Unable to load g1.dat"); return 0; } diff --git a/src/peep.c b/src/peep.c index cc1611315c..c6f910fe13 100644 --- a/src/peep.c +++ b/src/peep.c @@ -18,6 +18,7 @@ * along with this program. If not, see . *****************************************************************************/ +#include #include "addresses.h" #include "news_item.h" #include "peep.h" diff --git a/src/rct2.h b/src/rct2.h index de15afa96f..b95864f69c 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -50,9 +50,8 @@ typedef unsigned long long uint64; #ifdef _MSC_VER #define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__); #else -#define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __func__, __LINE__, __VA_ARGS__); +#define RCT2_ERROR(format,...) fprintf(stderr, "ERROR %s:%s():%d: " format "\n", __FILE__, __func__, __LINE__, ## __VA_ARGS__); #endif -#define RCT2_ERR(msg) RCT2_ERROR("%s",msg) #ifndef _MSC_VER // use similar struct packing as MSVC for our structs diff --git a/src/sawyercoding.c b/src/sawyercoding.c index f738aff1ab..10af63d500 100644 --- a/src/sawyercoding.c +++ b/src/sawyercoding.c @@ -18,6 +18,7 @@ * along with this program. If not, see . *****************************************************************************/ +#include #include #include "addresses.h" #include "rct2.h" diff --git a/src/scenario_list.c b/src/scenario_list.c index 9d2ca8741d..c2e7a97df7 100644 --- a/src/scenario_list.c +++ b/src/scenario_list.c @@ -169,7 +169,7 @@ static int scenario_scores_load() // Try and load the scores file file = fopen(get_file_path(PATH_ID_SCORES), "rb"); if (file == NULL) { - RCT2_ERR("Unable to load scenario scores."); + RCT2_ERROR("Unable to load scenario scores."); return 0; } @@ -177,7 +177,7 @@ static int scenario_scores_load() rct_scenario_scores_header header; if (fread(&header, 16, 1, file) != 1) { fclose(file); - RCT2_ERR("Invalid header in scenario scores file."); + RCT2_ERROR("Invalid header in scenario scores file."); return 0; } gScenarioListCount = header.scenario_count; @@ -210,7 +210,7 @@ int scenario_scores_save() file = fopen(get_file_path(PATH_ID_SCORES), "wb"); if (file == NULL) { - RCT2_ERR("Unable to save scenario scores."); + RCT2_ERROR("Unable to save scenario scores."); return 0; } diff --git a/src/window_save_prompt.c b/src/window_save_prompt.c index 6de5cf2223..e4893c6414 100644 --- a/src/window_save_prompt.c +++ b/src/window_save_prompt.c @@ -247,7 +247,7 @@ static void window_save_prompt_mouseup() switch (widgetIndex) { case WIDX_SAVE: // TODO to avoid data loss, treat SAVE as CANCEL - RCT2_ERROR("%s", "TODO\n"); + RCT2_ERROR("TODO"); window_close(w); window_save_prompt_close(); return;