unsigned on some archs, PowerPC, ROMP.
* will do when you have signed characters; otherwise use
* typedef short int schar;
*/
+#ifdef __CHAR_UNSIGNED__
+typedef short int schar;
+#else
typedef char schar;
+#endif
/*
* small unsigned integers (8 bits suffice - but 7 bits do not)
/* 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()
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 */
#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[];
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[1024];
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[];
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;
}
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++) {
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++)
# include <string.h>
# define reg register
+#ifdef __CHAR_UNSIGNED__
+# define shrt short
+#else
# define shrt char
+#endif
# define bool int8_t
# define unsgn unsigned
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 */