From 0c6ec475987a589451a99786959c1aaff450f592 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 30 Sep 2018 13:45:19 +0200 Subject: [PATCH] fix compilation --- src/kernel/building.c | 2 +- src/laws.test.c | 4 ++-- src/move.test.c | 6 +++--- src/orderfile.c | 1 + src/report.test.c | 3 ++- src/util/order_parser.c | 2 +- src/util/order_parser.h | 6 ++++++ 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/kernel/building.c b/src/kernel/building.c index fe28b3752..f5698eaa9 100644 --- a/src/kernel/building.c +++ b/src/kernel/building.c @@ -257,7 +257,7 @@ building *findbuilding(int i) static local_names *bnames; -static void free_bnames() { +static void free_bnames(void) { while (bnames) { local_names *bn = bnames; bnames = bnames->next; diff --git a/src/laws.test.c b/src/laws.test.c index bb26ed872..e7951a7ce 100644 --- a/src/laws.test.c +++ b/src/laws.test.c @@ -395,11 +395,11 @@ static void test_unit_limit(CuTest * tc) static void test_findparam_ex(CuTest *tc) { struct locale *lang; - struct building_type *btype; + test_setup(); lang = test_create_locale(); locale_setstring(lang, "temple", "TEMPEL"); - btype = test_create_buildingtype("temple"); + test_create_buildingtype("temple"); CuAssertIntEquals(tc, P_GEBAEUDE, findparam_ex("TEMPEL", lang)); CuAssertIntEquals(tc, P_GEBAEUDE, findparam_ex( diff --git a/src/move.test.c b/src/move.test.c index 4e9e4760d..e782bb748 100644 --- a/src/move.test.c +++ b/src/move.test.c @@ -2,12 +2,12 @@ #include #include "move.h" -#include "keyword.h" #include "lighthouse.h" -#include +#include #include #include +#include #include #include #include @@ -17,7 +17,7 @@ #include #include -#include +#include "util/keyword.h" #include #include #include diff --git a/src/orderfile.c b/src/orderfile.c index a4f47a4e3..48cc26a83 100644 --- a/src/orderfile.c +++ b/src/orderfile.c @@ -17,6 +17,7 @@ #include "util/order_parser.h" #include +#include #include #include diff --git a/src/report.test.c b/src/report.test.c index 4fa97825c..3c49b14fc 100644 --- a/src/report.test.c +++ b/src/report.test.c @@ -2,7 +2,6 @@ #include "report.h" #include "move.h" #include "travelthru.h" -#include "keyword.h" #include #include @@ -15,6 +14,8 @@ #include #include +#include "util/keyword.h" +#include "util/param.h" #include #include #include diff --git a/src/util/order_parser.c b/src/util/order_parser.c index 363f12c92..b0d6d2d10 100644 --- a/src/util/order_parser.c +++ b/src/util/order_parser.c @@ -14,7 +14,7 @@ struct OrderParserStruct { OP_FactionHandler m_factionHandler; OP_UnitHandler m_unitHandler; OP_OrderHandler m_orderHandler; - enum CR_Error m_errorCode; + enum OP_Error m_errorCode; int m_lineNumber; }; diff --git a/src/util/order_parser.h b/src/util/order_parser.h index 7600ee3da..c8f20e89e 100644 --- a/src/util/order_parser.h +++ b/src/util/order_parser.h @@ -23,6 +23,12 @@ enum OP_Status { OP_STATUS_OK = 1 }; +enum OP_Error { + OP_ERROR_NONE, + OP_ERROR_NO_MEMORY, + OP_ERROR_SYNTAX +}; + typedef void(*OP_FactionHandler) (void *userData, int no, const char *password); typedef void(*OP_UnitHandler) (void *userData, int no); typedef void(*OP_OrderHandler) (void *userData, const char *str);