From 7cc34abacab28821e2783ab56139d06dc8cb97bb Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 23 Oct 2016 18:45:27 +0200 Subject: [PATCH] contact: Rename getcontact() to in_contact() The next commit will create a contact file, and the macro to get a contact entry will be named getcontact(). Rename the existing getcontact() out of the way. Signed-off-by: Markus Armbruster --- include/nat.h | 2 +- src/lib/commands/decl.c | 2 +- src/lib/commands/news.c | 4 ++-- src/lib/commands/rela.c | 4 ++-- src/lib/commands/repo.c | 2 +- src/lib/common/nat.c | 2 +- src/lib/common/nstreval.c | 2 +- src/lib/subs/natarg.c | 3 ++- src/lib/update/nat.c | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/nat.h b/include/nat.h index 3a4e021b..955ce95c 100644 --- a/include/nat.h +++ b/include/nat.h @@ -168,7 +168,7 @@ extern char *natstate(struct natstr *np); extern int getrel(struct natstr *np, natid them); extern int relations_with(natid, natid); extern int getrejects(natid them, struct natstr *np); -extern int getcontact(struct natstr *np, natid them); +extern int in_contact(struct natstr *np, natid them); extern void putrel(struct natstr *np, natid them, int relate); extern void putreject(struct natstr *np, natid them, int how, int what); extern void agecontact(struct natstr *np); diff --git a/src/lib/commands/decl.c b/src/lib/commands/decl.c index 80436c88..5eeda4f9 100644 --- a/src/lib/commands/decl.c +++ b/src/lib/commands/decl.c @@ -87,7 +87,7 @@ decl(void) if (who == (natid)ni.cur) continue; if (opt_HIDDEN) { - if (!player->god && !getcontact(natp, ni.cur)) { + if (!player->god && !in_contact(natp, ni.cur)) { pr("You haven't contacted country #%d yet\n", ni.cur); continue; } diff --git a/src/lib/commands/news.c b/src/lib/commands/news.c index 35ba3e8c..53adfb7e 100644 --- a/src/lib/commands/news.c +++ b/src/lib/commands/news.c @@ -103,8 +103,8 @@ news(void) nws.nws_ntm = 1; if (opt_HIDDEN) { if (!player->god && - !(getcontact(getnatp(player->cnum), nws.nws_ano) && - getcontact(getnatp(player->cnum), nws.nws_vno))) + !(in_contact(getnatp(player->cnum), nws.nws_ano) && + in_contact(getnatp(player->cnum), nws.nws_vno))) continue; } page_has_news[rpt[nws.nws_vrb].r_newspage] = 1; diff --git a/src/lib/commands/rela.c b/src/lib/commands/rela.c index 5b485d2d..da73d641 100644 --- a/src/lib/commands/rela.c +++ b/src/lib/commands/rela.c @@ -69,9 +69,9 @@ rela(void) if (np->nat_stat < STAT_SANCT) continue; if (opt_HIDDEN) { - if (!player->god && !getcontact(natp, cn)) + if (!player->god && !in_contact(natp, cn)) continue; - if (!player->god && !getcontact(getnatp(player->cnum), cn)) + if (!player->god && !in_contact(getnatp(player->cnum), cn)) continue; } pr("%3d) %-20.20s ", cn, cname(cn)); diff --git a/src/lib/commands/repo.c b/src/lib/commands/repo.c index 2be2e241..1c73fd43 100644 --- a/src/lib/commands/repo.c +++ b/src/lib/commands/repo.c @@ -58,7 +58,7 @@ repo(void) if (nat.nat_stat == STAT_UNUSED) continue; if (opt_HIDDEN) { - if (!player->god && !getcontact(natp, ni.cur)) + if (!player->god && !in_contact(natp, ni.cur)) continue; } if (!player->god && nat.nat_stat != STAT_ACTIVE) diff --git a/src/lib/common/nat.c b/src/lib/common/nat.c index f5372e78..ebdcef98 100644 --- a/src/lib/common/nat.c +++ b/src/lib/common/nat.c @@ -108,7 +108,7 @@ agecontact(struct natstr *np) } int -getcontact(struct natstr *np, natid them) +in_contact(struct natstr *np, natid them) { return np->nat_contact[them]; } diff --git a/src/lib/common/nstreval.c b/src/lib/common/nstreval.c index 0cc5b49b..e5820947 100644 --- a/src/lib/common/nstreval.c +++ b/src/lib/common/nstreval.c @@ -184,7 +184,7 @@ nstr_eval(struct valstr *val, natid cnum, void *ptr, enum nsc_type want) break; natp = getnatp(cnum); if (natp->nat_stat != STAT_GOD - && !(getcontact(natp, idx) && getcontact(ptr, idx))) + && !(in_contact(natp, idx) && in_contact(ptr, idx))) val->val_as.lng = -1; } break; diff --git a/src/lib/subs/natarg.c b/src/lib/subs/natarg.c index c53dff7d..48f4bcf6 100644 --- a/src/lib/subs/natarg.c +++ b/src/lib/subs/natarg.c @@ -95,7 +95,8 @@ natarg(char *arg, char *prompt) if (!np) return -1; if (opt_HIDDEN) { - if (!player->god && !getcontact(getnatp(player->cnum), np->nat_cnum)) { + if (!player->god + && !in_contact(getnatp(player->cnum), np->nat_cnum)) { if (np->nat_stat != STAT_GOD) { pr("Country '%s' has not been contacted.\n", arg); return -1; diff --git a/src/lib/update/nat.c b/src/lib/update/nat.c index dcec39ee..ad3607a8 100644 --- a/src/lib/update/nat.c +++ b/src/lib/update/nat.c @@ -252,7 +252,7 @@ share_incr(double res[], double tech[]) if (other->nat_stat != STAT_ACTIVE) continue; if (opt_HIDDEN) { - if (!getcontact(np, j)) + if (!in_contact(np, j)) continue; }