CVS commit: src

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec 16 03:53:13 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: improve error message for missing newline in .ln file


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint2/t_lint2.sh
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint2/read.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh
diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.11 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.12
--- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.11	Thu Dec 16 03:44:48 2021
+++ src/tests/usr.bin/xlint/lint2/t_lint2.sh	Thu Dec 16 03:53:13 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.11 2021/12/16 03:44:48 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.12 2021/12/16 03:53:13 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -182,12 +182,14 @@ missing_newline_head()
 
 missing_newline_body()
 {
+	# Before read.c 1.71 from 2021-12-16, the error message was just 'c'
+	# without any textual description or context, and the line number was
+	# off by one, it was reported as line 0.
+
 	printf '1d1.1e5func' > 'input.ln'
 
-	# FIXME: The error message is not understandable.
-	# FIXME: The line number is off by one.
 	atf_check -s 'exit:1' \
-	-e 'match:^.*: error: input\.ln:0: c \(for .1d1\.1e5func.\)$' \
+	-e 'match:^.*: error: input\.ln:1: missing newline after .c. \(for .1d1\.1e5func.\)$' \
 	"$lint2" 'input.ln'
 }
 

Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.71 src/usr.bin/xlint/lint2/read.c:1.72
--- src/usr.bin/xlint/lint2/read.c:1.71	Sun Nov 28 09:16:46 2021
+++ src/usr.bin/xlint/lint2/read.c	Thu Dec 16 03:53:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.71 2021/11/28 09:16:46 rillig Exp $ */
+/* $NetBSD: read.c,v 1.72 2021/12/16 03:53:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.71 2021/11/28 09:16:46 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.72 2021/12/16 03:53:13 rillig Exp $");
 #endif
 
 #include 
@@ -147,8 +147,6 @@ read_ln_line(const char *line, size_t le
 	char rt;
 	pos_t pos;
 
-	flines[srcfile]++;
-
 	cp = line;
 
 	/* line number in csrcfile */
@@ -229,9 +227,11 @@ readfile(const char *name)
 		err(1, "cannot open %s", name);
 
 	while ((line = fgetln(inp, )) != NULL) {
+		flines[srcfile]++;
+
 		readfile_line = line;
 		if (len == 0 || line[len - 1] != '\n')
-			inperr("%s", [len - 1]);
+			inperr("missing newline after '%s'", [len - 1]);
 		line[len - 1] = '\0';
 
 		read_ln_line(line, len);



CVS commit: src

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec 16 03:53:13 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh
src/usr.bin/xlint/lint2: read.c

Log Message:
lint: improve error message for missing newline in .ln file


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint2/t_lint2.sh
cvs rdiff -u -r1.71 -r1.72 src/usr.bin/xlint/lint2/read.c

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



CVS commit: src/tests/usr.bin/xlint/lint2

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec 16 03:44:48 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh

Log Message:
tests/lint: demonstrate bad error message on missing newline


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint2/t_lint2.sh

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

Modified files:

Index: src/tests/usr.bin/xlint/lint2/t_lint2.sh
diff -u src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.10 src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.11
--- src/tests/usr.bin/xlint/lint2/t_lint2.sh:1.10	Sun Nov 28 09:16:46 2021
+++ src/tests/usr.bin/xlint/lint2/t_lint2.sh	Thu Dec 16 03:44:48 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_lint2.sh,v 1.10 2021/11/28 09:16:46 rillig Exp $
+# $NetBSD: t_lint2.sh,v 1.11 2021/12/16 03:44:48 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -175,6 +175,22 @@ error_cases_body()
 	test_error_ignored '0u0.0x3var_'
 }
 
+missing_newline_head()
+{
+	std_head
+}
+
+missing_newline_body()
+{
+	printf '1d1.1e5func' > 'input.ln'
+
+	# FIXME: The error message is not understandable.
+	# FIXME: The line number is off by one.
+	atf_check -s 'exit:1' \
+	-e 'match:^.*: error: input\.ln:0: c \(for .1d1\.1e5func.\)$' \
+	"$lint2" 'input.ln'
+}
+
 atf_init_test_cases()
 {
 	local i
@@ -200,4 +216,5 @@ atf_init_test_cases()
 	done
 
 	atf_add_test_case 'error_cases'
+	atf_add_test_case 'missing_newline'
 }



CVS commit: src/tests/usr.bin/xlint/lint2

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Dec 16 03:44:48 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint2: t_lint2.sh

Log Message:
tests/lint: demonstrate bad error message on missing newline


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint2/t_lint2.sh

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



CVS commit: src/sys/fs/udf

2021-12-15 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Dec 15 22:02:30 UTC 2021

Modified Files:
src/sys/fs/udf: udf_subr.c

Log Message:
While searching the VAT on recordable media, search the last sector too!
This fixes Win10 formatted discs from being mounted incorrectly.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/fs/udf/udf_subr.c

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

Modified files:

Index: src/sys/fs/udf/udf_subr.c
diff -u src/sys/fs/udf/udf_subr.c:1.159 src/sys/fs/udf/udf_subr.c:1.160
--- src/sys/fs/udf/udf_subr.c:1.159	Sun Dec  5 04:21:31 2021
+++ src/sys/fs/udf/udf_subr.c	Wed Dec 15 22:02:30 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: udf_subr.c,v 1.159 2021/12/05 04:21:31 msaitoh Exp $ */
+/* $NetBSD: udf_subr.c,v 1.160 2021/12/15 22:02:30 reinoud Exp $ */
 
 /*
  * Copyright (c) 2006, 2008 Reinoud Zandijk
@@ -29,7 +29,7 @@
 
 #include 
 #ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.159 2021/12/05 04:21:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.160 2021/12/15 22:02:30 reinoud Exp $");
 #endif /* not lint */
 
 
@@ -3102,7 +3102,7 @@ udf_search_vat(struct udf_mount *ump, un
 			if (vat_node)
 vput(vat_node->vnode);
 			vat_loc++;	/* walk forward */
-		} while (vat_loc < late_vat_loc);
+		} while (vat_loc <= late_vat_loc);
 		if (accepted_vat_node)
 			break;
 



CVS commit: src/sys/fs/udf

2021-12-15 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Dec 15 22:02:30 UTC 2021

Modified Files:
src/sys/fs/udf: udf_subr.c

Log Message:
While searching the VAT on recordable media, search the last sector too!
This fixes Win10 formatted discs from being mounted incorrectly.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/fs/udf/udf_subr.c

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



CVS commit: src/lib/libterminfo

2021-12-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Dec 15 21:07:12 UTC 2021

Modified Files:
src/lib/libterminfo: tputs.c

Log Message:
Fix for PR lib/56298

Remove the DIAGASSERT for str being NULL in the puts/putp functions,
add protection so that the functions just return OK if str is NULL.
This prevents the assert firing when libcurses passes through a NULL
due to an undefined terminfo entry.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/tputs.c

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



CVS commit: src/lib/libterminfo

2021-12-15 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Dec 15 21:07:12 UTC 2021

Modified Files:
src/lib/libterminfo: tputs.c

Log Message:
Fix for PR lib/56298

Remove the DIAGASSERT for str being NULL in the puts/putp functions,
add protection so that the functions just return OK if str is NULL.
This prevents the assert firing when libcurses passes through a NULL
due to an undefined terminfo entry.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libterminfo/tputs.c

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

Modified files:

Index: src/lib/libterminfo/tputs.c
diff -u src/lib/libterminfo/tputs.c:1.5 src/lib/libterminfo/tputs.c:1.6
--- src/lib/libterminfo/tputs.c:1.5	Thu Oct  3 18:02:05 2019
+++ src/lib/libterminfo/tputs.c	Wed Dec 15 21:07:12 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tputs.c,v 1.5 2019/10/03 18:02:05 christos Exp $ */
+/* $NetBSD: tputs.c,v 1.6 2021/12/15 21:07:12 blymn Exp $ */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: tputs.c,v 1.5 2019/10/03 18:02:05 christos Exp $");
+__RCSID("$NetBSD: tputs.c,v 1.6 2021/12/15 21:07:12 blymn Exp $");
 
 #include 
 #include 
