From 526c561b901f9170576bc8197b67b10caeef638d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 29 Oct 2014 21:08:16 +0100 Subject: [PATCH] some minor cleanup in laws.h --- src/bindings.c | 16 ++++++++++++++++ src/laws.c | 15 --------------- src/laws.h | 3 --- src/laws.test.c | 1 + 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/bindings.c b/src/bindings.c index 94caa2d42..1446dac15 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -68,6 +68,7 @@ without prior permission by the authors of Eressea. #include #include #include +#include #include @@ -1001,6 +1002,21 @@ static int tolua_get_spells(lua_State * L) return tolua_quicklist_push(L, "spell_list", "spell", spells); } +static int init_data(const char *filename, const char *catalog) +{ + int l; + l = read_xml(filename, catalog); + reset_locales(); + if (l) { + return l; + } + if (turn < 0) { + turn = first_turn; + } + return 0; +} + + int tolua_read_xml(lua_State * L) { const char *filename = tolua_tostring(L, 1, "config.xml"); diff --git a/src/laws.c b/src/laws.c index 038c9a550..98eefca0d 100755 --- a/src/laws.c +++ b/src/laws.c @@ -83,7 +83,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include -#include #include @@ -4557,17 +4556,3 @@ void update_subscriptions(void) } fclose(F); } - -int init_data(const char *filename, const char *catalog) -{ - int l; - l = read_xml(filename, catalog); - reset_locales(); - if (l) { - return l; - } - if (turn < 0) { - turn = first_turn; - } - return 0; -} diff --git a/src/laws.h b/src/laws.h index 3ffc35f08..c9fdc095f 100755 --- a/src/laws.h +++ b/src/laws.h @@ -24,13 +24,10 @@ extern "C" { extern int writepasswd(void); void demographics(void); - void last_orders(void); - void find_address(void); void update_guards(void); void update_subscriptions(void); void deliverMail(struct faction *f, struct region *r, struct unit *u, const char *s, struct unit *receiver); - int init_data(const char *filename, const char *catalog); bool renamed_building(const struct building * b); int rename_building(struct unit * u, struct order * ord, struct building * b, const char *name); diff --git a/src/laws.test.c b/src/laws.test.c index 48283b017..d456769b1 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -57,6 +57,7 @@ static void test_rename_building(CuTest * tc) rename_building(u, NULL, b, "Villa Nagel"); CuAssertStrEquals(tc, "Villa Nagel", b->name); + CuAssertTrue(tc, renamed_building(b)); } static void test_rename_building_twice(CuTest * tc)