Module Name:    src
Committed By:   christos
Date:           Wed Mar 16 17:01:40 UTC 2016

Modified Files:
        src/bin/sh: syntax.h

Log Message:
Remove wrong unsigned cast, index can be negative. Cast char to int so that
gcc does not warn. Probably better to do the offset at runtime, but that
would cost more.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/bin/sh/syntax.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/syntax.h
diff -u src/bin/sh/syntax.h:1.4 src/bin/sh/syntax.h:1.5
--- src/bin/sh/syntax.h:1.4	Wed Mar 16 11:48:01 2016
+++ src/bin/sh/syntax.h	Wed Mar 16 13:01:39 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: syntax.h,v 1.4 2016/03/16 15:48:01 christos Exp $	*/
+/*	$NetBSD: syntax.h,v 1.5 2016/03/16 17:01:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -68,7 +68,7 @@
 
 /* These defines assume that the digits are contiguous (which is guaranteed) */
 #define	is_digit(c)	((unsigned)((c) - '0') <= 9)
-#define sh_ctype(c)	(is_type+SYNBASE)[(unsigned char)c]
+#define sh_ctype(c)	(is_type+SYNBASE)[(int)c]
 #define	is_alpha(c)	(sh_ctype(c) & (ISUPPER|ISLOWER))
 #define	is_name(c)	(sh_ctype(c) & (ISUPPER|ISLOWER|ISUNDER))
 #define	is_in_name(c)	(sh_ctype(c) & (ISUPPER|ISLOWER|ISUNDER|ISDIGIT))

Reply via email to