CVS commit: src/usr.bin/ctags

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 20:00:07 UTC 2023

Modified Files:
src/usr.bin/ctags: Makefile ctags.c

Log Message:
ctags: fix pointer-sign issues

Refactor init() to avoid -Wpointer-sign for host builds.
Uses same cast pattern used in ctags.h.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/ctags/Makefile \
src/usr.bin/ctags/ctags.c

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



CVS commit: src/usr.bin/ctags

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 20:00:07 UTC 2023

Modified Files:
src/usr.bin/ctags: Makefile ctags.c

Log Message:
ctags: fix pointer-sign issues

Refactor init() to avoid -Wpointer-sign for host builds.
Uses same cast pattern used in ctags.h.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/ctags/Makefile \
src/usr.bin/ctags/ctags.c

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

Modified files:

Index: src/usr.bin/ctags/Makefile
diff -u src/usr.bin/ctags/Makefile:1.13 src/usr.bin/ctags/Makefile:1.14
--- src/usr.bin/ctags/Makefile:1.13	Fri Aug 10 12:10:27 2012
+++ src/usr.bin/ctags/Makefile	Thu Jul 20 20:00:07 2023
@@ -1,12 +1,8 @@
-#	$NetBSD: Makefile,v 1.13 2012/08/10 12:10:27 joerg Exp $
+#	$NetBSD: Makefile,v 1.14 2023/07/20 20:00:07 lukem Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 PROG=	ctags
 CPPFLAGS+=-I${.CURDIR}
 SRCS=	C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c
 
-.if !defined(HOSTPROGNAME)
-COPTS.ctags.c+=	-Wno-pointer-sign
-.endif
-
 .include 
Index: src/usr.bin/ctags/ctags.c
diff -u src/usr.bin/ctags/ctags.c:1.13 src/usr.bin/ctags/ctags.c:1.14
--- src/usr.bin/ctags/ctags.c:1.13	Sun Feb  3 03:19:29 2019
+++ src/usr.bin/ctags/ctags.c	Thu Jul 20 20:00:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctags.c,v 1.13 2019/02/03 03:19:29 mrg Exp $	*/
+/*	$NetBSD: ctags.c,v 1.14 2023/07/20 20:00:07 lukem Exp $	*/
 
 /*
  * Copyright (c) 1987, 1993, 1994, 1995
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 19
 #if 0
 static char sccsid[] = "@(#)ctags.c	8.4 (Berkeley) 2/7/95";
 #endif
-__RCSID("$NetBSD: ctags.c,v 1.13 2019/02/03 03:19:29 mrg Exp $");
+__RCSID("$NetBSD: ctags.c,v 1.14 2023/07/20 20:00:07 lukem Exp $");
 #endif /* not lint */
 
 #include 
@@ -194,7 +194,7 @@ void
 init(void)
 {
 	int		i;
-	unsigned const char	*sp;
+	const char	*sp;
 
 	for (i = 0; i < 256; i++) {
 		_wht[i] = _etk[i] = _itk[i] = _btk[i] = NO;
@@ -202,19 +202,19 @@ init(void)
 	}
 #define	CWHITE	" \f\t\n"
 	for (sp = CWHITE; *sp; sp++)	/* white space chars */
-		_wht[*sp] = YES;
+		_wht[(unsigned)*sp] = YES;
 #define	CTOKEN	" \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?"
 	for (sp = CTOKEN; *sp; sp++)	/* token ending chars */
-		_etk[*sp] = YES;
+		_etk[(unsigned)*sp] = YES;
 #define	CINTOK	"ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz0123456789"
 	for (sp = CINTOK; *sp; sp++)	/* valid in-token chars */
-		_itk[*sp] = YES;
+		_itk[(unsigned)*sp] = YES;
 #define	CBEGIN	"ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
 	for (sp = CBEGIN; *sp; sp++)	/* token starting chars */
-		_btk[*sp] = YES;
+		_btk[(unsigned)*sp] = YES;
 #define	CNOTGD	",;"
 	for (sp = CNOTGD; *sp; sp++)	/* invalid after-function chars */
-		_gd[*sp] = NO;
+		_gd[(unsigned)*sp] = NO;
 }
 
 /*