diff options
author | rillig <rillig@NetBSD.org> | 2021-05-02 12:50:43 +0000 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-05-05 14:56:21 -0400 |
commit | 1c75ca2e2dc72d118edbb854455e602d70d80a52 (patch) | |
tree | a815eb983fa15e7c407095122e37acb90093be9a /adventure | |
parent | 2442661e769456700d67fac92056d18b3046633e (diff) | |
download | bsdgames-darwin-1c75ca2e2dc72d118edbb854455e602d70d80a52.tar.gz bsdgames-darwin-1c75ca2e2dc72d118edbb854455e602d70d80a52.tar.zst bsdgames-darwin-1c75ca2e2dc72d118edbb854455e602d70d80a52.zip |
games: remove trailing whitespace in *.c and *.h
Diffstat (limited to 'adventure')
-rw-r--r-- | adventure/init.c | 6 | ||||
-rw-r--r-- | adventure/io.c | 22 | ||||
-rw-r--r-- | adventure/main.c | 10 | ||||
-rw-r--r-- | adventure/setup.c | 6 | ||||
-rw-r--r-- | adventure/subr.c | 28 | ||||
-rw-r--r-- | adventure/vocab.c | 6 | ||||
-rw-r--r-- | adventure/wizard.c | 6 |
7 files changed, 42 insertions, 42 deletions
diff --git a/adventure/init.c b/adventure/init.c index d4b028e1..0e60e1f9 100644 --- a/adventure/init.c +++ b/adventure/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.21 2014/03/22 20:07:05 dholland Exp $ */ +/* $NetBSD: init.c,v 1.22 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: init.c,v 1.21 2014/03/22 20:07:05 dholland Exp $"); +__RCSID("$NetBSD: init.c,v 1.22 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -59,7 +59,7 @@ static void linkdata(void); int blklin = TRUE; -int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, +int setbit[16] = {1, 2, 4, 010, 020, 040, 0100, 0200, 0400, 01000, 02000, 04000, 010000, 020000, 040000, 0100000}; volatile sig_atomic_t delhit; diff --git a/adventure/io.c b/adventure/io.c index eae7695c..327c1fb7 100644 --- a/adventure/io.c +++ b/adventure/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.22 2009/08/25 06:56:52 dholland Exp $ */ +/* $NetBSD: io.c,v 1.23 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: io.c,v 1.22 2009/08/25 06:56:52 dholland Exp $"); +__RCSID("$NetBSD: io.c,v 1.23 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -178,7 +178,7 @@ static const char *tape = iotape; /* pointer to encryption tape */ /* next virtual char, bump adr */ static int next(void) -{ +{ int ch; ch = (*inptr ^ random()) & 0xFF; /* Decrypt input data */ @@ -196,7 +196,7 @@ static char breakch; /* tell which char ended rnum */ /* "read" data from virtual file */ void rdata(void) -{ +{ int sect; char ch; @@ -273,7 +273,7 @@ static char nbf[12]; /* read initial location num */ static int rnum(void) -{ +{ char *s; tape = iotape; /* restart encryption tape */ for (s = nbf, *s = 0;; s++) @@ -316,7 +316,7 @@ rdesc(int sect) ptext[oldloc].txtlen = maystart - seekstart; break; case 6:/* random messages */ - if (oldloc >= RTXSIZE) + if (oldloc >= RTXSIZE) errx(1,"Too many random msgs"); rtext[oldloc].seekadr = seekhere; rtext[oldloc].txtlen = maystart - seekstart; @@ -354,7 +354,7 @@ rdesc(int sect) /* read travel table */ static void rtrav(void) -{ +{ int locc; struct travlist *t = NULL; char *s; @@ -362,7 +362,7 @@ rtrav(void) int len, m, n, entries = 0; for (oldloc = -1;;) { /* get another line */ - /* end of entry */ + /* end of entry */ if ((locc = rnum()) != oldloc && oldloc >= 0 && t) { t->next = 0; /* terminate the old entry */ /* printf("%d:%d entries\n",oldloc,entries); */ @@ -460,7 +460,7 @@ rvoc(void) /* initial object locations */ static void rlocs(void) -{ +{ for (;;) { if ((obj = rnum()) < 0) break; @@ -475,7 +475,7 @@ rlocs(void) /* default verb messages */ static void rdefault(void) -{ +{ for (;;) { if ((verb = rnum()) < 0) break; @@ -486,7 +486,7 @@ rdefault(void) /* liquid assets &c: cond bits */ static void rliq(void) -{ +{ int bitnum; for (;;) { /* read new bit list */ if ((bitnum = rnum()) < 0) diff --git a/adventure/main.c b/adventure/main.c index ee30e14e..f0dfa903 100644 --- a/adventure/main.c +++ b/adventure/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.21 2009/08/25 06:56:52 dholland Exp $ */ +/* $NetBSD: main.c,v 1.22 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: main.c,v 1.21 2009/08/25 06:56:52 dholland Exp $"); +__RCSID("$NetBSD: main.c,v 1.22 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -407,7 +407,7 @@ l4080: if (place[eggs] == plac[eggs] || (toting(eggs) && loc == plac[eggs])) goto l2011; - if (place[eggs] == 0 && place[troll] == 0 && + if (place[eggs] == 0 && place[troll] == 0 && prop[troll] == 0) prop[troll] = 1; k = 2; @@ -593,7 +593,7 @@ l4090: if (obj == food) goto l8142; if (obj == bird || obj == snake || obj == clam - || obj == oyster || obj == dwarf || obj == dragon + || obj == oyster || obj == dwarf || obj == dragon || obj == troll || obj == bear) spk = 71; goto l2011; @@ -634,7 +634,7 @@ l4090: || k == liqloc(loc)) spk = 94; for (i = 1; i <= 5; i++) - if (dloc[i] == loc && dflag >= 2 + if (dloc[i] == loc && dflag >= 2 && obj == dwarf) spk = 94; if (closed) diff --git a/adventure/setup.c b/adventure/setup.c index 36a7c0e9..d3e303a8 100644 --- a/adventure/setup.c +++ b/adventure/setup.c @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.11 2005/07/01 00:03:36 jmc Exp $ */ +/* $NetBSD: setup.c,v 1.12 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ static char copyright[] = "@(#) Copyright (c) 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: setup.c,v 1.11 2005/07/01 00:03:36 jmc Exp $"; +static char rcsid[] = "$NetBSD: setup.c,v 1.12 2021/05/02 12:50:43 rillig Exp $"; #endif #endif /* not lint */ @@ -98,7 +98,7 @@ main(int argc, char *argv[]) while ((c = getc(infile)) != EOF) { if (linestart && c == ' ') { /* Convert first spaces to tab */ - printf("0x%02x,", + printf("0x%02x,", (unsigned int)('\t' ^ random()) & 0xFF); while ((c = getc(infile)) == ' ' && c != EOF); /* Drop the non-whitespace character through */ diff --git a/adventure/subr.c b/adventure/subr.c index 0fd6c27c..4a4e5743 100644 --- a/adventure/subr.c +++ b/adventure/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.13 2009/08/25 06:56:52 dholland Exp $ */ +/* $NetBSD: subr.c,v 1.14 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: subr.c,v 1.13 2009/08/25 06:56:52 dholland Exp $"); +__RCSID("$NetBSD: subr.c,v 1.14 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -210,7 +210,7 @@ fdwarf(void) j = 1 + ran(j); odloc[i] = dloc[i]; dloc[i] = tk[j]; - dseen[i] = (dseen[i] && loc >= 15) || + dseen[i] = (dseen[i] && loc >= 15) || (dloc[i] == loc || odloc[i] == loc); if (!dseen[i]) continue; /* i.e. goto 6030 */ @@ -298,7 +298,7 @@ l82: if (stick <= 1) { /* 82 */ /* label 8 */ int march(void) -{ +{ int ll1, ll2; if ((tkk = travel[newloc = loc]) == 0) @@ -383,7 +383,7 @@ l12: /* alternative to probability move */ /* 20 */ static int mback(void) -{ +{ struct travlist *tk2, *j; int ll; if (forced(k = oldloc)) @@ -421,7 +421,7 @@ mback(void) /* 30000 */ static int specials(void) -{ +{ switch (newloc -= 300) { case 1: /* 30100 */ newloc = 99 + 100 - loc; @@ -504,7 +504,7 @@ bug(int n) /* 2600 &c */ void checkhints(void) -{ +{ int hint; for (hint = 4; hint <= hintmax; hint++) { if (hinted[hint]) @@ -571,7 +571,7 @@ trsay(void) /* 9010 */ int trtake(void) -{ +{ if (toting(obj)) return (2011); /* 9010 */ spk = 25; @@ -626,7 +626,7 @@ l9014: if ((obj == bird || obj == cage) && prop[bird] != 0) /* 9021 */ static int dropper(void) -{ +{ k = liq(); if (k == obj) obj = bottle; @@ -774,7 +774,7 @@ tropen(void) /* 9120 */ int trkill(void) -{ +{ int i; for (i = 1; i <= 5; i++) if (dloc[i] == loc && dflag >= 2) @@ -856,7 +856,7 @@ trkill(void) /* 9170: throw */ int trtoss(void) -{ +{ int i; if (toting(rod2) && obj == rod && !toting(rod)) obj = rod2; @@ -918,7 +918,7 @@ trtoss(void) /* 9210 */ int trfeed(void) -{ +{ if (obj == bird) { spk = 100; return (2011); @@ -1000,7 +1000,7 @@ trfill(void) /* 10000 */ void closing(void) -{ +{ int i; prop[grate] = prop[fissure] = 0; @@ -1027,7 +1027,7 @@ closing(void) /* 11000 */ void caveclose(void) -{ +{ int i; prop[bottle] = put(bottle, 115, 1); prop[plant] = put(plant, 115, 0); diff --git a/adventure/vocab.c b/adventure/vocab.c index 1a1b7006..6e1931a5 100644 --- a/adventure/vocab.c +++ b/adventure/vocab.c @@ -1,4 +1,4 @@ -/* $NetBSD: vocab.c,v 1.15 2009/08/25 06:56:52 dholland Exp $ */ +/* $NetBSD: vocab.c,v 1.16 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)vocab.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: vocab.c,v 1.15 2009/08/25 06:56:52 dholland Exp $"); +__RCSID("$NetBSD: vocab.c,v 1.16 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -192,7 +192,7 @@ exitloop2: /* hashed entry does not match */ /* print hash table (for debugging) */ static __unused void prht(void) -{ +{ int i, j, l; char *c; struct hashtab *h; diff --git a/adventure/wizard.c b/adventure/wizard.c index 152915a9..5d83d7c7 100644 --- a/adventure/wizard.c +++ b/adventure/wizard.c @@ -1,4 +1,4 @@ -/* $NetBSD: wizard.c,v 1.16 2012/10/12 15:41:10 dholland Exp $ */ +/* $NetBSD: wizard.c,v 1.17 2021/05/02 12:50:43 rillig Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)wizard.c 8.1 (Berkeley) 6/2/93"; #else -__RCSID("$NetBSD: wizard.c,v 1.16 2012/10/12 15:41:10 dholland Exp $"); +__RCSID("$NetBSD: wizard.c,v 1.17 2021/05/02 12:50:43 rillig Exp $"); #endif #endif /* not lint */ @@ -113,7 +113,7 @@ Start(void) /* not as complex as advent/10 (for now) */ static int wizard(void) -{ +{ char *word, *x; if (!yesm(16, 0, 7)) return (FALSE); |