From 991fe8fd8da2e8b0d466b0941360561cbdce798f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 29 Sep 2018 13:35:49 +0200 Subject: [PATCH] enable checker build. remove getid aliases from parser.h --- src/CMakeLists.txt | 4 ++-- src/checker.c | 4 ++-- src/kernel/build.c | 2 +- src/laws.c | 2 +- src/move.c | 4 ++-- src/util/parser.h | 3 --- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be26a30a4..e6b83cfe1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -191,8 +191,8 @@ target_link_libraries(parser ) -#add_executable(checker ${CHECK_SRC}) -#target_link_libraries(checker parser) +add_executable(checker ${CHECK_SRC}) +target_link_libraries(checker parser) add_library(game ${ERESSEA_SRC}) target_link_libraries(game parser version) diff --git a/src/checker.c b/src/checker.c index 1a07897a0..302c80390 100644 --- a/src/checker.c +++ b/src/checker.c @@ -2,8 +2,9 @@ #include #endif +#include "util/parser.h" + #include -#include "orderfile.h" int main(int argc, char **argv) { FILE * F = stdin; @@ -14,7 +15,6 @@ int main(int argc, char **argv) { perror(filename); return -1; } - readorders(F); fclose(F); } return 0; diff --git a/src/kernel/build.c b/src/kernel/build.c index 0891f1005..82c629b0b 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -79,7 +79,7 @@ struct building *getbuilding(const struct region *r) ship *getship(const struct region * r) { - ship *sh, *sx = findship(getshipid()); + ship *sh, *sx = findship(getid()); for (sh = r->ships; sh; sh = sh->next) { if (sh == sx) return sh; diff --git a/src/laws.c b/src/laws.c index d7f8c53de..67e4567a9 100644 --- a/src/laws.c +++ b/src/laws.c @@ -1952,7 +1952,7 @@ int mail_cmd(unit * u, struct order *ord) } case P_FACTION: - n = getfactionid(); + n = getid(); for (u2 = r->units; u2; u2 = u2->next) { if (u2->faction->no == n && seefaction(u->faction, r, u2, 0)) { diff --git a/src/move.c b/src/move.c index 8de997480..124b846ca 100644 --- a/src/move.c +++ b/src/move.c @@ -2265,7 +2265,7 @@ int follow_ship(unit * u, order * ord) return 0; } - id = getshipid(); + id = getid(); if (id <= 0) { cmistake(u, ord, 20, MSG_MOVE); @@ -2549,7 +2549,7 @@ void follow_unit(unit * u) } } else if (p == P_SHIP) { - id = getshipid(); + id = getid(); if (id <= 0) { /* cmistake(u, ord, 20, MSG_MOVE); */ } diff --git a/src/util/parser.h b/src/util/parser.h index 7242da1bb..a540aa2ac 100644 --- a/src/util/parser.h +++ b/src/util/parser.h @@ -33,9 +33,6 @@ extern "C" { int getid(void); unsigned int atoip(const char *s); -#define getshipid() getid() -#define getfactionid() getid() - #ifdef __cplusplus } #endif