/*
* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985.
*
- * $NetBSD: config.h,v 1.3 1995/03/23 08:29:15 cgd Exp $
+ * $NetBSD: config.h,v 1.4 1997/03/29 20:42:16 thorpej Exp $
*/
#include "pathnames.h"
* will do when you have signed characters; otherwise use
* typedef short int schar;
*/
-typedef char schar;
+#ifdef __CHAR_UNSIGNED__
+typedef short int schar;
+#else
+typedef char schar;
+#endif
/*
* small unsigned integers (8 bits suffice - but 7 bits do not)
#ifndef lint
-static char rcsid[] = "$NetBSD: create.c,v 1.3 1995/03/23 08:33:14 cgd Exp $";
+static char rcsid[] = "$NetBSD: create.c,v 1.4 1997/03/29 20:42:17 thorpej Exp $";
#endif /* not lint */
/* create.c Larn is copyrighted 1986 by Noah Morgan. */
#include "header.h"
extern char spelknow[],larnlevels[];
-extern char beenhere[],wizard,level;
+extern char beenhere[],wizard;
+extern short level;
extern short oldx,oldy;
/*
makeplayer()
-/* $NetBSD: data.c,v 1.5 1995/03/23 08:33:17 cgd Exp $ */
+/* $NetBSD: data.c,v 1.6 1997/03/29 20:42:18 thorpej Exp $ */
/*-
* Copyright (c) 1988 The Regents of the University of California.
#if 0
static char sccsid[] = "@(#)data.c 5.3 (Berkeley) 5/13/91";
#else
-static char rcsid[] = "$NetBSD: data.c,v 1.5 1995/03/23 08:33:17 cgd Exp $";
+static char rcsid[] = "$NetBSD: data.c,v 1.6 1997/03/29 20:42:18 thorpej Exp $";
#endif
#endif /* not lint */
/* data.c Larn is copyrighted 1986 by Noah Morgan. */
-#define NODEFS
+/* #define NODEFS */
#include "header.h"
/*
char boldon=1; /* 1=bold objects 0=inverse objects */
char ckpflag=0; /* 1 if want checkpointing of game, 0 otherwise */
char cheat=0; /* 1 if the player has fudged save file */
-char level=0; /* cavelevel player is on = c[CAVELEVEL] */
+short level=0; /* cavelevel player is on = c[CAVELEVEL] */
char wizard=0; /* the wizard mode flag */
short lastnum=0; /* the number of the monster last hitting player */
short hitflag=0; /* flag for if player has been hit when running */
#ifndef lint
-static char rcsid[] = "$NetBSD: global.c,v 1.4 1995/04/24 12:23:52 cgd Exp $";
+static char rcsid[] = "$NetBSD: global.c,v 1.5 1997/03/29 20:42:19 thorpej Exp $";
#endif /* not lint */
/* global.c Larn is copyrighted 1986 by Noah Morgan.
#include <string.h>
extern int score[],srcount,dropflag;
extern int random;/* the random number seed */
-extern short playerx,playery,lastnum;
-extern char cheat,level,monstnamelist[];
+extern short playerx,playery,lastnum,level;
+extern char cheat,monstnamelist[];
extern char lastmonst[],*what[],*who[];
extern char winner[];
extern char logname[],monstlevel[];
-/* $NetBSD: header.h,v 1.8 1996/05/22 00:36:04 mrg Exp $ */
+/* $NetBSD: header.h,v 1.9 1997/03/29 20:42:20 thorpej Exp $ */
/* header.h Larn is copyrighted 1986 by Noah Morgan. */
struct sphere *p; /* pointer to next structure */
char x,y,lev; /* location of the sphere */
char dir; /* direction sphere is going in */
- char lifetime; /* duration of the sphere */
+ short lifetime; /* duration of the sphere */
};
/* defines for the character attribute array c[] */
extern char *class[],course[],diagfile[],helpfile[];
extern char *inbuffer,is_alpha[],is_digit[];
extern char item[MAXX][MAXY],iven[],know[MAXX][MAXY],larnlevels[],lastmonst[];
-extern char level,*levelname[],logfile[],loginname[],logname[],*lpbuf,*lpend;
+extern char *levelname[],logfile[],loginname[],logname[],*lpbuf,*lpend;
extern char *lpnt,moved[MAXX][MAXY],mitem[MAXX][MAXY],monstlevel[];
extern char monstnamelist[],nch[],ndgg[],nlpts[],nomove,nosignal,nowelcome;
extern char nplt[],nsw[],*objectname[],objnamelist[],optsfile[];
extern char splev[],stealth[MAXX][MAXY],to_lower[],to_upper[],wizard;
extern short diroffx[],diroffy[],hitflag,hit2flag,hit3flag,hitp[MAXX][MAXY];
extern short iarg[MAXX][MAXY],ivenarg[],lasthx,lasthy,lastnum,lastpx,lastpy;
-extern short nobeep,oldx,oldy,playerx,playery;
+extern short nobeep,oldx,oldy,playerx,playery,level;
extern int dayplay,enable_scroll,srcount,yrepcount,userid,wisid,lfd,fd;
extern uid_t uid, euid;
extern long initialtime,outstanding_taxes,skill[],gtime,c[],cbak[];
-/* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */
+/* $NetBSD: move.c,v 1.5 1997/03/29 20:42:21 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $";
+static char rcsid[] = "$NetBSD: move.c,v 1.5 1997/03/29 20:42:21 thorpej Exp $";
#endif
#endif /* not lint */
if (pp == &Player[PLAYER])
account(card);
pp->hand[Card_no] = C_INIT;
- Next = (Next == -1 ? FALSE : TRUE);
+ Next = (Next == (bool)-1 ? FALSE : TRUE);
return TRUE;
}
-/* $NetBSD: getinp.c,v 1.4 1995/04/24 12:24:20 cgd Exp $ */
+/* $NetBSD: getinp.c,v 1.5 1997/03/29 20:42:22 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: getinp.c,v 1.4 1995/04/24 12:24:20 cgd Exp $";
+static char rcsid[] = "$NetBSD: getinp.c,v 1.5 1997/03/29 20:42:22 thorpej Exp $";
#endif
#endif /* not lint */
reg int i, n_match, match;
char *sp;
+ int c;
int plen;
static int comp();
for (;;) {
inter:
printf(prompt);
- for (sp = buf; (*sp=getchar()) != '\n'; )
- if (*sp == -1) /* check for interupted system call */
+ for (sp = buf; (c=getchar()) != '\n'; ) {
+ *sp = c;
+ if (c == -1) /* check for interupted system call */
goto inter;
else if (sp != buf || *sp != ' ')
sp++;
+ }
+ *sp = c;
if (buf[0] == '?' && buf[1] == '\n') {
printf("Valid inputs are: ");
for (i = 0, match = 18; list[i]; i++) {
-/* $NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $ */
+/* $NetBSD: initdeck.c,v 1.4 1997/03/29 20:42:23 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)initdeck.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $";
+static char rcsid[] = "$NetBSD: initdeck.c,v 1.4 1997/03/29 20:42:23 thorpej Exp $";
#endif
#endif /* not lint */
reg bool newline;
reg DECK *in_deck;
- reg char c;
+ reg int c;
newline = TRUE;
in_deck = &CC_D;
reg bool newline;
reg DECK *in_deck;
- reg char c;
+ reg int c;
reg int num;
in_deck = &CC_D;
-/* $NetBSD: misc.c,v 1.4 1995/03/23 08:34:47 cgd Exp $ */
+/* $NetBSD: misc.c,v 1.5 1997/03/29 20:42:24 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: misc.c,v 1.4 1995/03/23 08:34:47 cgd Exp $";
+static char rcsid[] = "$NetBSD: misc.c,v 1.5 1997/03/29 20:42:24 thorpej Exp $";
#endif
#endif /* not lint */
reg int num;
reg char *sp;
+ int c;
char buf[257];
for (;;) {
inter:
printf(prompt);
num = 0;
- for (sp = buf; (*sp=getchar()) != '\n'; sp++)
- if (*sp == -1) /* check for interrupted system call */
+ for (sp = buf; (c=getchar()) != '\n'; *sp++ = c)
+ if (c == -1) /* check for interrupted system call */
goto inter;
+ *sp = c;
if (sp == buf)
continue;
for (sp = buf; isspace(*sp); sp++)
-/* $NetBSD: monop.h,v 1.4 1995/04/24 12:24:23 cgd Exp $ */
+/* $NetBSD: monop.h,v 1.5 1997/03/29 20:42:25 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
# include <string.h>
# define reg register
+#ifdef __CHAR_UNSIGNED__
+# define shrt short
+#else
# define shrt char
+#endif
# define bool char
# define unsgn unsigned
-/* $NetBSD: trek.h,v 1.3 1995/04/22 10:59:36 cgd Exp $ */
+/* $NetBSD: trek.h,v 1.4 1997/03/29 20:42:26 thorpej Exp $ */
/*
* Copyright (c) 1980, 1993
char klings; /* number of Klingons in this quadrant */
char holes; /* number of black holes in this quadrant */
int scanned; /* star chart entry (see below) */
- char stars; /* number of stars in this quadrant */
+ short stars; /* number of stars in this quadrant */
char qsystemname; /* starsystem name (see below) */
};
struct
{
struct kling klingon[MAXKLQUAD]; /* sorted Klingon list */
- char nkling; /* number of Klingons in this sector */
+ short nkling; /* number of Klingons in this sector */
/* < 0 means automatic override mode */
char fast; /* set if speed > 300 baud */
struct xy starbase; /* starbase in current quadrant */