enable checker build.

remove getid aliases from parser.h
This commit is contained in:
Enno Rehling 2018-09-29 13:35:49 +02:00
parent b22d838a57
commit 991fe8fd8d
6 changed files with 8 additions and 11 deletions

View file

@ -191,8 +191,8 @@ target_link_libraries(parser
) )
#add_executable(checker ${CHECK_SRC}) add_executable(checker ${CHECK_SRC})
#target_link_libraries(checker parser) target_link_libraries(checker parser)
add_library(game ${ERESSEA_SRC}) add_library(game ${ERESSEA_SRC})
target_link_libraries(game parser version) target_link_libraries(game parser version)

View file

@ -2,8 +2,9 @@
#include <platform.h> #include <platform.h>
#endif #endif
#include "util/parser.h"
#include <stdio.h> #include <stdio.h>
#include "orderfile.h"
int main(int argc, char **argv) { int main(int argc, char **argv) {
FILE * F = stdin; FILE * F = stdin;
@ -14,7 +15,6 @@ int main(int argc, char **argv) {
perror(filename); perror(filename);
return -1; return -1;
} }
readorders(F);
fclose(F); fclose(F);
} }
return 0; return 0;

View file

@ -79,7 +79,7 @@ struct building *getbuilding(const struct region *r)
ship *getship(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) { for (sh = r->ships; sh; sh = sh->next) {
if (sh == sx) if (sh == sx)
return sh; return sh;

View file

@ -1952,7 +1952,7 @@ int mail_cmd(unit * u, struct order *ord)
} }
case P_FACTION: case P_FACTION:
n = getfactionid(); n = getid();
for (u2 = r->units; u2; u2 = u2->next) { for (u2 = r->units; u2; u2 = u2->next) {
if (u2->faction->no == n && seefaction(u->faction, r, u2, 0)) { if (u2->faction->no == n && seefaction(u->faction, r, u2, 0)) {

View file

@ -2265,7 +2265,7 @@ int follow_ship(unit * u, order * ord)
return 0; return 0;
} }
id = getshipid(); id = getid();
if (id <= 0) { if (id <= 0) {
cmistake(u, ord, 20, MSG_MOVE); cmistake(u, ord, 20, MSG_MOVE);
@ -2549,7 +2549,7 @@ void follow_unit(unit * u)
} }
} }
else if (p == P_SHIP) { else if (p == P_SHIP) {
id = getshipid(); id = getid();
if (id <= 0) { if (id <= 0) {
/* cmistake(u, ord, 20, MSG_MOVE); */ /* cmistake(u, ord, 20, MSG_MOVE); */
} }

View file

@ -33,9 +33,6 @@ extern "C" {
int getid(void); int getid(void);
unsigned int atoip(const char *s); unsigned int atoip(const char *s);
#define getshipid() getid()
#define getfactionid() getid()
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif