From 687f7852d9a1f3984e2e86d354c9563b5352bbcc Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 4 Jul 1997 21:40:55 +0000 Subject: [PATCH] Make the syntax tables work on machines where characters are unsigned. --- bin/sh/Makefile | 4 ++-- bin/sh/mksyntax.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/sh/Makefile b/bin/sh/Makefile index dba580b80081..cd765426fc5b 100644 --- a/bin/sh/Makefile +++ b/bin/sh/Makefile @@ -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") diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c index 47475b57d023..03446496c29f 100644 --- a/bin/sh/mksyntax.c +++ b/bin/sh/mksyntax.c @@ -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);