Make the syntax tables work on machines where characters are unsigned.

This commit is contained in:
christos 1997-07-04 21:40:55 +00:00
parent abc99479ba
commit 687f7852d9
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.32 1997/07/04 21:00:36 christos Exp $
# $NetBSD: Makefile,v 1.33 1997/07/04 21:40:55 christos Exp $
# @(#)Makefile 8.4 (Berkeley) 5/5/95
WARNS= 1
@ -15,7 +15,7 @@ DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
LFLAGS= -8 # 8-bit lex scanner for arithmetic
CFLAGS+=-DSHELL -I. -I${.CURDIR} -g
CFLAGS+=-DSHELL -I. -I${.CURDIR}
# XXX
.if (${MACHINE_ARCH} == "powerpc")

View File

@ -1,4 +1,4 @@
/* $NetBSD: mksyntax.c,v 1.13 1997/07/04 21:02:14 christos Exp $ */
/* $NetBSD: mksyntax.c,v 1.14 1997/07/04 21:40:56 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
#if 0
static char sccsid[] = "@(#)mksyntax.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: mksyntax.c,v 1.13 1997/07/04 21:02:14 christos Exp $");
__RCSID("$NetBSD: mksyntax.c,v 1.14 1997/07/04 21:40:56 christos Exp $");
#endif
#endif /* not lint */
@ -147,7 +147,7 @@ main(argc, argv)
/* Determine the characteristics of chars. */
c = -1;
if (c < 0)
if (c <= 0)
sign = 1;
else
sign = 0;
@ -193,8 +193,8 @@ main(argc, argv)
fprintf(hfile, "/* %s */\n", is_entry[i].comment);
}
putc('\n', hfile);
fprintf(hfile, "#define SYNBASE %d\n", base);
fprintf(hfile, "#define PEOF %d\n\n", -base);
fprintf(hfile, "#define SYNBASE ((unsigned char) %d)\n", base);
fprintf(hfile, "#define PEOF ((unsigned char) %d)\n\n", -base);
putc('\n', hfile);
fputs("#define BASESYNTAX (basesyntax + SYNBASE)\n", hfile);
fputs("#define DQSYNTAX (dqsyntax + SYNBASE)\n", hfile);