From 5caf1ef1658d3a4eee9a90a0359b2382e75f6dc8 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Mon, 6 Aug 2018 13:59:25 +1000 Subject: [PATCH] Keep the Intel C compiler quiet By default, the Intel C compiler warns "enumerated type mixed with another type" when compiling this code. Explicit casts keep it quiet. --- src/exch.c | 2 +- src/move.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/exch.c b/src/exch.c index 0d531ab..3583cb0 100644 --- a/src/exch.c +++ b/src/exch.c @@ -213,7 +213,7 @@ void exchange_stock (void) if (keycode_company[i] == (wchar_t) key) { found = true; if (company[i].on_map) { - selection = i; + selection = (selection_t) i; } else { beep(); } diff --git a/src/move.c b/src/move.c index f0e5312..b714c96 100644 --- a/src/move.c +++ b/src/move.c @@ -294,7 +294,7 @@ selection_t get_move (void) for (i = 0, found = false; keycode_game_move[i] != L'\0'; i++) { if (keycode_game_move[i] == (wchar_t) key) { found = true; - selection = i; + selection = (selection_t) i; curs_set(CURS_OFF); left(curwin, 1, promptend, attr_normal, attr_choice, @@ -780,7 +780,7 @@ void try_start_new_company (int x, int y) company[i].name); txrefresh(); - galaxy_map[x][y] = COMPANY_TO_MAP(i); + galaxy_map[x][y] = (map_val_t) COMPANY_TO_MAP(i); company[i].share_price = INITIAL_SHARE_PRICE; company[i].share_return = INITIAL_RETURN; @@ -986,7 +986,7 @@ void include_outpost (int num, int x, int y) assign_vals(x, y, left, right, up, down); - galaxy_map[x][y] = COMPANY_TO_MAP(num); + galaxy_map[x][y] = (map_val_t) COMPANY_TO_MAP(num); inc_share_price(num, SHARE_PRICE_INC_OUTPOST); // Outposts next to stars are more valuable: increment again