@@ -135,9 +135,11 @@ ti_puts(const TERMINAL *term, const char
 	char pc;
 
 	_DIAGASSERT(term != NULL);
-	_DIAGASSERT(str != NULL);
 	_DIAGASSERT(outc != NULL);
 
+	if (str == NULL)
+		return OK;
+
 	dodelay = (str == t_bell(term) ||
 	str == t_flash_screen(term) ||
 	(t_xon_xoff(term) == 0 && t_padding_baud_rate(term) != 0));
@@ -155,7 +157,6 @@ ti_putp(const TERMINAL *term, const char
 {
 
 	_DIAGASSERT(term != NULL);
-	_DIAGASSERT(str != NULL);
 	return ti_puts(term, str, 1,
 	(int (*)(int, void *))(void *)putchar, NULL);
 }
@@ -164,7 +165,6 @@ int
 tputs(const char *str, int affcnt, int (*outc)(int))
 {
 
-	_DIAGASSERT(str != NULL);
 	_DIAGASSERT(outc != NULL);
 	return _ti_puts(1, ospeed, PC, str, affcnt,
 	(int (*)(int, void *))(void *)outc, NULL);
@@ -174,6 +174,5 @@ int
 putp(const char *str)
 {
 
-	_DIAGASSERT(str != NULL);
 	return tputs(str, 1, putchar);
 }



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 16:27:10 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver

Log Message:
Grr: need NOLINT=yes for the Makefiles that include Makefile.xf86-driver
early, and MKLINT:=no for the ones that include it late. Should fix that.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile.xf86-driver
diff -u src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.31 src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.32
--- src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.31	Wed Dec 15 10:45:26 2021
+++ src/external/mit/xorg/server/drivers/Makefile.xf86-driver	Wed Dec 15 11:27:10 2021
@@ -1,11 +1,12 @@
-#	$NetBSD: Makefile.xf86-driver,v 1.31 2021/12/15 15:45:26 christos Exp $
+#	$NetBSD: Makefile.xf86-driver,v 1.32 2021/12/15 16:27:10 christos Exp $
 
 LIBISMODULE=	yes
 SHLIB_MAJOR=	${PACKAGE_MAJOR}
 
 NOFULLRELRO=	yes
 LINTFLAGS+=-D__GNUC__
-NOLINT=yes	# XXX: lint2 is broken for most of them
+MKLINT:= no	# XXX: lint2 is broken for most of them
+NOLINT=yes
 
 .include 
 .include 



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 16:27:10 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver

Log Message:
Grr: need NOLINT=yes for the Makefiles that include Makefile.xf86-driver
early, and MKLINT:=no for the ones that include it late. Should fix that.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver

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



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:45:26 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver

Log Message:
Lint2 is broken, so disable lint for now.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile.xf86-driver
diff -u src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.30 src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.31
--- src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.30	Wed Dec 15 10:27:30 2021
+++ src/external/mit/xorg/server/drivers/Makefile.xf86-driver	Wed Dec 15 10:45:26 2021
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile.xf86-driver,v 1.30 2021/12/15 15:27:30 christos Exp $
+#	$NetBSD: Makefile.xf86-driver,v 1.31 2021/12/15 15:45:26 christos Exp $
 
 LIBISMODULE=	yes
 SHLIB_MAJOR=	${PACKAGE_MAJOR}
 
 NOFULLRELRO=	yes
 LINTFLAGS+=-D__GNUC__
+NOLINT=yes	# XXX: lint2 is broken for most of them
 
 .include 
 .include 



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:45:26 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver

Log Message:
Lint2 is broken, so disable lint for now.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver

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



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:27:30 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver
src/external/mit/xorg/server/drivers/xf86-input-keyboard: Makefile

Log Message:
Add -D__GNUC__ for all drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver
cvs rdiff -u -r1.21 -r1.22 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/Makefile.xf86-driver
diff -u src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.29 src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.30
--- src/external/mit/xorg/server/drivers/Makefile.xf86-driver:1.29	Mon Nov  1 06:05:18 2021
+++ src/external/mit/xorg/server/drivers/Makefile.xf86-driver	Wed Dec 15 10:27:30 2021
@@ -1,9 +1,10 @@
-#	$NetBSD: Makefile.xf86-driver,v 1.29 2021/11/01 10:05:18 nia Exp $
+#	$NetBSD: Makefile.xf86-driver,v 1.30 2021/12/15 15:27:30 christos Exp $
 
 LIBISMODULE=	yes
 SHLIB_MAJOR=	${PACKAGE_MAJOR}
 
 NOFULLRELRO=	yes
+LINTFLAGS+=-D__GNUC__
 
 .include 
 .include 

Index: src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.21 src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.22
--- src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.21	Wed Dec 15 10:24:11 2021
+++ src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile	Wed Dec 15 10:27:30 2021
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.21 2021/12/15 15:24:11 christos Exp $
+#	$NetBSD: Makefile,v 1.22 2021/12/15 15:27:30 christos Exp $
 
 DRIVER=		xf86-input-keyboard
 DRIVER_NAME=	kbd_drv
 
 SRCS=		kbd.c bsd_KbdMap.c bsd_kbd.c at_scancode.c
 MAN=		kbd.4
-LINTFLAGS+=	-D__GNUC__
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "cats"
 CPPFLAGS+=	-DPCVT_SUPPORT



CVS commit: src/external/mit/xorg/server/drivers

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:27:30 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers: Makefile.xf86-driver
src/external/mit/xorg/server/drivers/xf86-input-keyboard: Makefile

Log Message:
Add -D__GNUC__ for all drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/mit/xorg/server/drivers/Makefile.xf86-driver
cvs rdiff -u -r1.21 -r1.22 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile

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



CVS commit: src/external/mit/xorg/server/drivers/xf86-input-keyboard

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:24:11 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers/xf86-input-keyboard: Makefile

Log Message:
Add -D__GNUC__ for lint


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile

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



CVS commit: src/external/mit/xorg/server/drivers/xf86-input-keyboard

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:24:11 UTC 2021

Modified Files:
src/external/mit/xorg/server/drivers/xf86-input-keyboard: Makefile

Log Message:
Add -D__GNUC__ for lint


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 \
src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile

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

Modified files:

Index: src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile
diff -u src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.20 src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.21
--- src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile:1.20	Mon Dec  6 12:51:59 2021
+++ src/external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile	Wed Dec 15 10:24:11 2021
@@ -1,10 +1,11 @@
-#	$NetBSD: Makefile,v 1.20 2021/12/06 17:51:59 abs Exp $
+#	$NetBSD: Makefile,v 1.21 2021/12/15 15:24:11 christos Exp $
 
 DRIVER=		xf86-input-keyboard
 DRIVER_NAME=	kbd_drv
 
 SRCS=		kbd.c bsd_KbdMap.c bsd_kbd.c at_scancode.c
 MAN=		kbd.4
+LINTFLAGS+=	-D__GNUC__
 
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || ${MACHINE} == "cats"
 CPPFLAGS+=	-DPCVT_SUPPORT



CVS commit: src/usr.bin/xlint/lint1

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:20:51 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: cgram.y lex.c

Log Message:
Add more attributes


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/lex.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/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.373 src/usr.bin/xlint/lint1/cgram.y:1.374
--- src/usr.bin/xlint/lint1/cgram.y:1.373	Tue Dec 14 15:13:13 2021
+++ src/usr.bin/xlint/lint1/cgram.y	Wed Dec 15 10:20:51 2021
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.373 2021/12/14 20:13:13 christos Exp $ */
+/* $NetBSD: cgram.y,v 1.374 2021/12/15 15:20:51 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.y,v 1.373 2021/12/14 20:13:13 christos Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.374 2021/12/15 15:20:51 christos Exp $");
 #endif
 
 #include 
@@ -226,6 +226,7 @@ anonymize(sym_t *s)
 %token			T_AT_CONSTRUCTOR
 %token			T_AT_DEPRECATED
 %token			T_AT_DESTRUCTOR
+%token			T_AT_DISABLE_SANITIZER_INSTRUMENTATION
 %token			T_AT_FALLTHROUGH
 %token			T_AT_FORMAT
 %token			T_AT_FORMAT_ARG
@@ -241,6 +242,8 @@ anonymize(sym_t *s)
 %token			T_AT_MAY_ALIAS
 %token			T_AT_MINBYTES
 %token			T_AT_MODE
+%token			T_AT_NO_SANITIZE
+%token			T_AT_NO_SANITIZE_THREAD
 %token			T_AT_NOINLINE
 %token			T_AT_NONNULL
 %token			T_AT_NONSTRING
@@ -2075,6 +2078,7 @@ gcc_attribute_spec:
 	| T_AT_DEPRECATED
 	| T_AT_DESTRUCTOR T_LPAREN constant_expr T_RPAREN
 	| T_AT_DESTRUCTOR
+	| T_AT_DISABLE_SANITIZER_INSTRUMENTATION
 	| T_AT_FALLTHROUGH {
 		fallthru(1);
 	  }
@@ -2086,6 +2090,8 @@ gcc_attribute_spec:
 	| T_AT_MALLOC
 	| T_AT_MAY_ALIAS
 	| T_AT_MODE T_LPAREN T_NAME T_RPAREN
+	| T_AT_NO_SANITIZE T_LPAREN T_NAME T_RPAREN
+	| T_AT_NO_SANITIZE_THREAD
 	| T_AT_NOINLINE
 	| T_AT_NONNULL T_LPAREN constant_expr_list_opt T_RPAREN
 	| T_AT_NONNULL

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.89 src/usr.bin/xlint/lint1/lex.c:1.90
--- src/usr.bin/xlint/lint1/lex.c:1.89	Tue Dec 14 15:13:13 2021
+++ src/usr.bin/xlint/lint1/lex.c	Wed Dec 15 10:20:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.89 2021/12/14 20:13:13 christos Exp $ */
+/* $NetBSD: lex.c,v 1.90 2021/12/15 15:20:51 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.89 2021/12/14 20:13:13 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.90 2021/12/15 15:20:51 christos Exp $");
 #endif
 
 #include 
@@ -160,6 +160,8 @@ static	struct	kwtab {
 	kwdef_keyword(	"default",	T_DEFAULT),
 	kwdef_gcc_attr(	"deprecated",	T_AT_DEPRECATED),
 	kwdef_gcc_attr(	"destructor",	T_AT_DESTRUCTOR),
+	kwdef_gcc_attr(	"disable_sanitizer_instrumentation",
+	T_AT_DISABLE_SANITIZER_INSTRUMENTATION),
 	kwdef_keyword(	"do",		T_DO),
 	kwdef_type(	"double",	DOUBLE,			0,0,0,0,1),
 	kwdef_keyword(	"else",		T_ELSE),
@@ -190,6 +192,8 @@ static	struct	kwtab {
 	kwdef_gcc_attr(	"mode",		T_AT_MODE),
 	kwdef_gcc_attr("no_instrument_function",
 	T_AT_NO_INSTRUMENT_FUNCTION),
+	kwdef_gcc_attr(	"no_sanitize",	T_AT_NO_SANITIZE),
+	kwdef_gcc_attr(	"no_sanitize_thread",	T_AT_NO_SANITIZE_THREAD),
 	kwdef_gcc_attr(	"noinline",	T_AT_NOINLINE),
 	kwdef_gcc_attr(	"nonnull",	T_AT_NONNULL),
 	kwdef_gcc_attr(	"nonstring",	T_AT_NONSTRING),



CVS commit: src/usr.bin/xlint/lint1

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 15:20:51 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: cgram.y lex.c

Log Message:
Add more attributes


To generate a diff of this commit:
cvs rdiff -u -r1.373 -r1.374 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/lex.c

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



CVS commit: src/external/gpl3/gcc/dist/libiberty

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:29:14 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libiberty: cp-demangle.c

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.12 -r1.2 \
src/external/gpl3/gcc/dist/libiberty/cp-demangle.c

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

Modified files:

Index: src/external/gpl3/gcc/dist/libiberty/cp-demangle.c
diff -u src/external/gpl3/gcc/dist/libiberty/cp-demangle.c:1.1.1.12 src/external/gpl3/gcc/dist/libiberty/cp-demangle.c:1.2
--- src/external/gpl3/gcc/dist/libiberty/cp-demangle.c:1.1.1.12	Sat Apr 10 18:10:14 2021
+++ src/external/gpl3/gcc/dist/libiberty/cp-demangle.c	Wed Dec 15 08:29:14 2021
@@ -119,7 +119,7 @@
 # include 
 #else
 # ifndef alloca
-#  ifdef __GNUC__
+#  if defined(__GNUC__) || defined(__lint__)
 #   define alloca __builtin_alloca
 #  else
 extern char *alloca ();



CVS commit: src/external/gpl3/gcc/dist/libiberty

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:29:14 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libiberty: cp-demangle.c

Log Message:
fix lint


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.12 -r1.2 \
src/external/gpl3/gcc/dist/libiberty/cp-demangle.c

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



CVS commit: src/external/gpl3/gcc/usr.bin

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:28:29 UTC 2021

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.inc

Log Message:
no lint (c++)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/external/gpl3/gcc/usr.bin/Makefile.inc

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/Makefile.inc
diff -u src/external/gpl3/gcc/usr.bin/Makefile.inc:1.33 src/external/gpl3/gcc/usr.bin/Makefile.inc:1.34
--- src/external/gpl3/gcc/usr.bin/Makefile.inc:1.33	Sun Apr 11 20:05:56 2021
+++ src/external/gpl3/gcc/usr.bin/Makefile.inc	Wed Dec 15 08:28:29 2021
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile.inc,v 1.33 2021/04/12 00:05:56 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.34 2021/12/15 13:28:29 christos Exp $
 
 .ifndef _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_
 _EXTERNAL_GPL3_GCC_USR_BIN_MAKEFILE_INC_=1
 
+NOLINT=yes
 NOCTF=	# defined
 .include 
 



CVS commit: src/external/gpl3/gcc/usr.bin

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:28:29 UTC 2021

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.inc

Log Message:
no lint (c++)


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/external/gpl3/gcc/usr.bin/Makefile.inc

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



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:22:34 UTC 2021

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile

Log Message:
-W === -Wextra


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x68k/stand/boot_ufs/Makefile

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

Modified files:

Index: src/sys/arch/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.37 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.38
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.37	Wed Dec 15 07:52:36 2021
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Wed Dec 15 08:22:34 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37 2021/12/15 12:52:36 christos Exp $
+#	$NetBSD: Makefile,v 1.38 2021/12/15 13:22:34 christos Exp $
 
 NOMAN=		# defined
 
@@ -34,7 +34,7 @@ SRCS+=	exec_image.S memset.S strcmp.S
 
 CFLAGS=	-Os -fomit-frame-pointer -fno-unwind-tables
 CFLAGS+= -m68020-60
-CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS+= -Wextra -Wall -Wstrict-prototypes -Wmissing-prototypes
 CPPFLAGS+= -DTEXTADDR="$(TEXT)" -DBOOT_TEXTADDR="$(BOOT_TEXT)"
 CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
 CPPFLAGS+= -DSCSI_ADHOC_BOOTPART



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 13:22:34 UTC 2021

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile

Log Message:
-W === -Wextra


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/x68k/stand/boot_ufs/Makefile

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 13:03:33 UTC 2021

Modified Files:
src/usr.bin/make: compat.c make.h var.c

Log Message:
make: amend leftover cleanups from the previous commits

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/usr.bin/make/compat.c
cvs rdiff -u -r1.277 -r1.278 src/usr.bin/make/make.h
cvs rdiff -u -r1.988 -r1.989 src/usr.bin/make/var.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/make/compat.c
diff -u src/usr.bin/make/compat.c:1.232 src/usr.bin/make/compat.c:1.233
--- src/usr.bin/make/compat.c:1.232	Wed Dec 15 12:58:01 2021
+++ src/usr.bin/make/compat.c	Wed Dec 15 13:03:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.232 2021/12/15 12:58:01 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.233 2021/12/15 13:03:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.232 2021/12/15 12:58:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.233 2021/12/15 13:03:33 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -165,7 +165,7 @@ DebugFailedTarget(const char *cmd, const
 {
 	const char *p = cmd;
 	debug_printf("\n*** Failed target:  %s\n*** Failed command: ",
-		 gn->name);
+	gn->name);
 
 	/*
 	 * Replace runs of whitespace with a single space, to reduce the
@@ -228,15 +228,15 @@ Compat_RunCommand(const char *cmdp, GNod
 	char *bp;
 	bool silent;		/* Don't print command */
 	bool doIt;		/* Execute even if -n */
-	volatile bool errCheck; /* Check errors */
+	volatile bool errCheck;	/* Check errors */
 	int reason;		/* Reason for child's death */
 	int status;		/* Description of child's death */
 	pid_t cpid;		/* Child actually found */
 	pid_t retstat;		/* Result of wait */
 	const char **volatile av; /* Argument vector for thing to exec */
 	char **volatile mav;	/* Copy of the argument vector for freeing */
-	bool useShell;		/* True if command should be executed
- * using a shell */
+	bool useShell;		/* True if command should be executed using a
+ * shell */
 	const char *volatile cmd = cmdp;
 
 	silent = (gn->type & OP_SILENT) != OP_NONE;

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.277 src/usr.bin/make/make.h:1.278
--- src/usr.bin/make/make.h:1.277	Wed Dec 15 12:58:01 2021
+++ src/usr.bin/make/make.h	Wed Dec 15 13:03:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.277 2021/12/15 12:58:01 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.278 2021/12/15 13:03:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -105,9 +105,9 @@
 #define MAKE_GNUC_PREREQ(x, y)		\
 	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||			\
 	 (__GNUC__ > (x)))
-#else /* defined(__GNUC__) */
+#else
 #define MAKE_GNUC_PREREQ(x, y)	0
-#endif /* defined(__GNUC__) */
+#endif
 
 #if MAKE_GNUC_PREREQ(2, 7)
 #define MAKE_ATTR_UNUSED	__attribute__((__unused__))
@@ -131,9 +131,9 @@
 #endif
 
 #if MAKE_GNUC_PREREQ(4, 0)
-#define MAKE_ATTR_USE __attribute__((__warn_unused_result__))
+#define MAKE_ATTR_USE		__attribute__((__warn_unused_result__))
 #else
-#define MAKE_ATTR_USE /* delete */
+#define MAKE_ATTR_USE		/* delete */
 #endif
 
 #define MAKE_INLINE static inline MAKE_ATTR_UNUSED

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.988 src/usr.bin/make/var.c:1.989
--- src/usr.bin/make/var.c:1.988	Wed Dec 15 12:58:01 2021
+++ src/usr.bin/make/var.c	Wed Dec 15 13:03:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.988 2021/12/15 12:58:01 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.989 2021/12/15 13:03:33 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.988 2021/12/15 12:58:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.989 2021/12/15 13:03:33 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -2038,9 +2038,9 @@ static const char ExprDefined_Name[][10]
 };
 
 #if __STDC_VERSION__ >= 199901L
-#define const_member const
+#define const_member		const
 #else
-#define const_member /* no const possible */
+#define const_member		/* no const possible */
 #endif
 
 /* An expression based on a variable, such as $@ or ${VAR:Mpattern:Q}. */



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 13:03:33 UTC 2021

Modified Files:
src/usr.bin/make: compat.c make.h var.c

Log Message:
make: amend leftover cleanups from the previous commits

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/usr.bin/make/compat.c
cvs rdiff -u -r1.277 -r1.278 src/usr.bin/make/make.h
cvs rdiff -u -r1.988 -r1.989 src/usr.bin/make/var.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/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:58:01 UTC 2021

Modified Files:
src/usr.bin/make: arch.c compat.c cond.c for.c hash.h job.c job.h
main.c make.c make.h nonints.h parse.c suff.c trace.c util.c var.c

Log Message:
make: format comments according to /usr/share/misc/style

Assisted by indent(1), with manual corrections due to its many remaining
bugs.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/arch.c
cvs rdiff -u -r1.231 -r1.232 src/usr.bin/make/compat.c
cvs rdiff -u -r1.305 -r1.306 src/usr.bin/make/cond.c
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/for.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/hash.h
cvs rdiff -u -r1.442 -r1.443 src/usr.bin/make/job.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/job.h
cvs rdiff -u -r1.546 -r1.547 src/usr.bin/make/main.c
cvs rdiff -u -r1.248 -r1.249 src/usr.bin/make/make.c
cvs rdiff -u -r1.276 -r1.277 src/usr.bin/make/make.h
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.582 -r1.583 src/usr.bin/make/parse.c
cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/suff.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/trace.c
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/util.c
cvs rdiff -u -r1.987 -r1.988 src/usr.bin/make/var.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.208 src/usr.bin/make/arch.c:1.209
--- src/usr.bin/make/arch.c:1.208	Wed Dec 15 12:24:13 2021
+++ src/usr.bin/make/arch.c	Wed Dec 15 12:58:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.209 2021/12/15 12:58:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.209 2021/12/15 12:58:01 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -205,9 +205,8 @@ Arch_ParseArchive(char **pp, GNodeList *
 	FStr lib;		/* Library-part of specification */
 	FStr mem;		/* Member-part of specification */
 	char saveChar;		/* Ending delimiter of member-name */
-	bool expandLib;		/* Whether the parsed lib contains
- * variable expressions that need to be
- * expanded */
+	bool expandLib;		/* Whether the parsed lib contains variable
+ * expressions that need to be expanded */
 
 	spec = *pp;
 	lib = FStr_InitRefer(spec);
@@ -258,7 +257,9 @@ Arch_ParseArchive(char **pp, GNodeList *
 		while (*cp != '\0' && *cp != ')' && !ch_isspace(*cp)) {
 			if (*cp == '$') {
 /* Expand nested variable expressions. */
-/* XXX: This code can probably be shortened. */
+/*
+ * XXX: This code can probably be shortened.
+ */
 FStr result;
 bool isError;
 const char *nested_p = cp;
@@ -691,8 +692,10 @@ ArchiveMember_HasName(const struct ar_hd
 	if (ar_name[namelen] == ' ')
 		return true;
 
-	/* In archives created by GNU binutils 2.27, the member names end with
-	 * a slash. */
+	/*
+	 * In archives created by GNU binutils 2.27, the member names end
+	 * with a slash.
+	 */
 	if (ar_name[namelen] == '/' &&
 	(namelen == ar_name_len || ar_name[namelen + 1] == ' '))
 		return true;

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.231 src/usr.bin/make/compat.c:1.232
--- src/usr.bin/make/compat.c:1.231	Wed Dec 15 12:24:13 2021
+++ src/usr.bin/make/compat.c	Wed Dec 15 12:58:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.232 2021/12/15 12:58:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.232 2021/12/15 12:58:01 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -167,8 +167,10 @@ DebugFailedTarget(const char *cmd, const
 	debug_printf("\n*** Failed target:  %s\n*** Failed command: ",
 		 gn->name);
 
-	/* Replace runs of whitespace with a single space, to reduce
-	 * the amount of whitespace for multi-line command lines. */
+	/*
+	 * Replace runs of whitespace with a single space, to reduce the
+	 * amount of whitespace for multi-line command lines.
+	 */
 	while (*p != '\0') {
 		if (ch_isspace(*p)) {
 			debug_printf(" ");
@@ -712,9 +714,11 @@ Compat_Run(GNodeList *targs)
 
 	InitSignals();
 
-	/* Create the .END node now, to keep the (debug) output of the
-	 * counter.mk test the same as before 2020-09-23.  This implementation
-	 * detail probably doesn't matter though. */
+	/*
+	 * Create the .END node now, to keep the (debug) output of the
+	 * 

CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:58:01 UTC 2021

Modified Files:
src/usr.bin/make: arch.c compat.c cond.c for.c hash.h job.c job.h
main.c make.c make.h nonints.h parse.c suff.c trace.c util.c var.c

Log Message:
make: format comments according to /usr/share/misc/style

Assisted by indent(1), with manual corrections due to its many remaining
bugs.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/usr.bin/make/arch.c
cvs rdiff -u -r1.231 -r1.232 src/usr.bin/make/compat.c
cvs rdiff -u -r1.305 -r1.306 src/usr.bin/make/cond.c
cvs rdiff -u -r1.150 -r1.151 src/usr.bin/make/for.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/hash.h
cvs rdiff -u -r1.442 -r1.443 src/usr.bin/make/job.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/job.h
cvs rdiff -u -r1.546 -r1.547 src/usr.bin/make/main.c
cvs rdiff -u -r1.248 -r1.249 src/usr.bin/make/make.c
cvs rdiff -u -r1.276 -r1.277 src/usr.bin/make/make.h
cvs rdiff -u -r1.220 -r1.221 src/usr.bin/make/nonints.h
cvs rdiff -u -r1.582 -r1.583 src/usr.bin/make/parse.c
cvs rdiff -u -r1.359 -r1.360 src/usr.bin/make/suff.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/make/trace.c
cvs rdiff -u -r1.77 -r1.78 src/usr.bin/make/util.c
cvs rdiff -u -r1.987 -r1.988 src/usr.bin/make/var.c

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



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 12:52:36 UTC 2021

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile

Log Message:
remove naked -W


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/stand/boot_ufs/Makefile

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

Modified files:

Index: src/sys/arch/x68k/stand/boot_ufs/Makefile
diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.36 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.37
--- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.36	Sat Jan 18 02:25:11 2020
+++ src/sys/arch/x68k/stand/boot_ufs/Makefile	Wed Dec 15 07:52:36 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2020/01/18 07:25:11 isaki Exp $
+#	$NetBSD: Makefile,v 1.37 2021/12/15 12:52:36 christos Exp $
 
 NOMAN=		# defined
 
@@ -34,7 +34,7 @@ SRCS+=	exec_image.S memset.S strcmp.S
 
 CFLAGS=	-Os -fomit-frame-pointer -fno-unwind-tables
 CFLAGS+= -m68020-60
-CFLAGS+= -W -Wall -Wstrict-prototypes -Wmissing-prototypes
+CFLAGS+= -Wall -Wstrict-prototypes -Wmissing-prototypes
 CPPFLAGS+= -DTEXTADDR="$(TEXT)" -DBOOT_TEXTADDR="$(BOOT_TEXT)"
 CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
 CPPFLAGS+= -DSCSI_ADHOC_BOOTPART



CVS commit: src/sys/arch/x68k/stand/boot_ufs

2021-12-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 15 12:52:36 UTC 2021

Modified Files:
src/sys/arch/x68k/stand/boot_ufs: Makefile

Log Message:
remove naked -W


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/stand/boot_ufs/Makefile

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:24:13 UTC 2021

Modified Files:
src/usr.bin/make: arch.c compat.c cond.c dir.c hash.c job.c job.h lst.h
main.c suff.c util.c

Log Message:
make: use consistent indentation for statements and continuations

No binary change, except for line numbers in assertions in suff.c.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/make/arch.c
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/compat.c
cvs rdiff -u -r1.304 -r1.305 src/usr.bin/make/cond.c
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/dir.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/make/hash.c
cvs rdiff -u -r1.441 -r1.442 src/usr.bin/make/job.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/make/job.h
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/make/lst.h
cvs rdiff -u -r1.545 -r1.546 src/usr.bin/make/main.c
cvs rdiff -u -r1.358 -r1.359 src/usr.bin/make/suff.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/util.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/make/arch.c
diff -u src/usr.bin/make/arch.c:1.207 src/usr.bin/make/arch.c:1.208
--- src/usr.bin/make/arch.c:1.207	Sun Dec 12 23:47:21 2021
+++ src/usr.bin/make/arch.c	Wed Dec 15 12:24:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.207 2021/12/12 23:47:21 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -126,7 +126,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.207 2021/12/12 23:47:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.208 2021/12/15 12:24:13 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -287,8 +287,8 @@ Arch_ParseArchive(char **pp, GNodeList *
 		 */
 		if (*cp == '\0') {
 			Parse_Error(PARSE_FATAL,
-"No closing parenthesis "
-"in archive specification");
+			"No closing parenthesis "
+			"in archive specification");
 			return false;
 		}
 
@@ -625,7 +625,7 @@ ArchSVR4Entry(Arch *ar, char *inout_name
 
 		if (ar->fnametab != NULL) {
 			DEBUG0(ARCH,
-			   "Attempted to redefine an SVR4 name table\n");
+			"Attempted to redefine an SVR4 name table\n");
 			return -1;
 		}
 
@@ -646,8 +646,9 @@ ArchSVR4Entry(Arch *ar, char *inout_name
 entry++;
 *ptr = '\0';
 			}
-		DEBUG1(ARCH, "Found svr4 archive name table with %lu entries\n",
-		   (unsigned long)entry);
+		DEBUG1(ARCH,
+		"Found svr4 archive name table with %lu entries\n",
+		(unsigned long)entry);
 		return 0;
 	}
 
@@ -661,7 +662,7 @@ ArchSVR4Entry(Arch *ar, char *inout_name
 	}
 	if (entry >= ar->fnamesize) {
 		DEBUG2(ARCH, "SVR4 entry offset %s is greater than %lu\n",
-		   inout_name, (unsigned long)ar->fnamesize);
+		inout_name, (unsigned long)ar->fnamesize);
 		return 2;
 	}
 
@@ -762,9 +763,9 @@ ArchFindMember(const char *archive, cons
 		}
 
 		DEBUG5(ARCH, "Reading archive %s member %.*s mtime %.*s\n",
-		   archive,
-		   (int)sizeof out_arh->ar_name, out_arh->ar_name,
-		   (int)sizeof out_arh->ar_date, out_arh->ar_date);
+		archive,
+		(int)sizeof out_arh->ar_name, out_arh->ar_name,
+		(int)sizeof out_arh->ar_date, out_arh->ar_date);
 
 		if (ArchiveMember_HasName(out_arh, member, len)) {
 			/*
@@ -865,7 +866,7 @@ Arch_Touch(GNode *gn)
 	struct ar_hdr arh;
 
 	f = ArchFindMember(GNode_VarArchive(gn), GNode_VarMember(gn), ,
-			   "r+");
+	"r+");
 	if (f == NULL)
 		return;
 

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.230 src/usr.bin/make/compat.c:1.231
--- src/usr.bin/make/compat.c:1.230	Wed Dec 15 10:04:49 2021
+++ src/usr.bin/make/compat.c	Wed Dec 15 12:24:13 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.230 2021/12/15 10:04:49 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.230 2021/12/15 10:04:49 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.231 2021/12/15 12:24:13 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -404,7 +404,7 @@ Compat_RunCommand(const char *cmdp, GNod
 		status = WEXITSTATUS(reason);	/* exited */
 #if defined(USE_META) && defined(USE_FILEMON_ONCE)
 		if (useMeta) {
-		meta_cmd_finish(NULL);
+			meta_cmd_finish(NULL);
 		}
 #endif
 		if (status != 0) {
@@ -734,7 +734,7 @@ Compat_Run(GNodeList *targs)
 			printf("`%s' is up to date.\n", gn->name);
 		} else if (gn->made == ABORTED) {
 			printf("`%s' not remade because of errors.\n",
-			   gn->name);
+			gn->name);
 		}
 		if (GNode_IsError(gn) && errorNode == NULL)
 			errorNode = gn;

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.304 

CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:24:13 UTC 2021

Modified Files:
src/usr.bin/make: arch.c compat.c cond.c dir.c hash.c job.c job.h lst.h
main.c suff.c util.c

Log Message:
make: use consistent indentation for statements and continuations

No binary change, except for line numbers in assertions in suff.c.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/usr.bin/make/arch.c
cvs rdiff -u -r1.230 -r1.231 src/usr.bin/make/compat.c
cvs rdiff -u -r1.304 -r1.305 src/usr.bin/make/cond.c
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/dir.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/make/hash.c
cvs rdiff -u -r1.441 -r1.442 src/usr.bin/make/job.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/make/job.h
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/make/lst.h
cvs rdiff -u -r1.545 -r1.546 src/usr.bin/make/main.c
cvs rdiff -u -r1.358 -r1.359 src/usr.bin/make/suff.c
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/make/util.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/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:08:25 UTC 2021

Modified Files:
src/usr.bin/make: buf.h dir.h hash.h job.h lst.h make.h metachar.h
src/usr.bin/make/filemon: filemon.h

Log Message:
make: remove redundant comments for multiple-inclusion guards


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/make/buf.h src/usr.bin/make/dir.h
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/hash.h
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/job.h
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/make/lst.h
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/make.h
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/filemon/filemon.h

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/make/buf.h
diff -u src/usr.bin/make/buf.h:1.45 src/usr.bin/make/buf.h:1.46
--- src/usr.bin/make/buf.h:1.45	Wed Dec 15 09:29:55 2021
+++ src/usr.bin/make/buf.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.45 2021/12/15 09:29:55 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.46 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -119,4 +119,4 @@ void Buf_Done(Buffer *);
 char *Buf_DoneData(Buffer *) MAKE_ATTR_USE;
 char *Buf_DoneDataCompact(Buffer *) MAKE_ATTR_USE;
 
-#endif /* MAKE_BUF_H */
+#endif
Index: src/usr.bin/make/dir.h
diff -u src/usr.bin/make/dir.h:1.45 src/usr.bin/make/dir.h:1.46
--- src/usr.bin/make/dir.h:1.45	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/dir.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.45 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.46 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -104,4 +104,4 @@ struct cached_stat {
 int cached_lstat(const char *, struct cached_stat *);
 int cached_stat(const char *, struct cached_stat *);
 
-#endif /* MAKE_DIR_H */
+#endif

Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.43 src/usr.bin/make/hash.h:1.44
--- src/usr.bin/make/hash.h:1.43	Wed Dec 15 10:07:53 2021
+++ src/usr.bin/make/hash.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.h,v 1.43 2021/12/15 10:07:53 rillig Exp $	*/
+/*	$NetBSD: hash.h,v 1.44 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -177,4 +177,4 @@ HashIter_InitSet(HashIter *hi, HashSet *
 	HashIter_Init(hi, >tbl);
 }
 
-#endif /* MAKE_HASH_H */
+#endif

Index: src/usr.bin/make/job.h
diff -u src/usr.bin/make/job.h:1.74 src/usr.bin/make/job.h:1.75
--- src/usr.bin/make/job.h:1.74	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/job.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.h,v 1.74 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: job.h,v 1.75 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -208,4 +208,4 @@ bool Job_RunTarget(const char *, const c
 void Job_FlagsToString(const Job *, char *, size_t);
 int Job_TempFile(const char *, char *, size_t) MAKE_ATTR_USE;
 
-#endif /* MAKE_JOB_H */
+#endif

Index: src/usr.bin/make/lst.h
diff -u src/usr.bin/make/lst.h:1.100 src/usr.bin/make/lst.h:1.101
--- src/usr.bin/make/lst.h:1.100	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/lst.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lst.h,v 1.100 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: lst.h,v 1.101 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -197,4 +197,4 @@ Vector_Done(Vector *v) {
 	free(v->items);
 }
 
-#endif /* MAKE_LST_H */
+#endif

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.275 src/usr.bin/make/make.h:1.276
--- src/usr.bin/make/make.h:1.275	Wed Dec 15 11:58:40 2021
+++ src/usr.bin/make/make.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.275 2021/12/15 11:58:40 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.276 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -838,4 +838,4 @@ pp_skip_hspace(char **pp)
 # define MAKE_RCSID(id) static volatile char rcsid[] = id
 #endif
 
-#endif /* MAKE_MAKE_H */
+#endif

Index: src/usr.bin/make/metachar.h
diff -u src/usr.bin/make/metachar.h:1.18 src/usr.bin/make/metachar.h:1.19
--- src/usr.bin/make/metachar.h:1.18	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/metachar.h	Wed Dec 15 12:08:25 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: metachar.h,v 1.18 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: metachar.h,v 1.19 2021/12/15 12:08:25 rillig Exp $	*/
 
 /*
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -49,4 +49,4 @@ needshell(const char *cmd)
 	return *cmd != '\0';
 }
 
-#endif /* MAKE_METACHAR_H */
+#endif

Index: src/usr.bin/make/filemon/filemon.h
diff -u 

CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 12:08:25 UTC 2021

Modified Files:
src/usr.bin/make: buf.h dir.h hash.h job.h lst.h make.h metachar.h
src/usr.bin/make/filemon: filemon.h

Log Message:
make: remove redundant comments for multiple-inclusion guards


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/usr.bin/make/buf.h src/usr.bin/make/dir.h
cvs rdiff -u -r1.43 -r1.44 src/usr.bin/make/hash.h
cvs rdiff -u -r1.74 -r1.75 src/usr.bin/make/job.h
cvs rdiff -u -r1.100 -r1.101 src/usr.bin/make/lst.h
cvs rdiff -u -r1.275 -r1.276 src/usr.bin/make/make.h
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/filemon/filemon.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 11:58:40 UTC 2021

Modified Files:
src/usr.bin/make: make.h var.c

Log Message:
make: remove space after ':' in bit-field declarations

As seen in /usr/share/misc/style.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/usr.bin/make/make.h
cvs rdiff -u -r1.986 -r1.987 src/usr.bin/make/var.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/make/make.h
diff -u src/usr.bin/make/make.h:1.274 src/usr.bin/make/make.h:1.275
--- src/usr.bin/make/make.h:1.274	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/make.h	Wed Dec 15 11:58:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.274 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.275 2021/12/15 11:58:40 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -550,26 +550,26 @@ extern pid_t myPid;
 #endif
 
 typedef struct DebugFlags {
-	bool DEBUG_ARCH: 1;
-	bool DEBUG_COND: 1;
-	bool DEBUG_CWD: 1;
-	bool DEBUG_DIR: 1;
-	bool DEBUG_ERROR: 1;
-	bool DEBUG_FOR: 1;
-	bool DEBUG_GRAPH1: 1;
-	bool DEBUG_GRAPH2: 1;
-	bool DEBUG_GRAPH3: 1;
-	bool DEBUG_HASH: 1;
-	bool DEBUG_JOB: 1;
-	bool DEBUG_LOUD: 1;
-	bool DEBUG_MAKE: 1;
-	bool DEBUG_META: 1;
-	bool DEBUG_PARSE: 1;
-	bool DEBUG_SCRIPT: 1;
-	bool DEBUG_SHELL: 1;
-	bool DEBUG_SUFF: 1;
-	bool DEBUG_TARG: 1;
-	bool DEBUG_VAR: 1;
+	bool DEBUG_ARCH:1;
+	bool DEBUG_COND:1;
+	bool DEBUG_CWD:1;
+	bool DEBUG_DIR:1;
+	bool DEBUG_ERROR:1;
+	bool DEBUG_FOR:1;
+	bool DEBUG_GRAPH1:1;
+	bool DEBUG_GRAPH2:1;
+	bool DEBUG_GRAPH3:1;
+	bool DEBUG_HASH:1;
+	bool DEBUG_JOB:1;
+	bool DEBUG_LOUD:1;
+	bool DEBUG_MAKE:1;
+	bool DEBUG_META:1;
+	bool DEBUG_PARSE:1;
+	bool DEBUG_SCRIPT:1;
+	bool DEBUG_SHELL:1;
+	bool DEBUG_SUFF:1;
+	bool DEBUG_TARG:1;
+	bool DEBUG_VAR:1;
 } DebugFlags;
 
 #define CONCAT(a, b) a##b

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.986 src/usr.bin/make/var.c:1.987
--- src/usr.bin/make/var.c:1.986	Mon Dec 13 04:18:01 2021
+++ src/usr.bin/make/var.c	Wed Dec 15 11:58:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.986 2021/12/13 04:18:01 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.987 2021/12/15 11:58:40 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.986 2021/12/13 04:18:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.987 2021/12/15 11:58:40 rillig Exp $");
 
 /*
  * Variables are defined using one of the VAR=value assignments.  Their
@@ -173,20 +173,20 @@ typedef struct Var {
 	Buffer val;
 
 	/* The variable came from the command line. */
-	bool fromCmd: 1;
+	bool fromCmd:1;
 
 	/*
 	 * The variable is short-lived.
 	 * These variables are not registered in any GNode, therefore they
 	 * must be freed after use.
 	 */
-	bool shortLived: 1;
+	bool shortLived:1;
 
 	/*
 	 * The variable comes from the environment.
 	 * Appending to its value moves the variable to the global scope.
 	 */
-	bool fromEnvironment: 1;
+	bool fromEnvironment:1;
 
 	/*
 	 * The variable value cannot be changed anymore, and the variable
@@ -195,19 +195,19 @@ typedef struct Var {
 	 *
 	 * See VAR_SET_READONLY.
 	 */
-	bool readOnly: 1;
+	bool readOnly:1;
 
 	/*
 	* The variable's value is currently being used by Var_Parse or
 	* Var_Subst.  This marker is used to avoid endless recursion.
 	*/
-	bool inUse: 1;
+	bool inUse:1;
 
 	/*
 	 * The variable is exported to the environment, to be used by child
 	 * processes.
 	 */
-	bool exported: 1;
+	bool exported:1;
 
 	/*
 	 * At the point where this variable was exported, it contained an
@@ -215,7 +215,7 @@ typedef struct Var {
 	 * process is started, it needs to be exported again, in the hope
 	 * that the referenced variable can then be resolved.
 	 */
-	bool reexport: 1;
+	bool reexport:1;
 } Var;
 
 /*
@@ -248,10 +248,10 @@ typedef enum UnexportWhat {
 
 /* Flags for pattern matching in the :S and :C modifiers */
 typedef struct PatternFlags {
-	bool subGlobal: 1;	/* 'g': replace as often as possible */
-	bool subOnce: 1;	/* '1': replace only once */
-	bool anchorStart: 1;	/* '^': match only at start of word */
-	bool anchorEnd: 1;	/* '$': match only at end of word */
+	bool subGlobal:1;	/* 'g': replace as often as possible */
+	bool subOnce:1;		/* '1': replace only once */
+	bool anchorStart:1;	/* '^': match only at start of word */
+	bool anchorEnd:1;	/* '$': match only at end of word */
 } PatternFlags;
 
 /* SepBuf builds a string from words interleaved with separators. */



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 11:58:40 UTC 2021

Modified Files:
src/usr.bin/make: make.h var.c

Log Message:
make: remove space after ':' in bit-field declarations

As seen in /usr/share/misc/style.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/usr.bin/make/make.h
cvs rdiff -u -r1.986 -r1.987 src/usr.bin/make/var.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/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 11:01:39 UTC 2021

Modified Files:
src/usr.bin/make: main.c make_malloc.h

Log Message:
make: remove bmake_free

It was only used in 2 places, and in both these places, the pointer was
never null.


To generate a diff of this commit:
cvs rdiff -u -r1.544 -r1.545 src/usr.bin/make/main.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/make_malloc.h

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/make/main.c
diff -u src/usr.bin/make/main.c:1.544 src/usr.bin/make/main.c:1.545
--- src/usr.bin/make/main.c:1.544	Wed Dec 15 10:57:01 2021
+++ src/usr.bin/make/main.c	Wed Dec 15 11:01:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.545 2021/12/15 11:01:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.545 2021/12/15 11:01:39 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -843,7 +843,7 @@ PrintVar(const char *varname, bool expan
 		(void)Var_Subst(varname, SCOPE_GLOBAL, VARE_WANTRES, );
 		/* TODO: handle errors */
 		printf("%s\n", evalue);
-		bmake_free(evalue);
+		free(evalue);
 
 	} else if (expandVars) {
 		char *expr = str_concat3("${", varname, "}");
@@ -852,7 +852,7 @@ PrintVar(const char *varname, bool expan
 		/* TODO: handle errors */
 		free(expr);
 		printf("%s\n", evalue);
-		bmake_free(evalue);
+		free(evalue);
 
 	} else {
 		FStr value = Var_Value(SCOPE_GLOBAL, varname);

Index: src/usr.bin/make/make_malloc.h
diff -u src/usr.bin/make/make_malloc.h:1.17 src/usr.bin/make/make_malloc.h:1.18
--- src/usr.bin/make/make_malloc.h:1.17	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/make_malloc.h	Wed Dec 15 11:01:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make_malloc.h,v 1.17 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: make_malloc.h,v 1.18 2021/12/15 11:01:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -40,17 +40,3 @@ char *bmake_strldup(const char *, size_t
 #endif
 
 char *bmake_strsedup(const char *, const char *) MAKE_ATTR_USE;
-
-/*
- * Thin wrapper around free(3) to avoid the extra function call in case
- * p is NULL, to save a few machine instructions.
- *
- * The case of a NULL pointer happens especially often after Var_Value,
- * since only environment variables need to be freed, but not others.
- */
-MAKE_INLINE void
-bmake_free(void *p)
-{
-	if (p != NULL)
-		free(p);
-}



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 11:01:39 UTC 2021

Modified Files:
src/usr.bin/make: main.c make_malloc.h

Log Message:
make: remove bmake_free

It was only used in 2 places, and in both these places, the pointer was
never null.


To generate a diff of this commit:
cvs rdiff -u -r1.544 -r1.545 src/usr.bin/make/main.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/make_malloc.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:57:01 UTC 2021

Modified Files:
src/usr.bin/make: main.c str.c str.h

Log Message:
make: in CLEANUP mode, free interned strings at the very end

Noticed by sjg.


To generate a diff of this commit:
cvs rdiff -u -r1.543 -r1.544 src/usr.bin/make/main.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/str.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/str.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:57:01 UTC 2021

Modified Files:
src/usr.bin/make: main.c str.c str.h

Log Message:
make: in CLEANUP mode, free interned strings at the very end

Noticed by sjg.


To generate a diff of this commit:
cvs rdiff -u -r1.543 -r1.544 src/usr.bin/make/main.c
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/make/str.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/str.h

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/make/main.c
diff -u src/usr.bin/make/main.c:1.543 src/usr.bin/make/main.c:1.544
--- src/usr.bin/make/main.c:1.543	Mon Dec 13 22:26:21 2021
+++ src/usr.bin/make/main.c	Wed Dec 15 10:57:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.543 2021/12/13 22:26:21 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*	"@(#)main.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: main.c,v 1.543 2021/12/13 22:26:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
 	"The Regents of the University of California.  "
@@ -1653,6 +1653,7 @@ main_CleanUp(void)
 	Dir_End();
 	Job_End();
 	Trace_End();
+	Str_Intern_End();
 }
 
 /* Determine the exit code. */

Index: src/usr.bin/make/str.c
diff -u src/usr.bin/make/str.c:1.87 src/usr.bin/make/str.c:1.88
--- src/usr.bin/make/str.c:1.87	Mon Dec 13 05:25:04 2021
+++ src/usr.bin/make/str.c	Wed Dec 15 10:57:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.c,v 1.87 2021/12/13 05:25:04 rillig Exp $	*/
+/*	$NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
 #include "make.h"
 
 /*	"@(#)str.c	5.8 (Berkeley) 6/1/90"	*/
-MAKE_RCSID("$NetBSD: str.c,v 1.87 2021/12/13 05:25:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $");
 
 
 static HashTable interned_strings;
@@ -406,6 +406,14 @@ Str_Intern_Init(void)
 	HashTable_Init(_strings);
 }
 
+void
+Str_Intern_End(void)
+{
+#ifdef CLEANUP
+	HashTable_Done(_strings);
+#endif
+}
+
 /* Return a canonical instance of str, with unlimited lifetime. */
 const char *
 Str_Intern(const char *str)

Index: src/usr.bin/make/str.h
diff -u src/usr.bin/make/str.h:1.14 src/usr.bin/make/str.h:1.15
--- src/usr.bin/make/str.h:1.14	Mon Dec 13 05:25:04 2021
+++ src/usr.bin/make/str.h	Wed Dec 15 10:57:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: str.h,v 1.14 2021/12/13 05:25:04 rillig Exp $	*/
+/*	$NetBSD: str.h,v 1.15 2021/12/15 10:57:01 rillig Exp $	*/
 
 /*
  Copyright (c) 2021 Roland Illig 
@@ -345,4 +345,5 @@ char *str_concat3(const char *, const ch
 bool Str_Match(const char *, const char *);
 
 void Str_Intern_Init(void);
+void Str_Intern_End(void);
 const char *Str_Intern(const char *);



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:12:20 UTC 2021

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make: in ParseDependencyCheckSpec, move default branch to the bottom

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/make/parse.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/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:12:20 UTC 2021

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make: in ParseDependencyCheckSpec, move default branch to the bottom

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.581 -r1.582 src/usr.bin/make/parse.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/make/parse.c
diff -u src/usr.bin/make/parse.c:1.581 src/usr.bin/make/parse.c:1.582
--- src/usr.bin/make/parse.c:1.581	Tue Dec 14 01:18:14 2021
+++ src/usr.bin/make/parse.c	Wed Dec 15 10:12:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.581 2021/12/14 01:18:14 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.582 2021/12/15 10:12:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -109,7 +109,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.581 2021/12/14 01:18:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.582 2021/12/15 10:12:20 rillig Exp $");
 
 /* types and constants */
 
@@ -1240,11 +1240,6 @@ static void
 ParseDependencyCheckSpec(ParseSpecial specType)
 {
 	switch (specType) {
-	default:
-		Parse_Error(PARSE_WARNING,
-		"Special and mundane targets don't mix. "
-		"Mundane ones ignored");
-		break;
 	case SP_DEFAULT:
 	case SP_STALE:
 	case SP_BEGIN:
@@ -1258,6 +1253,11 @@ ParseDependencyCheckSpec(ParseSpecial sp
 	case SP_NOT:
 		/* Nothing special here -- targets can be empty if it wants. */
 		break;
+	default:
+		Parse_Error(PARSE_WARNING,
+		"Special and mundane targets don't mix. "
+		"Mundane ones ignored");
+		break;
 	}
 }
 



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:07:53 UTC 2021

Modified Files:
src/usr.bin/make: hash.c hash.h

Log Message:
make: change return type of HashTable_Set to void

None of the callers needs the HashEntry for further manipulation.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/make/hash.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/make/hash.h

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/make/hash.c
diff -u src/usr.bin/make/hash.c:1.66 src/usr.bin/make/hash.c:1.67
--- src/usr.bin/make/hash.c:1.66	Tue Dec  7 21:58:01 2021
+++ src/usr.bin/make/hash.c	Wed Dec 15 10:07:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.c,v 1.66 2021/12/07 21:58:01 rillig Exp $	*/
+/*	$NetBSD: hash.c,v 1.67 2021/12/15 10:07:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -74,7 +74,7 @@
 #include "make.h"
 
 /*	"@(#)hash.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: hash.c,v 1.66 2021/12/07 21:58:01 rillig Exp $");
+MAKE_RCSID("$NetBSD: hash.c,v 1.67 2021/12/15 10:07:53 rillig Exp $");
 
 /*
  * The ratio of # entries to # buckets at which we rebuild the table to
@@ -307,12 +307,11 @@ HashTable_CreateEntry(HashTable *t, cons
 	return he;
 }
 
-HashEntry *
+void
 HashTable_Set(HashTable *t, const char *key, void *value)
 {
 	HashEntry *he = HashTable_CreateEntry(t, key, NULL);
 	HashEntry_Set(he, value);
-	return he;
 }
 
 /* Delete the entry from the table and free the associated memory. */

Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.42 src/usr.bin/make/hash.h:1.43
--- src/usr.bin/make/hash.h:1.42	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/hash.h	Wed Dec 15 10:07:53 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.h,v 1.42 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: hash.h,v 1.43 2021/12/15 10:07:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -137,8 +137,7 @@ unsigned int Hash_Substring(Substring) M
 void *HashTable_FindValueBySubstringHash(HashTable *, Substring, unsigned int)
 MAKE_ATTR_USE;
 HashEntry *HashTable_CreateEntry(HashTable *, const char *, bool *);
-/* TODO: change return type to void */
-HashEntry *HashTable_Set(HashTable *, const char *, void *);
+void HashTable_Set(HashTable *, const char *, void *);
 void HashTable_DeleteEntry(HashTable *, HashEntry *);
 void HashTable_DebugStats(HashTable *, const char *);
 



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:07:53 UTC 2021

Modified Files:
src/usr.bin/make: hash.c hash.h

Log Message:
make: change return type of HashTable_Set to void

None of the callers needs the HashEntry for further manipulation.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/make/hash.c
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/make/hash.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:04:49 UTC 2021

Modified Files:
src/usr.bin/make: compat.c job.c nonints.h

Log Message:
make: change return type of Compat_RunCommand from int to bool

The documentation was wrong before since status was not restricted to
only 0 or 1.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/make/compat.c
cvs rdiff -u -r1.440 -r1.441 src/usr.bin/make/job.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/nonints.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 10:04:49 UTC 2021

Modified Files:
src/usr.bin/make: compat.c job.c nonints.h

Log Message:
make: change return type of Compat_RunCommand from int to bool

The documentation was wrong before since status was not restricted to
only 0 or 1.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.229 -r1.230 src/usr.bin/make/compat.c
cvs rdiff -u -r1.440 -r1.441 src/usr.bin/make/job.c
cvs rdiff -u -r1.219 -r1.220 src/usr.bin/make/nonints.h

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/make/compat.c
diff -u src/usr.bin/make/compat.c:1.229 src/usr.bin/make/compat.c:1.230
--- src/usr.bin/make/compat.c:1.229	Sun Nov 28 23:12:51 2021
+++ src/usr.bin/make/compat.c	Wed Dec 15 10:04:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.229 2021/11/28 23:12:51 rillig Exp $	*/
+/*	$NetBSD: compat.c,v 1.230 2021/12/15 10:04:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -96,7 +96,7 @@
 #include "pathnames.h"
 
 /*	"@(#)compat.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: compat.c,v 1.229 2021/11/28 23:12:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: compat.c,v 1.230 2021/12/15 10:04:49 rillig Exp $");
 
 static GNode *curTarg = NULL;
 static pid_t compatChild;
@@ -217,9 +217,9 @@ UseShell(const char *cmd MAKE_ATTR_UNUSE
  *	ln		List node that contains the command
  *
  * Results:
- *	0 if the command succeeded, 1 if an error occurred.
+ *	true if the command succeeded.
  */
-int
+bool
 Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln)
 {
 	char *cmdStart;		/* Start of expanded command */
@@ -246,7 +246,7 @@ Compat_RunCommand(const char *cmdp, GNod
 
 	if (cmdStart[0] == '\0') {
 		free(cmdStart);
-		return 0;
+		return true;
 	}
 	cmd = cmdStart;
 	LstNode_Set(ln, cmdStart);
@@ -266,12 +266,12 @@ Compat_RunCommand(const char *cmdp, GNod
 			 * usual '$$'.
 			 */
 			Lst_Append(>commands, cmdStart);
-			return 0;
+			return true;
 		}
 	}
 	if (strcmp(cmdStart, "...") == 0) {
 		gn->type |= OP_SAVE_CMDS;
-		return 0;
+		return true;
 	}
 
 	for (;;) {
@@ -295,7 +295,7 @@ Compat_RunCommand(const char *cmdp, GNod
 	 * If we did not end up with a command, just skip it.
 	 */
 	if (cmd[0] == '\0')
-		return 0;
+		return true;
 
 	useShell = UseShell(cmd);
 	/*
@@ -312,7 +312,7 @@ Compat_RunCommand(const char *cmdp, GNod
 	 * we go...
 	 */
 	if (!doIt && !GNode_ShouldExecute(gn))
-		return 0;
+		return true;
 
 	DEBUG1(JOB, "Execute: '%s'\n", cmd);
 
@@ -454,7 +454,7 @@ Compat_RunCommand(const char *cmdp, GNod
 		kill(myPid, compatSigno);
 	}
 
-	return status;
+	return status == 0;
 }
 
 static void
@@ -464,7 +464,7 @@ RunCommands(GNode *gn)
 
 	for (ln = gn->commands.first; ln != NULL; ln = ln->next) {
 		const char *cmd = ln->datum;
-		if (Compat_RunCommand(cmd, gn, ln) != 0)
+		if (!Compat_RunCommand(cmd, gn, ln))
 			break;
 	}
 }

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.440 src/usr.bin/make/job.c:1.441
--- src/usr.bin/make/job.c:1.440	Sun Nov 28 19:51:06 2021
+++ src/usr.bin/make/job.c	Wed Dec 15 10:04:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.440 2021/11/28 19:51:06 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.441 2021/12/15 10:04:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -142,7 +142,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.440 2021/11/28 19:51:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.441 2021/12/15 10:04:49 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -911,7 +911,7 @@ JobWriteCommand(Job *job, ShellWriter *w
 
 	run = GNode_ShouldExecute(job->node);
 
-	Var_Subst(ucmd, job->node, VARE_WANTRES, );
+	(void)Var_Subst(ucmd, job->node, VARE_WANTRES, );
 	/* TODO: handle errors */
 	xcmdStart = xcmd;
 
@@ -925,7 +925,7 @@ JobWriteCommand(Job *job, ShellWriter *w
 		 * We're not actually executing anything...
 		 * but this one needs to be - use compat mode just for it.
 		 */
-		Compat_RunCommand(ucmd, job->node, ln);
+		(void)Compat_RunCommand(ucmd, job->node, ln);
 		free(xcmdStart);
 		return;
 	}

Index: src/usr.bin/make/nonints.h
diff -u src/usr.bin/make/nonints.h:1.219 src/usr.bin/make/nonints.h:1.220
--- src/usr.bin/make/nonints.h:1.219	Wed Dec 15 09:53:41 2021
+++ src/usr.bin/make/nonints.h	Wed Dec 15 10:04:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nonints.h,v 1.219 2021/12/15 09:53:41 rillig Exp $	*/
+/*	$NetBSD: nonints.h,v 1.220 2021/12/15 10:04:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -86,7 +86,7 @@ bool Arch_LibOODate(GNode *) MAKE_ATTR_U
 bool Arch_IsLib(GNode *) MAKE_ATTR_USE;
 
 /* compat.c */
-int Compat_RunCommand(const char *, GNode *, StringListNode *);
+bool Compat_RunCommand(const char *, GNode 

CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:54:56 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb.h

Log Message:
Change DCB credit parameters. No functional change.

  - From FreeBSD ix-3.3.24.
  - No functional change because NetBSD doesn't support DCB.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_dcb.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_dcb.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.7 src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.8
--- src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.7	Fri Apr 30 06:41:36 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_dcb.h	Wed Dec 15 09:54:56 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_dcb.h,v 1.7 2021/04/30 06:41:36 msaitoh Exp $ */
+/* $NetBSD: ixgbe_dcb.h,v 1.8 2021/12/15 09:54:56 msaitoh Exp $ */
 /**
   SPDX-License-Identifier: BSD-3-Clause
 
@@ -42,9 +42,9 @@
 /* DCB defines */
 /* DCB credit calculation defines */
 #define IXGBE_DCB_CREDIT_QUANTUM	64
-#define IXGBE_DCB_MAX_CREDIT_REFILL	200   /* 200 * 64B = 12800B */
+#define IXGBE_DCB_MAX_CREDIT_REFILL	511   /* 0x1FF * 64B = 32704B */
 #define IXGBE_DCB_MAX_TSO_SIZE		(32 * 1024) /* Max TSO pkt size in DCB*/
-#define IXGBE_DCB_MAX_CREDIT		(2 * IXGBE_DCB_MAX_CREDIT_REFILL)
+#define IXGBE_DCB_MAX_CREDIT		4095 /* Maximum credit supported: 256KB * 1024 / 64B */
 
 /* 513 for 32KB TSO packet */
 #define IXGBE_DCB_MIN_TSO_CREDIT	\



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:54:56 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb.h

Log Message:
Change DCB credit parameters. No functional change.

  - From FreeBSD ix-3.3.24.
  - No functional change because NetBSD doesn't support DCB.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/ixgbe/ixgbe_dcb.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 09:53:42 UTC 2021

Modified Files:
src/usr.bin/make: dir.h hash.h job.h lst.h make.h make_malloc.h meta.h
metachar.h nonints.h

Log Message:
make: mark several functions whose result must be used

Suggested by sjg, to catch more bugs like the memory leak in cond.c
1.303 from 2021-12-13.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/dir.h
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/hash.h
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/make/job.h
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/make/lst.h
cvs rdiff -u -r1.273 -r1.274 src/usr.bin/make/make.h
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/make_malloc.h
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/meta.h
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/nonints.h

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/make/dir.h
diff -u src/usr.bin/make/dir.h:1.44 src/usr.bin/make/dir.h:1.45
--- src/usr.bin/make/dir.h:1.44	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/dir.h	Wed Dec 15 09:53:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.h,v 1.44 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: dir.h,v 1.45 2021/12/15 09:53:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -82,18 +82,18 @@ void Dir_InitCur(const char *);
 void Dir_InitDot(void);
 void Dir_End(void);
 void Dir_SetPATH(void);
-bool Dir_HasWildcards(const char *);
+bool Dir_HasWildcards(const char *) MAKE_ATTR_USE;
 void SearchPath_Expand(SearchPath *, const char *, StringList *);
-char *Dir_FindFile(const char *, SearchPath *);
-char *Dir_FindHereOrAbove(const char *, const char *);
+char *Dir_FindFile(const char *, SearchPath *) MAKE_ATTR_USE;
+char *Dir_FindHereOrAbove(const char *, const char *) MAKE_ATTR_USE;
 void Dir_UpdateMTime(GNode *, bool);
 CachedDir *SearchPath_Add(SearchPath *, const char *);
-char *SearchPath_ToFlags(SearchPath *, const char *);
+char *SearchPath_ToFlags(SearchPath *, const char *) MAKE_ATTR_USE;
 void SearchPath_Clear(SearchPath *);
 void SearchPath_AddAll(SearchPath *, SearchPath *);
 void Dir_PrintDirectories(void);
 void SearchPath_Print(const SearchPath *);
-SearchPath *Dir_CopyDirSearchPath(void);
+SearchPath *Dir_CopyDirSearchPath(void) MAKE_ATTR_USE;
 
 /* Stripped-down variant of struct stat. */
 struct cached_stat {

Index: src/usr.bin/make/hash.h
diff -u src/usr.bin/make/hash.h:1.41 src/usr.bin/make/hash.h:1.42
--- src/usr.bin/make/hash.h:1.41	Tue Dec  7 21:58:01 2021
+++ src/usr.bin/make/hash.h	Wed Dec 15 09:53:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hash.h,v 1.41 2021/12/07 21:58:01 rillig Exp $	*/
+/*	$NetBSD: hash.h,v 1.42 2021/12/15 09:53:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -108,7 +108,7 @@ typedef struct HashSet {
 	HashTable tbl;
 } HashSet;
 
-MAKE_INLINE void *
+MAKE_INLINE void * MAKE_ATTR_USE
 HashEntry_Get(HashEntry *h)
 {
 	return h->value;
@@ -131,11 +131,13 @@ HashIter_Init(HashIter *hi, HashTable *t
 
 void HashTable_Init(HashTable *);
 void HashTable_Done(HashTable *);
-HashEntry *HashTable_FindEntry(HashTable *, const char *);
-void *HashTable_FindValue(HashTable *, const char *);
-unsigned int Hash_Substring(Substring);
-void *HashTable_FindValueBySubstringHash(HashTable *, Substring, unsigned int);
+HashEntry *HashTable_FindEntry(HashTable *, const char *) MAKE_ATTR_USE;
+void *HashTable_FindValue(HashTable *, const char *) MAKE_ATTR_USE;
+unsigned int Hash_Substring(Substring) MAKE_ATTR_USE;
+void *HashTable_FindValueBySubstringHash(HashTable *, Substring, unsigned int)
+MAKE_ATTR_USE;
 HashEntry *HashTable_CreateEntry(HashTable *, const char *, bool *);
+/* TODO: change return type to void */
 HashEntry *HashTable_Set(HashTable *, const char *, void *);
 void HashTable_DeleteEntry(HashTable *, HashEntry *);
 void HashTable_DebugStats(HashTable *, const char *);
@@ -164,7 +166,7 @@ HashSet_Add(HashSet *set, const char *ke
 	return isNew;
 }
 
-MAKE_INLINE bool
+MAKE_INLINE bool MAKE_ATTR_USE
 HashSet_Contains(HashSet *set, const char *key)
 {
 	return HashTable_FindEntry(>tbl, key) != NULL;

Index: src/usr.bin/make/job.h
diff -u src/usr.bin/make/job.h:1.73 src/usr.bin/make/job.h:1.74
--- src/usr.bin/make/job.h:1.73	Sat Apr  3 11:08:40 2021
+++ src/usr.bin/make/job.h	Wed Dec 15 09:53:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.h,v 1.73 2021/04/03 11:08:40 rillig Exp $	*/
+/*	$NetBSD: job.h,v 1.74 2021/12/15 09:53:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -187,24 +187,25 @@ extern char *shellErrFlag;
 extern int jobTokensRunning;	/* tokens currently "out" */
 
 void Shell_Init(void);
-const char *Shell_GetNewline(void);
+const char *Shell_GetNewline(void) MAKE_ATTR_USE;
 

CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 09:53:42 UTC 2021

Modified Files:
src/usr.bin/make: dir.h hash.h job.h lst.h make.h make_malloc.h meta.h
metachar.h nonints.h

Log Message:
make: mark several functions whose result must be used

Suggested by sjg, to catch more bugs like the memory leak in cond.c
1.303 from 2021-12-13.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/dir.h
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/hash.h
cvs rdiff -u -r1.73 -r1.74 src/usr.bin/make/job.h
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/make/lst.h
cvs rdiff -u -r1.273 -r1.274 src/usr.bin/make/make.h
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/make_malloc.h
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/meta.h
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/metachar.h
cvs rdiff -u -r1.218 -r1.219 src/usr.bin/make/nonints.h

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:52:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb_82598.c

Log Message:
Remove dead code. No functional change.

  FreeBSD: 0b487fb4547ad1a939be0d523e57c94b7cd1
  DPDK:a6395d471e14e5a7432875dad8fb3533238c5167


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.10 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.11
--- src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.10	Fri Dec 10 11:16:54 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c	Wed Dec 15 09:52:44 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_dcb_82598.c,v 1.10 2021/12/10 11:16:54 msaitoh Exp $ */
+/* $NetBSD: ixgbe_dcb_82598.c,v 1.11 2021/12/15 09:52:44 msaitoh Exp $ */
 /**
   SPDX-License-Identifier: BSD-3-Clause
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_dcb_82598.c,v 1.10 2021/12/10 11:16:54 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_dcb_82598.c,v 1.11 2021/12/15 09:52:44 msaitoh Exp $");
 
 #include "ixgbe_type.h"
 #include "ixgbe_dcb.h"
@@ -70,14 +70,6 @@ s32 ixgbe_dcb_get_tc_stats_82598(struct 
 		stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc));
 		/* Received Bytes */
 		stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc));
-
-#if 0
-		/* Can we get rid of these??  Consequently, getting rid
-		 * of the tc_stats structure.
-		 */
-		tc_stats_array[up]->in_overflow_discards = 0;
-		tc_stats_array[up]->out_overflow_discards = 0;
-#endif
 	}
 
 	return IXGBE_SUCCESS;



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:52:44 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_dcb_82598.c

Log Message:
Remove dead code. No functional change.

  FreeBSD: 0b487fb4547ad1a939be0d523e57c94b7cd1
  DPDK:a6395d471e14e5a7432875dad8fb3533238c5167


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:50:21 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c

Log Message:
Check host interface return status. No functional change on NetBSD.

  - FreeBSD: c1a56b6f5ffd6f3180a654d058c1783ccb808e8b or ix-3.3.18
DPDK:db18e37090a3b9af47d6a6886248520f6b220bf9

  Writing to read-only fields returns a non-OK Return Status
  for shadow RAM write command for X550.
  This information was previously discarded.

  - No functional change on NetBSD because our ixg has no interface to
write the NVM.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_x550.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_x550.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.23 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.24
--- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.23	Fri Dec 10 11:31:22 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_x550.c	Wed Dec 15 09:50:21 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_x550.c,v 1.23 2021/12/10 11:31:22 msaitoh Exp $ */
+/* $NetBSD: ixgbe_x550.c,v 1.24 2021/12/15 09:50:21 msaitoh Exp $ */
 
 /**
 
@@ -35,7 +35,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.23 2021/12/10 11:31:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_x550.c,v 1.24 2021/12/15 09:50:21 msaitoh Exp $");
 
 #include "ixgbe_x550.h"
 #include "ixgbe_x540.h"
@@ -3444,7 +3444,17 @@ s32 ixgbe_write_ee_hostif_data_X550(stru
 
 	status = ixgbe_host_interface_command(hw, (u32 *),
 	  sizeof(buffer),
-	  IXGBE_HI_COMMAND_TIMEOUT, FALSE);
+	  IXGBE_HI_COMMAND_TIMEOUT, TRUE);
+	if (status != IXGBE_SUCCESS) {
+		DEBUGOUT2("for offset %04x failed with status %d\n",
+			  offset, status);
+		return status;
+	}
+	if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) {
+		DEBUGOUT2("for offset %04x host interface return status %02x\n",
+			  offset, buffer.hdr.rsp.buf_lenh_status);
+		return IXGBE_ERR_HOST_INTERFACE_COMMAND;
+	}
 
 	return status;
 }



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:50:21 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_x550.c

Log Message:
Check host interface return status. No functional change on NetBSD.

  - FreeBSD: c1a56b6f5ffd6f3180a654d058c1783ccb808e8b or ix-3.3.18
DPDK:db18e37090a3b9af47d6a6886248520f6b220bf9

  Writing to read-only fields returns a non-OK Return Status
  for shadow RAM write command for X550.
  This information was previously discarded.

  - No functional change on NetBSD because our ixg has no interface to
write the NVM.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ixgbe/ixgbe_x550.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/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 09:29:56 UTC 2021

Modified Files:
src/usr.bin/make: buf.c buf.h make.h

Log Message:
make: prevent memory leaks from buffers

The warning about unused function results would have prevented the
memory leak that was fixed in cond.c 1.303 from 2021-12-13.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/make/buf.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/buf.h
cvs rdiff -u -r1.272 -r1.273 src/usr.bin/make/make.h

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



CVS commit: src/usr.bin/make

2021-12-15 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Dec 15 09:29:56 UTC 2021

Modified Files:
src/usr.bin/make: buf.c buf.h make.h

Log Message:
make: prevent memory leaks from buffers

The warning about unused function results would have prevented the
memory leak that was fixed in cond.c 1.303 from 2021-12-13.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/make/buf.c
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/buf.h
cvs rdiff -u -r1.272 -r1.273 src/usr.bin/make/make.h

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/make/buf.c
diff -u src/usr.bin/make/buf.c:1.53 src/usr.bin/make/buf.c:1.54
--- src/usr.bin/make/buf.c:1.53	Sun Nov 28 22:48:06 2021
+++ src/usr.bin/make/buf.c	Wed Dec 15 09:29:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.c,v 1.53 2021/11/28 22:48:06 rillig Exp $	*/
+/*	$NetBSD: buf.c,v 1.54 2021/12/15 09:29:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -75,7 +75,7 @@
 #include "make.h"
 
 /*	"@(#)buf.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: buf.c,v 1.53 2021/11/28 22:48:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: buf.c,v 1.54 2021/12/15 09:29:55 rillig Exp $");
 
 /* Make space in the buffer for adding at least 16 more bytes. */
 void
@@ -214,8 +214,9 @@ Buf_DoneDataCompact(Buffer *buf)
 	if (buf->cap - buf->len >= BUF_COMPACT_LIMIT) {
 		/* We trust realloc to be smart */
 		char *data = bmake_realloc(buf->data, buf->len + 1);
+		buf->data = NULL;
 		data[buf->len] = '\0';	/* XXX: unnecessary */
-		Buf_DoneData(buf);
+		Buf_Done(buf);
 		return data;
 	}
 #endif

Index: src/usr.bin/make/buf.h
diff -u src/usr.bin/make/buf.h:1.44 src/usr.bin/make/buf.h:1.45
--- src/usr.bin/make/buf.h:1.44	Sun Nov 28 22:48:06 2021
+++ src/usr.bin/make/buf.h	Wed Dec 15 09:29:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.44 2021/11/28 22:48:06 rillig Exp $	*/
+/*	$NetBSD: buf.h,v 1.45 2021/12/15 09:29:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -101,7 +101,7 @@ Buf_AddByte(Buffer *buf, char byte)
 	end[1] = '\0';
 }
 
-MAKE_INLINE bool
+MAKE_INLINE bool MAKE_ATTR_USE
 Buf_EndsWith(const Buffer *buf, char ch)
 {
 	return buf->len > 0 && buf->data[buf->len - 1] == ch;
@@ -116,7 +116,7 @@ void Buf_Empty(Buffer *);
 void Buf_Init(Buffer *);
 void Buf_InitSize(Buffer *, size_t);
 void Buf_Done(Buffer *);
-char *Buf_DoneData(Buffer *);
-char *Buf_DoneDataCompact(Buffer *);
+char *Buf_DoneData(Buffer *) MAKE_ATTR_USE;
+char *Buf_DoneDataCompact(Buffer *) MAKE_ATTR_USE;
 
 #endif /* MAKE_BUF_H */

Index: src/usr.bin/make/make.h
diff -u src/usr.bin/make/make.h:1.272 src/usr.bin/make/make.h:1.273
--- src/usr.bin/make/make.h:1.272	Mon Dec 13 22:26:21 2021
+++ src/usr.bin/make/make.h	Wed Dec 15 09:29:55 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: make.h,v 1.272 2021/12/13 22:26:21 rillig Exp $	*/
+/*	$NetBSD: make.h,v 1.273 2021/12/15 09:29:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -130,6 +130,12 @@
 #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg)	/* delete */
 #endif
 
+#if MAKE_GNUC_PREREQ(4, 0)
+#define MAKE_ATTR_USE __attribute__((__warn_unused_result__))
+#else
+#define MAKE_ATTR_USE /* delete */
+#endif
+
 #define MAKE_INLINE static inline MAKE_ATTR_UNUSED
 
 /* MAKE_STATIC marks a function that may or may not be inlined. */



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:19:35 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c ixgbe_type.h

Log Message:
Match X550_PHY_ID correctly on X550.

  - Sync with FreeBSD ix-3.3.18.
- phy_id's revision field is cleared, so use new X550_PHY_ID.
  - Before this commit, phy_id was set to ixgbe_phy_cu_unknown on X550.
Now it's set to ixgbe_phy_aq.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/ixgbe/ixgbe_type.h

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.27 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.28
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.27	Fri Dec 10 11:31:22 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c	Wed Dec 15 09:19:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_phy.c,v 1.27 2021/12/10 11:31:22 msaitoh Exp $ */
+/* $NetBSD: ixgbe_phy.c,v 1.28 2021/12/15 09:19:34 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
 /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 331224 2018-03-19 20:55:05Z erj $*/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.27 2021/12/10 11:31:22 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_phy.c,v 1.28 2021/12/15 09:19:34 msaitoh Exp $");
 
 #include "ixgbe_api.h"
 #include "ixgbe_common.h"
@@ -470,8 +470,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_f
 	case TN1010_PHY_ID:
 		phy_type = ixgbe_phy_tn;
 		break;
-	case X550_PHY_ID2:
-	case X550_PHY_ID3:
+	case X550_PHY_ID:
 	case X540_PHY_ID:
 		phy_type = ixgbe_phy_aq;
 		break;

Index: src/sys/dev/pci/ixgbe/ixgbe_type.h
diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.51 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.52
--- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.51	Fri Dec 10 11:30:09 2021
+++ src/sys/dev/pci/ixgbe/ixgbe_type.h	Wed Dec 15 09:19:34 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.51 2021/12/10 11:30:09 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.52 2021/12/15 09:19:34 msaitoh Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -1714,6 +1714,7 @@ struct ixgbe_dmac_config {
 #define TN1010_PHY_ID	0x00A19410
 #define TNX_FW_REV	0xB
 #define X540_PHY_ID	0x01540200
+#define X550_PHY_ID	0x01540220
 #define X550_PHY_ID2	0x01540223
 #define X550_PHY_ID3	0x01540221
 #define X557_PHY_ID	0x01540240



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 09:19:35 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe_phy.c ixgbe_type.h

Log Message:
Match X550_PHY_ID correctly on X550.

  - Sync with FreeBSD ix-3.3.18.
- phy_id's revision field is cleared, so use new X550_PHY_ID.
  - Before this commit, phy_id was set to ixgbe_phy_cu_unknown on X550.
Now it's set to ixgbe_phy_aq.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/ixgbe/ixgbe_type.h

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



CVS commit: src/tests/lib/libc/gen

2021-12-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Dec 15 09:19:28 UTC 2021

Modified Files:
src/tests/lib/libc/gen: isqemu.h

Log Message:
When running the tests under "qemu -accel kvm" on a Linux host,
isQEMU_TCG() should return false.  Fixes multiple test cases that were
failing with "Test case was expecting a failure but none were raised"
on that platform.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/isqemu.h

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

Modified files:

Index: src/tests/lib/libc/gen/isqemu.h
diff -u src/tests/lib/libc/gen/isqemu.h:1.5 src/tests/lib/libc/gen/isqemu.h:1.6
--- src/tests/lib/libc/gen/isqemu.h:1.5	Sun Aug 23 11:00:18 2020
+++ src/tests/lib/libc/gen/isqemu.h	Wed Dec 15 09:19:28 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: isqemu.h,v 1.5 2020/08/23 11:00:18 gson Exp $	*/
+/*	$NetBSD: isqemu.h,v 1.6 2021/12/15 09:19:28 gson Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -72,10 +72,18 @@ isQEMU_TCG(void) {
 			return false;
 		err(EXIT_FAILURE, "sysctl");
 	}
-	return strstr(name, "QEMU") != NULL;
-#else
-	return false;
+	if (strstr(name, "QEMU") == NULL)
+		return false;
+	if (sysctlbyname("machdep.hypervisor", name, , NULL, 0) == -1) {
+		if (errno == ENOENT)
+			return true;
+		err(EXIT_FAILURE, "sysctl");
+	}
+	if (strcmp(name, "KVM") == 0)
+		return false;
+	return true;
 #endif
+	return false;
 }
 
 #ifdef TEST



CVS commit: src/tests/lib/libc/gen

2021-12-15 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Dec 15 09:19:28 UTC 2021

Modified Files:
src/tests/lib/libc/gen: isqemu.h

Log Message:
When running the tests under "qemu -accel kvm" on a Linux host,
isQEMU_TCG() should return false.  Fixes multiple test cases that were
failing with "Test case was expecting a failure but none were raised"
on that platform.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/gen/isqemu.h

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



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 08:42:48 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Improve PHY's dmesg output for non-MIIVERBOSE case.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/sys/dev/pci/ixgbe/ixgbe.c

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

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.298 src/sys/dev/pci/ixgbe/ixgbe.c:1.299
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.298	Tue Dec 14 05:31:12 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Dec 15 08:42:48 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.298 2021/12/14 05:31:12 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.299 2021/12/15 08:42:48 msaitoh Exp $ */
 
 /**
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.298 2021/12/14 05:31:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.299 2021/12/15 08:42:48 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1185,9 +1185,8 @@ ixgbe_attach(device_t parent, device_t d
 		rev = MII_REV(id2);
 		mii_get_descr(descr, sizeof(descr), oui, model);
 		if (descr[0])
-			aprint_normal_dev(dev,
-			"PHY: %s (OUI 0x%06x, model 0x%04x), rev. %d\n",
-			descr, oui, model, rev);
+			aprint_normal_dev(dev, "PHY: %s, rev. %d\n",
+			descr, rev);
 		else
 			aprint_normal_dev(dev,
 			"PHY OUI 0x%06x, model 0x%04x, rev. %d\n",



CVS commit: src/sys/dev/pci/ixgbe

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 08:42:48 UTC 2021

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c

Log Message:
Improve PHY's dmesg output for non-MIIVERBOSE case.


To generate a diff of this commit:
cvs rdiff -u -r1.298 -r1.299 src/sys/dev/pci/ixgbe/ixgbe.c

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



CVS commit: src/sys/dev/mii

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 08:28:22 UTC 2021

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
Cosmetic change for the output of mii_get_descr().


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/mii/mii_physubr.c

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

Modified files:

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.95 src/sys/dev/mii/mii_physubr.c:1.96
--- src/sys/dev/mii/mii_physubr.c:1.95	Tue Jun 29 21:03:36 2021
+++ src/sys/dev/mii/mii_physubr.c	Wed Dec 15 08:28:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.95 2021/06/29 21:03:36 pgoyette Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.96 2021/12/15 08:28:22 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.95 2021/06/29 21:03:36 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.96 2021/12/15 08:28:22 msaitoh Exp $");
 
 #include 
 #include 
@@ -79,7 +79,7 @@ mii_get_descr(char *descr, size_t len, u
 		strlcat(descr, temp, len);
 		return descr;
 	}
-	snprintf(descr, len, "oui 0x%6x model 0x%04x", oui, model);
+	snprintf(descr, len, "OUI 0x%06x model 0x%04x", oui, model);
 	return NULL;
 }
 



CVS commit: src/sys/dev/mii

2021-12-15 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 15 08:28:22 UTC 2021

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
Cosmetic change for the output of mii_get_descr().


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/mii/mii_physubr.c

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