diff options
author | thorpej <thorpej@NetBSD.org> | 1997-03-29 20:42:16 +0000 |
---|---|---|
committer | thorpej <thorpej@NetBSD.org> | 1997-03-29 20:42:16 +0000 |
commit | 77949edf212dfa805753ec2d69e3e91181793816 (patch) | |
tree | 38dc3a79b1e3202a6905ed8ef8bf8c43e510bd44 /monop | |
parent | 784e053db46cac58a3b6f04fab70c712fc6f968b (diff) | |
download | bsdgames-darwin-77949edf212dfa805753ec2d69e3e91181793816.tar.gz bsdgames-darwin-77949edf212dfa805753ec2d69e3e91181793816.tar.zst bsdgames-darwin-77949edf212dfa805753ec2d69e3e91181793816.zip |
Make these compile on the PowerPC (an unsigned char system).
Diffstat (limited to 'monop')
-rw-r--r-- | monop/getinp.c | 12 | ||||
-rw-r--r-- | monop/initdeck.c | 8 | ||||
-rw-r--r-- | monop/misc.c | 10 | ||||
-rw-r--r-- | monop/monop.h | 6 |
4 files changed, 23 insertions, 13 deletions
diff --git a/monop/getinp.c b/monop/getinp.c index b9e5fcc0..5de77f8d 100644 --- a/monop/getinp.c +++ b/monop/getinp.c @@ -1,4 +1,4 @@ -/* $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 @@ -37,7 +37,7 @@ #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 */ @@ -56,17 +56,21 @@ char *prompt, *list[]; { 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++) { diff --git a/monop/initdeck.c b/monop/initdeck.c index c2ff8310..7d79c31c 100644 --- a/monop/initdeck.c +++ b/monop/initdeck.c @@ -1,4 +1,4 @@ -/* $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 @@ -43,7 +43,7 @@ static char copyright[] = #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 */ @@ -130,7 +130,7 @@ count() { reg bool newline; reg DECK *in_deck; - reg char c; + reg int c; newline = TRUE; in_deck = &CC_D; @@ -152,7 +152,7 @@ putem() { reg bool newline; reg DECK *in_deck; - reg char c; + reg int c; reg int num; in_deck = &CC_D; diff --git a/monop/misc.c b/monop/misc.c index 1a71653b..00d301e2 100644 --- a/monop/misc.c +++ b/monop/misc.c @@ -1,4 +1,4 @@ -/* $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 @@ -37,7 +37,7 @@ #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 */ @@ -92,15 +92,17 @@ reg char *prompt; { 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++) diff --git a/monop/monop.h b/monop/monop.h index 2bc82dab..1c7b161d 100644 --- a/monop/monop.h +++ b/monop/monop.h @@ -1,4 +1,4 @@ -/* $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 @@ -40,7 +40,11 @@ # include <string.h> # define reg register +#ifdef __CHAR_UNSIGNED__ +# define shrt short +#else # define shrt char +#endif # define bool char # define unsgn unsigned |