From 37aded9b1d1ace41db45d87e71d679b0bba9d3af Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 21 May 2017 16:12:13 +0200 Subject: [PATCH 1/2] remove unused function --- src/laws.test.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/laws.test.c b/src/laws.test.c index 7e5df0b56..4d6adbfe9 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -1446,10 +1446,6 @@ static void test_show_both(CuTest *tc) { test_cleanup(); } -static int low_wage(const region * r, const faction * f, const race * rc, int in_turn) { - return 1; -} - static void test_immigration(CuTest * tc) { region *r; From a3f655f3226a0799a2cb311c6d8d6bc32763240c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 22 May 2017 21:35:25 +0200 Subject: [PATCH 2/2] fix bogus warnings --- src/kernel/building.c | 9 +++++---- src/kernel/ship.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/kernel/building.c b/src/kernel/building.c index 92a4fd6f1..bcc914cca 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -75,15 +75,16 @@ static building_type *bt_find_i(const char *name) if (match) { cb_get_kv(match, &btype, sizeof(btype)); } - else { - log_warning("st_find: could not find ship '%s'\n", name); - } return btype; } const building_type *bt_find(const char *name) { - return bt_find_i(name); + building_type *btype = bt_find_i(name); + if (!btype) { + log_warning("bt_find: could not find building '%s'\n", name); + } + return btype; } static int bt_changes = 1; diff --git a/src/kernel/ship.c b/src/kernel/ship.c index 3a7608789..220c16619 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -97,14 +97,15 @@ static ship_type *st_find_i(const char *name) if (match) { cb_get_kv(match, &st, sizeof(st)); } - else { - log_warning("st_find: could not find ship '%s'\n", name); - } return st; } const ship_type *st_find(const char *name) { - return st_find_i(name); + ship_type *st = st_find_i(name); + if (!st) { + log_warning("st_find: could not find ship '%s'\n", name); + } + return st; } static void st_register(ship_type *stype) {