summaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>2000-08-29 03:25:49 +0000
committerbillf <billf@FreeBSD.org>2000-08-29 03:25:49 +0000
commit35a095aa83148593ea1eb7910ba4ae3a9f59795d (patch)
tree8af53e46812c6c09ca2ad2e3fceb560dcc3feba8 /games
parentcf47c7da56348133965de1a2351ddbe709a514a0 (diff)
downloadFreeBSD-src-35a095aa83148593ea1eb7910ba4ae3a9f59795d.zip
FreeBSD-src-35a095aa83148593ea1eb7910ba4ae3a9f59795d.tar.gz
BDECFLAGS (with a whitespace change or two)
Diffstat (limited to 'games')
-rw-r--r--games/adventure/hdr.h108
-rw-r--r--games/adventure/init.c6
-rw-r--r--games/adventure/io.c19
-rw-r--r--games/adventure/main.c7
-rw-r--r--games/adventure/setup.c6
-rw-r--r--games/adventure/subr.c2
-rw-r--r--games/adventure/wizard.c3
7 files changed, 77 insertions, 74 deletions
diff --git a/games/adventure/hdr.h b/games/adventure/hdr.h
index d3b1154..7f830cd 100644
--- a/games/adventure/hdr.h
+++ b/games/adventure/hdr.h
@@ -88,7 +88,7 @@ struct hashtab /* hash table for vocabulary */
struct text
#ifdef OLDSTUFF
{ int seekadr; /* DATFILE must be < 2**16 */
-#endif OLDSTUFF
+#endif /* !OLDSTUFF */
{ char *seekadr; /* Msg start in virtual disk */
int txtlen; /* length of msg starting here */
};
@@ -160,59 +160,59 @@ int turns,lmwarn,iwest,knfloc,detail, /* various flags & counters */
int demo,limit;
-int at(int);
-int bug(int);
-void carry(int,int);
-void caveclose(void);
-void checkhints(void);
-void ciao(void);
-void closing(void);
-unsigned long crc(const char *, int);
-void crc_start(void);
-int dark(void);
-void datime(int *, int *);
-char *decr(char,char,char,char,char);
-void die(int);
-void done(int);
-void drop(int,int);
-void dstroy(int);
-int fdwarf(void);
-int forced(int);
-void getin(char **, char **);
-int here(int);
-void init(void);
-void juggle(int);
-int liq(void);
-int liqloc(int);
-int march(void);
-void move(int,int);
-void mspeak(int);
-int pct(int);
-void poof(void);
-void pspeak(int, int);
-int put(int,int,int);
-int ran(int);
-void rdata(void);
-int restore(const char *);
-void rspeak(int);
-int save(const char *);
-int score(void);
-void speak(const struct text *);
-int Start(void);
-void startup(void);
-int toting(int);
-void trapdel(int);
-int trdrop(void);
-int trfeed(void);
-int trfill(void);
-int trkill(void);
-int tropen(void);
-int trsay(void);
-int trtake(void);
-int trtoss(void);
-int vocab(const char *,int,int);
-int yes(int,int,int);
-int yesm(int,int,int);
+int at (int objj);
+int bug (int n);
+void carry (int, int);
+void caveclose (void);
+void checkhints (void);
+void ciao (void);
+void closing (void);
+u_long crc (const char *ptr, int nr);
+void crc_start (void);
+int dark (void);
+void datime (int *d, int *t);
+char *decr (int, int, int, int, int);
+void die (int entry);
+void done (int entry);
+void drop (int object,int where);
+void dstroy (int);
+int fdwarf (void);
+int forced (int locc);
+void getin (char **wrd1, char **wrd2);
+int here (int objj);
+void init (void);
+void juggle (int);
+int liq (void);
+int liqloc (int locc);
+int march (void);
+void move (int, int);
+void mspeak (int);
+int pct (int n);
+void poof (void);
+void pspeak (int m, int skip);
+int put (int, int, int);
+int ran (int range);
+void rdata (void);
+int restore (const char *infile);
+void rspeak (int);
+int save (const char *);
+int score (void);
+void speak (const struct text *);
+int Start (void);
+void startup (void);
+int toting (int objj);
+void trapdel (int sig);
+int trdrop (void);
+int trfeed (void);
+int trfill (void);
+int trkill (void);
+int tropen (void);
+int trsay (void);
+int trtake (void);
+int trtoss (void);
+int vocab (const char *,int,int);
+int yes (int x, int y, int z);
+int yesm (int x, int y, int z);
/* We need to get a little tricky to avoid strings */
#define DECR(a,b,c,d,e) decr('a'+'+','b'+'-','c'+'#','d'+'&','e'+'%')
diff --git a/games/adventure/init.c b/games/adventure/init.c
index a630734..dd9fac0 100644
--- a/games/adventure/init.c
+++ b/games/adventure/init.c
@@ -68,7 +68,7 @@ init() /* everything for 1st time run */
}
char *decr(a,b,c,d,e)
-char a,b,c,d,e;
+const unsigned char a,b,c,d,e;
{
static char buf[6];
@@ -206,7 +206,9 @@ linkdata() /* secondary data manipulation */
void
trapdel(sig) /* come here if he hits a del */
int sig;
-{ delhit = 1; /* main checks, treats as QUIT */
+{
+ sig = 0;
+ delhit = 1; /* main checks, treats as QUIT */
signal(2,trapdel); /* catch subsequent DELs */
}
diff --git a/games/adventure/io.c b/games/adventure/io.c
index 12bf41c..ef76088 100644
--- a/games/adventure/io.c
+++ b/games/adventure/io.c
@@ -116,6 +116,7 @@ yes(x,y,z) /* confirm with rspeak */
int x,y,z;
{ int result;
int ch;
+
result = FALSE;
for (;;)
{ rspeak(x); /* tell him what we want*/
@@ -140,6 +141,7 @@ yesm(x,y,z) /* confirm with mspeak */
int x,y,z;
{ int result;
int ch;
+
result = FALSE;
for (;;)
{ mspeak(x); /* tell him what we want*/
@@ -342,6 +344,7 @@ rtrav() /* read travel table */
char *s;
char buf[12];
int len,m,n,entries;
+
entries = 0;
t = NULL;
for (oldloc= -1;;) /* get another line */
@@ -412,16 +415,16 @@ int loq;
}
}
-#endif DEBUG
+#endif /* DEBUG */
static void
rvoc()
{ char *s; /* read the vocabulary */
- int index;
+ int rv_index;
char buf[6];
for (;;)
- { index=rnum();
- if (index<0) break;
+ { rv_index=rnum();
+ if (rv_index<0) break;
for (s=buf,*s=0;; s++) /* get the word */
if ((*s=next())==TAB || *s=='\n' || *s==LF
|| *s==' ') break;
@@ -429,7 +432,7 @@ rvoc()
if (*s!='\n' && *s!=LF) FLUSHLF; /* can be comments */
*s=0;
/* printf("\"%s\"=%d\n",buf,index);*/
- vocab(buf,-2,index);
+ vocab(buf,-2,rv_index);
}
}
@@ -523,14 +526,14 @@ int m; /* msg is the number of all the p msgs for this place */
int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/
{
char *s,nonfirst;
- char *numst, save;
+ char *numst, ps_save;
struct text *msg;
char *tbuf;
msg = &ptext[m];
if ((tbuf=(char *) malloc(msg->txtlen + 1)) == 0)
errx(1, "Out of memory!");
- memcpy(tbuf, msg->seekadr, msg->txtlen + 1); /* Room to null */
+ memcpy(tbuf, msg->seekadr, (u_int)msg->txtlen + 1); /* Room to null */
s = tbuf;
nonfirst=0;
@@ -538,7 +541,7 @@ int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/
{ tape=iotape; /* restart decryption tape */
for (numst=s; (*s^= *tape++)!=TAB; s++); /* get number */
- save = *s; /* Temporarily trash the string (cringe) */
+ ps_save = *s; /* Temporarily trash the string (cringe) */
*s++ = 0; /* decrypting number within the string */
if (atoi(numst) != 100 * skip && skip >= 0)
diff --git a/games/adventure/main.c b/games/adventure/main.c
index dd15f17..8b21937 100644
--- a/games/adventure/main.c
+++ b/games/adventure/main.c
@@ -53,6 +53,7 @@ static const char rcsid[] =
/* Re-coding of advent in C: main program */
#include <sys/file.h>
+#include <errno.h>
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
@@ -62,9 +63,7 @@ static const char rcsid[] =
int
-main(argc,argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
int i;
int rval,ll;
@@ -546,7 +545,7 @@ char **argv;
rspeak(197);
done(3);
- case 29: /* wake */
+ case 29: /* wake */
if (obj!=dwarf||!closed) goto l2011;
rspeak(199);
done(3);
diff --git a/games/adventure/setup.c b/games/adventure/setup.c
index bb1764c..f68e1c1 100644
--- a/games/adventure/setup.c
+++ b/games/adventure/setup.c
@@ -74,9 +74,7 @@ static const char rcsid[] =
#define LINE 10 /* How many values do we get on a line? */
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char **argv)
{
FILE *infile;
int c, count, linestart;
@@ -89,7 +87,7 @@ char *argv[];
puts(SIG1);
puts(SIG2);
puts(" */");
- printf("\n\nchar data_file[] =\n{");
+ printf("\n\nunsigned char data_file[] =\n{");
srandom(SEED);
count = 0;
linestart = YES;
diff --git a/games/adventure/subr.c b/games/adventure/subr.c
index f8ba0b2..6bbb57e 100644
--- a/games/adventure/subr.c
+++ b/games/adventure/subr.c
@@ -48,7 +48,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <string.h>
-# include "hdr.h"
+#include "hdr.h"
static void badmove (void);
static int bitset (int,int);
diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c
index b8b8b6b..9d39a45 100644
--- a/games/adventure/wizard.c
+++ b/games/adventure/wizard.c
@@ -51,7 +51,8 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <time.h>
-# include "hdr.h"
+#include <sys/cdefs.h>
+#include "hdr.h"
static int wizard (void);
OpenPOWER on IntegriCloud