CVS commit: src/lib/libc

2023-07-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul  2 00:52:04 UTC 2023

Modified Files:
src/lib/libc: shlib_version

Log Message:
libc/shlib_version: note that *rand48* should be punted to libcompat


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 src/lib/libc/shlib_version

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



CVS commit: src/lib/libc

2023-07-01 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul  2 00:52:04 UTC 2023

Modified Files:
src/lib/libc: shlib_version

Log Message:
libc/shlib_version: note that *rand48* should be punted to libcompat


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 src/lib/libc/shlib_version

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

Modified files:

Index: src/lib/libc/shlib_version
diff -u src/lib/libc/shlib_version:1.293 src/lib/libc/shlib_version:1.294
--- src/lib/libc/shlib_version:1.293	Mon Nov  1 05:53:45 2021
+++ src/lib/libc/shlib_version	Sun Jul  2 00:52:04 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: shlib_version,v 1.293 2021/11/01 05:53:45 thorpej Exp $
+#	$NetBSD: shlib_version,v 1.294 2023/07/02 00:52:04 dholland Exp $
 #	Remember to update distrib/sets/lists/base/shl.* when changing
 #
 # things we wish to do on next major version bump:
@@ -53,5 +53,6 @@
 # - move statfs() to libcompat since we have statvfs()
 # - the syscall stubs for the (obsolete) lfs syscalls should be removed
 # - remove tzsetwall(3), upstream has removed it
+# - move *rand48* to libcompat
 major=12
 minor=220



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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 20:57:37 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: decl_direct_abstract.c

Log Message:
tests/lint: rework tests for type names


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.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/lint1/decl_direct_abstract.c
diff -u src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.8 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.9
--- src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c:1.8	Tue Mar 28 14:44:34 2023
+++ src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c	Sat Jul  1 20:57:37 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: decl_direct_abstract.c,v 1.8 2023/03/28 14:44:34 rillig Exp $	*/
+/*	$NetBSD: decl_direct_abstract.c,v 1.9 2023/07/01 20:57:37 rillig Exp $	*/
 # 3 "decl_direct_abstract.c"
 
 /*
@@ -11,58 +11,67 @@
 
 /* lint1-extra-flags: -X 351 */
 
-/*
- * The following tests do not use int, to avoid confusion with the implicit
- * return type.
- */
-
-char func0001(short (*)(long));
-
-/* GCC says 'char (*)(short int (*)(long int))' */
-/* Clang says 'char (short (*)(long))' */
-/* cdecl says 'function (pointer to function (long) returning short) returning char' */
-/* expect+1: error: cannot initialize 'double' from 'pointer to function(pointer to function(long) returning short) returning char' [185] */
-double type_of_func0001 = func0001;
-
-char func0002(short *(long));
-
-/* GCC says 'char (*)(short int * (*)(long int))' */
-/* Clang says 'char (short *(*)(long))' */
-/* cdecl says 'syntax error' */
-/* FIXME: lint is wrong, it discards the 'short *' */
-/* expect+1: error: cannot initialize 'double' from 'pointer to function(long) returning char' [185] */
-double type_of_func0002 = func0002;
-
-void c99_6_7_6_example_a(int);
-void c99_6_7_6_example_b(int *);
-void c99_6_7_6_example_c(int *[3]);
-void c99_6_7_6_example_d(int (*)[3]);
-void c99_6_7_6_example_e(int (*)[*]);
-void c99_6_7_6_example_f(int *());
-void c99_6_7_6_example_g(int (*)(void));
-void c99_6_7_6_example_h(int (*const[])(unsigned int, ...));
-
 struct incompatible {
 	int member;
 } x;
 
-/* expect+1: ... 'pointer to function(int) returning void' ... */
-double type_of_c99_6_7_6_example_a = c99_6_7_6_example_a;
-/* expect+1: ... 'pointer to function(pointer to int) returning void' ... */
-double type_of_c99_6_7_6_example_b = c99_6_7_6_example_b;
-/* expect+1: ... 'pointer to function(pointer to pointer to int) returning void' ... */
-double type_of_c99_6_7_6_example_c = c99_6_7_6_example_c;
-/* expect+1: ... 'pointer to function(pointer to array[3] of int) returning void' ... */
-double type_of_c99_6_7_6_example_d = c99_6_7_6_example_d;
-/* expect+1: ... 'pointer to function(pointer to array[unknown_size] of int) returning void' ... */
-double type_of_c99_6_7_6_example_e = c99_6_7_6_example_e;
-/* Wrong type before decl.c 1.256 from 2022-04-01. */
-/* expect+1: ... 'pointer to function(pointer to function() returning pointer to int) returning void' ... */
-double type_of_c99_6_7_6_example_f = c99_6_7_6_example_f;
-/* expect+1: ... 'pointer to function(pointer to function(void) returning int) returning void' ... */
-double type_of_c99_6_7_6_example_g = c99_6_7_6_example_g;
-/* expect+1: ... 'pointer to function(pointer to const pointer to function(unsigned int, ...) returning int) returning void' ... */
-double type_of_c99_6_7_6_example_h = c99_6_7_6_example_h;
+void
+c99_6_7_6_examples(void)
+{
+	/* expect+1: ... 'int' ... */
+	x = (int)x;
+	/* expect+1: ... 'pointer to int' ... */
+	x = (int *)x;
+	/* expect+1: ... 'array[3] of pointer to int' ... */
+	x = (int *[3])x;
+	/* expect+1: ... 'pointer to array[3] of int' ... */
+	x = (int (*)[3])x;
+	/* expect+1: ... 'pointer to array[unknown_size] of int' ... */
+	x = (int (*)[*])x;
+	/* expect+1: ... 'function() returning pointer to int' ... */
+	x = (int *())x;
+	/* expect+1: ... 'pointer to function(void) returning int' ... */
+	x = (int (*)(void))x;
+	/* expect+1: ... 'array[unknown_size] of const pointer to function(unsigned int, ...) returning int' ... */
+	x = (int (*const[])(unsigned int, ...))x;
+}
+
+void
+function_returning_char(void)
+{
+	// GCC adds a pointer, then says 'char (*)(short int (*)(long int))'.
+	// Clang says 'char (short (*)(long))'.
+	/* cdecl says 'function (pointer to function (long) returning short) returning char' */
+	/* FIXME: It's a function type, not only 'short'. */
+	/* expect+1: ... 'short' ... */
+	x = (char(short (*)(long)))x;
+
+	/* expect+1: warning: nested 'extern' declaration of 'f1' [352] */
+	char f1(short (*)(long));
+
+	/* expect+1: ... 'pointer to function(pointer to function(long) returning short) returning char' ... */
+	x = f1;
+}
+
+void
+function_returning_pointer(void)
+{
+	// GCC says 'error: cast specifies 

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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 20:57:37 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: decl_direct_abstract.c

Log Message:
tests/lint: rework tests for type names


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/decl_direct_abstract.c

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/lib/dri.old

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 15:16:46 UTC 2023

Modified Files:
src/external/mit/xorg/lib/dri.old: Makefile

Log Message:
dri.old: only disable lint for a single file


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/dri.old/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/lib/dri.old/Makefile
diff -u src/external/mit/xorg/lib/dri.old/Makefile:1.4 src/external/mit/xorg/lib/dri.old/Makefile:1.5
--- src/external/mit/xorg/lib/dri.old/Makefile:1.4	Thu Sep 29 18:58:04 2022
+++ src/external/mit/xorg/lib/dri.old/Makefile	Sat Jul  1 15:16:46 2023
@@ -1,9 +1,12 @@
-# $NetBSD: Makefile,v 1.4 2022/09/29 18:58:04 rjs Exp $
+# $NetBSD: Makefile,v 1.5 2023/07/01 15:16:46 rillig Exp $
 
 # Link the mesa_dri_drivers mega driver.
 
-# XXX: anonymous structs inside anonymous unions don't work.
-NOLINT=yes
+# When build_id.c expands the macro invocation 'ElfW(Nhdr)', the result is
+# 'Elf64 /* MD native binary size */ _Nhdr'. The comment prevents the two
+# identifiers from being concatenated.
+build_id.ln:
+	touch $@
 
 .include 
 



CVS commit: src/external/mit/xorg/lib/dri.old

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 15:16:46 UTC 2023

Modified Files:
src/external/mit/xorg/lib/dri.old: Makefile

Log Message:
dri.old: only disable lint for a single file


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/dri.old/Makefile

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



CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:48 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.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/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:48 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs.h hdaudiodevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/hdaudio/hdaudiodevs.h \
src/sys/dev/hdaudio/hdaudiodevs_data.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/hdaudio/hdaudiodevs.h
diff -u src/sys/dev/hdaudio/hdaudiodevs.h:1.7 src/sys/dev/hdaudio/hdaudiodevs.h:1.8
--- src/sys/dev/hdaudio/hdaudiodevs.h:1.7	Sat Apr 16 12:25:10 2022
+++ src/sys/dev/hdaudio/hdaudiodevs.h	Sat Jul  1 13:37:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdaudiodevs.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -90,6 +90,7 @@
 #define	HDAUDIO_PRODUCT_REALTEK_ALC662	0x0662		/* ALC662 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC663	0x0663		/* ALC663 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC670	0x0670		/* ALC670 */
+#define	HDAUDIO_PRODUCT_REALTEK_ALC671	0x0671		/* ALC671 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC861	0x0861		/* ALC861 */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC861_VD	0x0862		/* ALC861-VD */
 #define	HDAUDIO_PRODUCT_REALTEK_ALC880	0x0880		/* ALC880 */
Index: src/sys/dev/hdaudio/hdaudiodevs_data.h
diff -u src/sys/dev/hdaudio/hdaudiodevs_data.h:1.7 src/sys/dev/hdaudio/hdaudiodevs_data.h:1.8
--- src/sys/dev/hdaudio/hdaudiodevs_data.h:1.7	Sat Apr 16 12:25:10 2022
+++ src/sys/dev/hdaudio/hdaudiodevs_data.h	Sat Jul  1 13:37:48 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdaudiodevs_data.h,v 1.7 2022/04/16 12:25:10 nia Exp $	*/
+/*	$NetBSD: hdaudiodevs_data.h,v 1.8 2023/07/01 13:37:48 nia Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -114,174 +114,176 @@ static const uint32_t hdaudio_products[]
 	275, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC670, 
 	282, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC671, 
 	289, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861, 
 	296, 0,
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC861_VD, 
+	303, 0,
 	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC880, 
-	306, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	313, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC882, 
 	320, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC883, 
 	327, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC885, 
 	334, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC887, 
 	341, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC888, 
 	348, 0,
-	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC889, 
 	355, 0,
-	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	HDAUDIO_VENDOR_REALTEK, HDAUDIO_PRODUCT_REALTEK_ALC892, 
 	362, 0,
+	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708, 
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170A, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT170B, 
-	362, 0,
+	369, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_0, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_1, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_2, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_10CH_3, 
-	369, 376, 0,
+	376, 383, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_4, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_5, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_6, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1709_6CH_7, 
-	369, 381, 0,
+	376, 388, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708B_8CH_0, 
-	385, 393, 0,
+	392, 400, 0,
 	HDAUDIO_VENDOR_VIATECH, HDAUDIO_PRODUCT_VIATECH_VT1708B_8CH_1, 
-	385, 393, 0,
+	392, 400, 0,
 	HDAUDIO_VENDOR_VIATECH, 

CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:36 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC671 to hdaudiodevs, seen on Fujitsu Futro S720 thin client


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs

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



CVS commit: src/sys/dev/hdaudio

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 13:37:36 UTC 2023

Modified Files:
src/sys/dev/hdaudio: hdaudiodevs

Log Message:
Add Realtek ALC671 to hdaudiodevs, seen on Fujitsu Futro S720 thin client


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/hdaudio/hdaudiodevs

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/hdaudio/hdaudiodevs
diff -u src/sys/dev/hdaudio/hdaudiodevs:1.6 src/sys/dev/hdaudio/hdaudiodevs:1.7
--- src/sys/dev/hdaudio/hdaudiodevs:1.6	Sat Apr 16 12:24:06 2022
+++ src/sys/dev/hdaudio/hdaudiodevs	Sat Jul  1 13:37:36 2023
@@ -1,4 +1,4 @@
-$NetBSD: hdaudiodevs,v 1.6 2022/04/16 12:24:06 nia Exp $
+$NetBSD: hdaudiodevs,v 1.7 2023/07/01 13:37:36 nia Exp $
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -83,6 +83,7 @@ product	REALTEK		ALC660_VD	0x0660	ALC660
 product	REALTEK		ALC662		0x0662	ALC662
 product	REALTEK		ALC663		0x0663	ALC663
 product	REALTEK		ALC670		0x0670	ALC670
+product REALTEK		ALC671		0x0671	ALC671
 product	REALTEK		ALC861		0x0861	ALC861
 product	REALTEK		ALC861_VD	0x0862	ALC861-VD
 product	REALTEK		ALC880		0x0880	ALC880



CVS commit: src/usr.sbin/ifwatchd

2023-07-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul  1 12:36:10 UTC 2023

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Don't call UP script when an IP address becomes deprecated.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/ifwatchd/ifwatchd.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.sbin/ifwatchd/ifwatchd.c
diff -u src/usr.sbin/ifwatchd/ifwatchd.c:1.46 src/usr.sbin/ifwatchd/ifwatchd.c:1.47
--- src/usr.sbin/ifwatchd/ifwatchd.c:1.46	Sun Oct  4 20:36:32 2020
+++ src/usr.sbin/ifwatchd/ifwatchd.c	Sat Jul  1 12:36:10 2023
@@ -1,6 +1,6 @@
-/*	$NetBSD: ifwatchd.c,v 1.46 2020/10/04 20:36:32 roy Exp $	*/
+/*	$NetBSD: ifwatchd.c,v 1.47 2023/07/01 12:36:10 mlelstv Exp $	*/
 #include 
-__RCSID("$NetBSD: ifwatchd.c,v 1.46 2020/10/04 20:36:32 roy Exp $");
+__RCSID("$NetBSD: ifwatchd.c,v 1.47 2023/07/01 12:36:10 mlelstv Exp $");
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@ __RCSID("$NetBSD: ifwatchd.c,v 1.46 2020
 #include 
 
 enum event { ARRIVAL, DEPARTURE, UP, DOWN, CARRIER, NO_CARRIER };
-enum addrflag { NOTREADY, DETACHED, READY };
+enum addrflag { NOTREADY, DETACHED, DEPRECATED, READY };
 
 /* local functions */
 __dead static void usage(void);
@@ -303,6 +303,8 @@ check_addrflags(int af, int addrflags)
 			return NOTREADY;
 		if (addrflags & IN6_IFF_DETACHED)
 			return DETACHED;
+		if (addrflags & IN6_IFF_DEPRECATED)
+			return DEPRECATED;
 		break;
 	}
 	return READY;



CVS commit: src/usr.sbin/ifwatchd

2023-07-01 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul  1 12:36:10 UTC 2023

Modified Files:
src/usr.sbin/ifwatchd: ifwatchd.c

Log Message:
Don't call UP script when an IP address becomes deprecated.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/ifwatchd/ifwatchd.c

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



CVS commit: src/games/tetris

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 10:51:35 UTC 2023

Modified Files:
src/games/tetris: tetris.6 tetris.c

Log Message:
tetris(6): Support the informal standard of allowing setting NO_COLOR
in the environment to disable the use of color. (no-color.org)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/games/tetris/tetris.6
cvs rdiff -u -r1.33 -r1.34 src/games/tetris/tetris.c

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

Modified files:

Index: src/games/tetris/tetris.6
diff -u src/games/tetris/tetris.6:1.17 src/games/tetris/tetris.6:1.18
--- src/games/tetris/tetris.6:1.17	Sat Mar 12 03:14:59 2016
+++ src/games/tetris/tetris.6	Sat Jul  1 10:51:35 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: tetris.6,v 1.17 2016/03/12 03:14:59 dholland Exp $
+.\"	$NetBSD: tetris.6,v 1.18 2023/07/01 10:51:35 nia Exp $
 .\"
 .\" Copyright (c) 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)tetris.6	8.1 (Berkeley) 5/31/93
 .\"
-.Dd February 18, 2015
+.Dd July 1, 2023
 .Dt TETRIS 6
 .Os
 .Sh NAME
@@ -146,6 +146,11 @@ name, score, and how many points were sc
 Scores which are the highest on a given level
 are marked with asterisks
 .Dq * .
+.Sh ENVIRONMENT
+.Nm
+honors the informal standard
+.Dv NO_COLOR .
+When it is set in the environment, no color will be used.
 .Sh FILES
 .Bl -tag -width /var/games/tetris.scoresxx
 .It /var/games/tetris.scores

Index: src/games/tetris/tetris.c
diff -u src/games/tetris/tetris.c:1.33 src/games/tetris/tetris.c:1.34
--- src/games/tetris/tetris.c:1.33	Tue Jul 21 02:42:05 2020
+++ src/games/tetris/tetris.c	Sat Jul  1 10:51:35 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tetris.c,v 1.33 2020/07/21 02:42:05 nia Exp $	*/
+/*	$NetBSD: tetris.c,v 1.34 2023/07/01 10:51:35 nia Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -135,6 +135,7 @@ main(int argc, char *argv[])
 	int level = 2;
 #define NUMKEYS 7
 	char key_write[NUMKEYS][10];
+	char *nocolor_env;
 	int ch, i, j;
 	int fd;
 
@@ -182,6 +183,11 @@ main(int argc, char *argv[])
 	if (argc)
 		usage();
 
+	nocolor_env = getenv("NO_COLOR");
+
+	if (nocolor_env != NULL && nocolor_env[0] != '\0')
+		nocolor = 1;
+
 	fallrate = 100 / level;
 
 	for (i = 0; i <= (NUMKEYS-1); i++) {



CVS commit: src/games/tetris

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 10:51:35 UTC 2023

Modified Files:
src/games/tetris: tetris.6 tetris.c

Log Message:
tetris(6): Support the informal standard of allowing setting NO_COLOR
in the environment to disable the use of color. (no-color.org)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/games/tetris/tetris.6
cvs rdiff -u -r1.33 -r1.34 src/games/tetris/tetris.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/aiomixer

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 10:47:12 UTC 2023

Modified Files:
src/usr.bin/aiomixer: aiomixer.1

Log Message:
Use ENVIRONMENT section


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/aiomixer/aiomixer.1

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/aiomixer/aiomixer.1
diff -u src/usr.bin/aiomixer/aiomixer.1:1.2 src/usr.bin/aiomixer/aiomixer.1:1.3
--- src/usr.bin/aiomixer/aiomixer.1:1.2	Thu Jun 29 19:06:54 2023
+++ src/usr.bin/aiomixer/aiomixer.1	Sat Jul  1 10:47:12 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: aiomixer.1,v 1.2 2023/06/29 19:06:54 nia Exp $
+.\" $NetBSD: aiomixer.1,v 1.3 2023/07/01 10:47:12 nia Exp $
 .\"
 .\" Copyright (c) 2021 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd July 29, 2023
+.Dd July 1, 2023
 .Dt AIOMIXER 1
 .Os
 .Sh NAME
@@ -67,7 +67,7 @@ Used to specify an alternative mixer dev
 .It Fl u
 Used to unlock channels on start up.
 .El
-.Pp
+.Sh ENVIRONMENT
 .Nm
 honours the informal standard
 .Dv NO_COLOR .



CVS commit: src/usr.bin/aiomixer

2023-07-01 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Jul  1 10:47:12 UTC 2023

Modified Files:
src/usr.bin/aiomixer: aiomixer.1

Log Message:
Use ENVIRONMENT section


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/aiomixer/aiomixer.1

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



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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 10:04:27 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: constify, reduce indentation

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.331 -r1.332 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.541 -r1.542 src/usr.bin/xlint/lint1/tree.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/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.331 src/usr.bin/xlint/lint1/decl.c:1.332
--- src/usr.bin/xlint/lint1/decl.c:1.331	Sat Jul  1 09:31:55 2023
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul  1 10:04:27 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.331 2023/07/01 09:31:55 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.332 2023/07/01 10:04:27 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.331 2023/07/01 09:31:55 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.332 2023/07/01 10:04:27 rillig Exp $");
 #endif
 
 #include 
@@ -424,7 +424,7 @@ set_first_typedef(type_t *tp, sym_t *sym
 }
 
 static unsigned int
-bit_fields_width(sym_t **mem, bool *named)
+bit_fields_width(const sym_t **mem, bool *named)
 {
 	unsigned int width = 0;
 	unsigned int align = 0;
@@ -452,7 +452,7 @@ pack_struct_or_union(type_t *tp)
 
 	unsigned int bits = 0;
 	bool named = false;
-	for (sym_t *mem = tp->t_sou->sou_first_member;
+	for (const sym_t *mem = tp->t_sou->sou_first_member;
 	 mem != NULL; mem = mem->s_next) {
 		// TODO: Maybe update mem->u.s_member.sm_offset_in_bits.
 		if (mem->s_type->t_bitfield) {

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.541 src/usr.bin/xlint/lint1/tree.c:1.542
--- src/usr.bin/xlint/lint1/tree.c:1.541	Sat Jul  1 09:31:55 2023
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul  1 10:04:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.541 2023/07/01 09:31:55 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.542 2023/07/01 10:04:27 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.541 2023/07/01 09:31:55 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.542 2023/07/01 10:04:27 rillig Exp $");
 #endif
 
 #include 
@@ -4014,6 +4014,11 @@ type_size_in_bits(const type_t *tp)
 
 	unsigned int elsz;
 	switch (tp->t_tspec) {
+	case VOID:
+		/* cannot take size/alignment of void */
+		error(146);
+		elsz = 1;
+		break;
 	case FUNC:
 		/* cannot take size/alignment of function type '%s' */
 		error(144, type_name(tp));
@@ -4040,14 +4045,8 @@ type_size_in_bits(const type_t *tp)
 			/* cannot take size/alignment of bit-field */
 			error(145);
 		}
-		if (tp->t_tspec == VOID) {
-			/* cannot take size/alignment of void */
-			error(146);
-			elsz = 1;
-		} else {
-			elsz = size_in_bits(tp->t_tspec);
-			lint_assert(elsz > 0);
-		}
+		elsz = size_in_bits(tp->t_tspec);
+		lint_assert(elsz > 0);
 		break;
 	}
 



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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 10:04:27 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: decl.c tree.c

Log Message:
lint: constify, reduce indentation

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.331 -r1.332 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.541 -r1.542 src/usr.bin/xlint/lint1/tree.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/xlint/lint1

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:59:51 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: lint1.h

Log Message:
lint: clean up comments in lint1.h


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/usr.bin/xlint/lint1/lint1.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/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.173 src/usr.bin/xlint/lint1/lint1.h:1.174
--- src/usr.bin/xlint/lint1/lint1.h:1.173	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/lint1.h	Sat Jul  1 09:59:51 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.173 2023/06/30 21:39:54 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.174 2023/07/01 09:59:51 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -112,13 +112,12 @@ typedef struct {
 
 /*
  * Structures of type struct_or_union uniquely identify structures. This can't
- * be done in structures of type type_t, because these are copied
- * if they must be modified. So it would not be possible to check
- * if two structures are identical by comparing the pointers to
- * the type structures.
+ * be done in structures of type type_t, because these are copied if they must
+ * be modified. So it would not be possible to check if two structures are
+ * identical by comparing the pointers to the type structures.
  *
- * The typename is used if the structure is unnamed to identify
- * the structure type in pass 2.
+ * If the structure has no tag name, its first typedef name is used to identify
+ * the structure in lint2.
  */
 typedef	struct {
 	unsigned int sou_size_in_bits;
@@ -241,7 +240,7 @@ typedef	struct sym {
  * pointer to the external symbol with the
  * same name */
 	def_t	s_def;		/* declared, tentative defined, defined */
-	scl_t	s_scl;		/* storage class */
+	scl_t	s_scl;		/* storage class, more or less */
 	int	s_block_level;	/* level of declaration, -1 if not in symbol
    table */
 	type_t	*s_type;
@@ -352,8 +351,8 @@ typedef	struct decl_level {
 	tspec_t	d_sign_mod;	/* SIGNED or UNSIGN */
 	tspec_t	d_rank_mod;	/* SHORT, LONG or QUAD */
 	scl_t	d_scl;		/* storage class */
-	type_t	*d_type;	/* after dcs_end_type pointer to the type used
-   for all declarators */
+	type_t	*d_type;	/* after dcs_end_type, the pointer to the type
+ * used for all declarators */
 	sym_t	*d_redeclared_symbol;
 	unsigned int d_offset_in_bits; /* offset of next structure member */
 	unsigned short d_sou_align_in_bits; /* alignment required for current
@@ -363,17 +362,20 @@ typedef	struct decl_level {
 	bool	d_inline:1;	/* inline in declaration specifiers */
 	bool	d_multiple_storage_classes:1; /* reported in dcs_end_type */
 	bool	d_invalid_type_combination:1;
-	bool	d_nonempty_decl:1; /* if at least one tag is declared
- * ... in the current function decl. */
+	bool	d_nonempty_decl:1; /* in a function declaration, whether at
+ * least one tag was declared */
 	bool	d_vararg:1;
-	bool	d_prototype:1;	/* current function decl. is a prototype */
+	bool	d_prototype:1;	/* in a function declaration, whether the
+ * function has a prototype */
 	bool	d_no_type_specifier:1;
 	bool	d_asm:1;	/* set if d_ctx == AUTO and asm() present */
 	bool	d_packed:1;
 	bool	d_used:1;
-	type_t	*d_tag_type;	/* tag during member declaration */
-	sym_t	*d_func_args;	/* list of arguments during function def. */
-	pos_t	d_func_def_pos;	/* position of function definition */
+	type_t	*d_tag_type;	/* during a member declaration, the tag type to
+ * which the member belongs */
+	sym_t	*d_func_args;	/* during a function declaration, the list of
+ * arguments */
+	pos_t	d_func_def_pos;	/* position of the function definition */
 	sym_t	*d_first_dlsym;	/* first symbol declared at this level */
 	sym_t	**d_last_dlsym;	/* points to s_level_next in the last symbol
    declaration at this level */



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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:59:51 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: lint1.h

Log Message:
lint: clean up comments in lint1.h


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/usr.bin/xlint/lint1/lint1.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/xlint/lint1

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:31:56 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h func.c tree.c

Log Message:
lint: clean up duplicate and dead code for integer constants

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.184 -r1.185 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.160 -r1.161 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.540 -r1.541 src/usr.bin/xlint/lint1/tree.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/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.330 src/usr.bin/xlint/lint1/decl.c:1.331
--- src/usr.bin/xlint/lint1/decl.c:1.330	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/decl.c	Sat Jul  1 09:31:55 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.330 2023/06/30 21:39:54 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.331 2023/07/01 09:31:55 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.330 2023/06/30 21:39:54 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.331 2023/07/01 09:31:55 rillig Exp $");
 #endif
 
 #include 
@@ -3195,7 +3195,10 @@ to_int_constant(tnode_t *tn, bool requir
 	if (tn == NULL)
 		return 1;
 
-	val_t *v = constant(tn, required);
+	val_t *v = integer_constant(tn, required);
+	bool is_unsigned = is_uinteger(v->v_tspec);
+	int64_t val = v->v_quad;
+	free(v);
 
 	/*
 	 * Abstract declarations are used inside expression. To free
@@ -3206,28 +3209,11 @@ to_int_constant(tnode_t *tn, bool requir
 	if (tn->tn_op != CON && dcs->d_kind != DLK_ABSTRACT)
 		expr_free_all();
 
-	tspec_t t = v->v_tspec;
-	int i;
-	if (t == FLOAT || t == DOUBLE || t == LDOUBLE) {
-		i = (int)v->v_ldbl;
-		/* integral constant expression expected */
-		error(55);
-	} else {
-		i = (int)v->v_quad;
-		if (is_uinteger(t)) {
-			if ((uint64_t)v->v_quad > (uint64_t)TARG_INT_MAX) {
-/* integral constant too large */
-warning(56);
-			}
-		} else {
-			if (v->v_quad > (int64_t)TARG_INT_MAX ||
-			v->v_quad < (int64_t)TARG_INT_MIN) {
-/* integral constant too large */
-warning(56);
-			}
-		}
-	}
-
-	free(v);
-	return i;
+	bool out_of_bounds = is_unsigned
+	? (uint64_t)val > (uint64_t)TARG_INT_MAX
+	: val > (int64_t)TARG_INT_MAX || val < (int64_t)TARG_INT_MIN;
+	if (out_of_bounds)
+		/* integral constant too large */
+		warning(56);
+	return (int)val;
 }

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.184 src/usr.bin/xlint/lint1/externs1.h:1.185
--- src/usr.bin/xlint/lint1/externs1.h:1.184	Sat Jul  1 06:09:24 2023
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul  1 09:31:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.184 2023/07/01 06:09:24 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.185 2023/07/01 09:31:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -269,7 +269,7 @@ tnode_t	*build_alignof(const type_t *);
 tnode_t	*cast(tnode_t *, type_t *);
 tnode_t	*build_function_argument(tnode_t *, tnode_t *);
 tnode_t	*build_function_call(tnode_t *, bool, tnode_t *);
-val_t	*constant(tnode_t *, bool);
+val_t	*integer_constant(tnode_t *, bool);
 void	expr(tnode_t *, bool, bool, bool, bool);
 void	check_expr_misc(const tnode_t *, bool, bool, bool, bool, bool, bool);
 bool	constant_addr(const tnode_t *, const sym_t **, ptrdiff_t *);

Index: src/usr.bin/xlint/lint1/func.c
diff -u src/usr.bin/xlint/lint1/func.c:1.160 src/usr.bin/xlint/lint1/func.c:1.161
--- src/usr.bin/xlint/lint1/func.c:1.160	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/func.c	Sat Jul  1 09:31:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: func.c,v 1.160 2023/06/30 21:39:54 rillig Exp $	*/
+/*	$NetBSD: func.c,v 1.161 2023/07/01 09:31:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: func.c,v 1.160 2023/06/30 21:39:54 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.161 2023/07/01 09:31:55 rillig Exp $");
 #endif
 
 #include 
@@ -533,7 +533,7 @@ check_case_label(tnode_t *tn, control_st
 	 * get the value of the expression and convert it
 	 * to the type of the switch expression
 	 */
-	v = constant(tn, true);
+	v = integer_constant(tn, true);
 	(void)memset(, 0, sizeof(nv));
 	convert_constant(CASE, 0, cs->c_switch_type, , v);
 	free(v);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.540 src/usr.bin/xlint/lint1/tree.c:1.541
--- src/usr.bin/xlint/lint1/tree.c:1.540	Sat Jul  1 09:21:31 2023
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul  1 09:31:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.540 2023/07/01 09:21:31 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.541 2023/07/01 09:31:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 

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

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:31:56 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: decl.c externs1.h func.c tree.c

Log Message:
lint: clean up duplicate and dead code for integer constants

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.184 -r1.185 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.160 -r1.161 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.540 -r1.541 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/doc

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:21:48 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.2978 -r1.2979 src/doc/CHANGES

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



CVS commit: src/doc

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:21:48 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.2978 -r1.2979 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2978 src/doc/CHANGES:1.2979
--- src/doc/CHANGES:1.2978	Fri Jun 30 21:48:15 2023
+++ src/doc/CHANGES	Sat Jul  1 09:21:47 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2978 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2979 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -139,12 +139,12 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		GNU patch doesn't. [wiz 20230616]
 	indent(1): Remove support for handling ASCII backspace characters
 		in C code. [rillig 20230618]
-	make(1): Recognize include guards. [rilling 20230619]
+	make(1): Recognize include guards. [rillig 20230619]
 	pam(8): Disable pam_krb5, pam_ksu by default. [riastradh 20230620]
 	editline(3): Install pkg-config files, same as the portable version.
 		[wiz 20230620]
 	make(1): Speed up pattern matching in the ':M' and ':N' modifiers.
-		[reinoud 20230622]
+		[rillig 20230622]
 	paxctl(8): Introduce -0 option to clear all PaX flag bits in ELF note.
 		[rin 20230623]
 	crunchgen(1): Clear PaX flags instead of removing its ELF note section.



CVS commit: src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:21:31 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: check-expect.lua
src/usr.bin/xlint/lint1: debug.c tree.c

Log Message:
lint: clean up typos


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.539 -r1.540 src/usr.bin/xlint/lint1/tree.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/lint1/check-expect.lua
diff -u src/tests/usr.bin/xlint/lint1/check-expect.lua:1.3 src/tests/usr.bin/xlint/lint1/check-expect.lua:1.4
--- src/tests/usr.bin/xlint/lint1/check-expect.lua:1.3	Wed Jun 28 17:53:21 2023
+++ src/tests/usr.bin/xlint/lint1/check-expect.lua	Sat Jul  1 09:21:31 2023
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.3 2023/06/28 17:53:21 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.4 2023/07/01 09:21:31 rillig Exp $
 
 --[[
 
@@ -58,7 +58,7 @@ end
 --   },
 --   { "file.c(18)", "file.c(23)" }
 local function load_c(fname)
-  local basename = fname:match("([^/]+)$") or fname
+  local basename = fname:match("([^/]+)$")
   local lines = load_lines(fname)
   if lines == nil then return nil, nil end
 

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.40 src/usr.bin/xlint/lint1/debug.c:1.41
--- src/usr.bin/xlint/lint1/debug.c:1.40	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/debug.c	Sat Jul  1 09:21:31 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.40 2023/06/30 21:39:54 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.41 2023/07/01 09:21:31 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.40 2023/06/30 21:39:54 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.41 2023/07/01 09:21:31 rillig Exp $");
 #endif
 
 #include 
@@ -440,7 +440,7 @@ debug_dinfo(const decl_level *dl)
 	 arg != NULL; arg = arg->s_next)
 		debug_sym(" arg(", arg, ")");
 	if (dl->d_func_def_pos.p_file != NULL)
-		debug_printf(" func_def_pos=%s:%dl:%dl",
+		debug_printf(" func_def_pos=%s:%d:%d",
 		dl->d_func_def_pos.p_file, dl->d_func_def_pos.p_line,
 		dl->d_func_def_pos.p_uniq);
 	for (const sym_t *sym = dl->d_func_proto_syms;

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.539 src/usr.bin/xlint/lint1/tree.c:1.540
--- src/usr.bin/xlint/lint1/tree.c:1.539	Sat Jul  1 06:09:24 2023
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul  1 09:21:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.539 2023/07/01 06:09:24 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.540 2023/07/01 09:21:31 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.539 2023/07/01 06:09:24 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.540 2023/07/01 09:21:31 rillig Exp $");
 #endif
 
 #include 
@@ -1066,8 +1066,8 @@ check_enum_array_index(const tnode_t *ln
 		return;
 
 	const type_t *rtp = rn->tn_left->tn_type;
-	const struct sym *ec = rtp->t_enum->en_first_enumerator;
-	const struct sym *max_ec = ec;
+	const sym_t *ec = rtp->t_enum->en_first_enumerator;
+	const sym_t *max_ec = ec;
 	lint_assert(ec != NULL);
 	for (ec = ec->s_next; ec != NULL; ec = ec->s_next)
 		if (ec->u.s_enum_constant > max_ec->u.s_enum_constant)



CVS commit: src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:21:31 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: check-expect.lua
src/usr.bin/xlint/lint1: debug.c tree.c

Log Message:
lint: clean up typos


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.539 -r1.540 src/usr.bin/xlint/lint1/tree.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/unit-tests

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 09:06:34 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: varmod-ifelse.exp varmod-ifelse.mk

Log Message:
tests/make: show how to use indirect conditions in the '?:' modifier


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/varmod-ifelse.exp
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/make/unit-tests/varmod-ifelse.mk

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



CVS commit: src/sys/uvm/pmap

2023-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 07:10:13 UTC 2023

Modified Files:
src/sys/uvm/pmap: pmap_segtab.c

Log Message:
Fix build when KERNHIST defined, but not UVMHIST


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/uvm/pmap/pmap_segtab.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/uvm/pmap/pmap_segtab.c
diff -u src/sys/uvm/pmap/pmap_segtab.c:1.31 src/sys/uvm/pmap/pmap_segtab.c:1.32
--- src/sys/uvm/pmap/pmap_segtab.c:1.31	Wed Dec 21 11:39:46 2022
+++ src/sys/uvm/pmap/pmap_segtab.c	Sat Jul  1 07:10:13 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_segtab.c,v 1.31 2022/12/21 11:39:46 skrll Exp $	*/
+/*	$NetBSD: pmap_segtab.c,v 1.32 2023/07/01 07:10:13 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.31 2022/12/21 11:39:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_segtab.c,v 1.32 2023/07/01 07:10:13 skrll Exp $");
 
 /*
  *	Manages physical address maps.
@@ -557,7 +557,7 @@ pmap_pdetab_alloc(struct pmap *pmap)
 	UVMHIST_CALLARGS(pmapxtabhist, "pm %#jx", (uintptr_t)pmap, 0, 0, 0);
 
 	pmap_pdetab_t *ptb;
-#ifdef KERNHIST
+#ifdef UVMHIST
 	bool found_on_freelist = false;
 #endif
 
@@ -573,7 +573,7 @@ pmap_pdetab_alloc(struct pmap *pmap)
 
 		PDETAB_ADD(nget, 1);
 		ptb->pde_next = NULL;
-#ifdef KERNHIST
+#ifdef UVMHIST
 		found_on_freelist = true;
 #endif
 	}



CVS commit: src/sys/uvm/pmap

2023-07-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Jul  1 07:10:13 UTC 2023

Modified Files:
src/sys/uvm/pmap: pmap_segtab.c

Log Message:
Fix build when KERNHIST defined, but not UVMHIST


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/uvm/pmap/pmap_segtab.c

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



CVS commit: src/external/bsd/jemalloc/dist/src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 06:29:14 UTC 2023

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
jemalloc: enable lint again, it is no longer broken

Since today, lint handles unnamed struct/union correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/jemalloc/dist/src/jemalloc.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/bsd/jemalloc/dist/src/jemalloc.c
diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.9 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.10
--- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.9	Fri May 15 14:37:21 2020
+++ src/external/bsd/jemalloc/dist/src/jemalloc.c	Sat Jul  1 06:29:14 2023
@@ -189,12 +189,7 @@ static const void (WINAPI *init_init_loc
 #endif
 #endif
 #else
-#ifndef __lint__
-// Broken lint
 static malloc_mutex_t	init_lock = MALLOC_MUTEX_INITIALIZER;
-#else
-static malloc_mutex_t	init_lock;
-#endif
 #endif
 
 typedef struct {



CVS commit: src/external/bsd/jemalloc/dist/src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 06:29:14 UTC 2023

Modified Files:
src/external/bsd/jemalloc/dist/src: jemalloc.c

Log Message:
jemalloc: enable lint again, it is no longer broken

Since today, lint handles unnamed struct/union correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/jemalloc/dist/src/jemalloc.c

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



CVS commit: src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 06:09:24 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: init_braces.c
src/usr.bin/xlint/lint1: externs1.h init.c tree.c

Log Message:
lint: fix initialization of unnamed union member


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/init_braces.c
cvs rdiff -u -r1.183 -r1.184 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.538 -r1.539 src/usr.bin/xlint/lint1/tree.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/lint1/init_braces.c
diff -u src/tests/usr.bin/xlint/lint1/init_braces.c:1.6 src/tests/usr.bin/xlint/lint1/init_braces.c:1.7
--- src/tests/usr.bin/xlint/lint1/init_braces.c:1.6	Fri Jun 30 22:27:47 2023
+++ src/tests/usr.bin/xlint/lint1/init_braces.c	Sat Jul  1 06:09:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_braces.c,v 1.6 2023/06/30 22:27:47 rillig Exp $	*/
+/*	$NetBSD: init_braces.c,v 1.7 2023/07/01 06:09:24 rillig Exp $	*/
 # 3 "init_braces.c"
 
 /*
@@ -97,7 +97,8 @@ init_anonymous_struct_and_union(void)
 	return var.times.t0.ns;
 }
 
-// Minimized example taken from jemalloc.c, init_lock.
+// Initializers may designate members from unnamed struct/union members.
+// Example code adapted from jemalloc 5.1.0, jemalloc.c, init_lock.
 unsigned char
 init_unnamed_union(void)
 {
@@ -121,8 +122,6 @@ init_unnamed_union(void)
 			{
 .padded_union = {
 	.pad1 = { 0, 0, 0 },
-/* FIXME: Allow access to unnamed struct/union members. */
-/* expect+1: error: type 'struct padded_union' does not have member 'u1' [101] */
 	.u1 = 0,
 	.pad2 = { 0, 0, 0 },
 },

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.183 src/usr.bin/xlint/lint1/externs1.h:1.184
--- src/usr.bin/xlint/lint1/externs1.h:1.183	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Jul  1 06:09:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.183 2023/06/30 21:39:54 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.184 2023/07/01 06:09:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -275,6 +275,7 @@ void	check_expr_misc(const tnode_t *, bo
 bool	constant_addr(const tnode_t *, const sym_t **, ptrdiff_t *);
 strg_t	*cat_strings(strg_t *, strg_t *);
 unsigned int type_size_in_bits(const type_t *);
+sym_t	*find_member(const type_t *, const char *);
 
 void begin_statement_expr(void);
 void do_statement_expr(tnode_t *);

Index: src/usr.bin/xlint/lint1/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.243 src/usr.bin/xlint/lint1/init.c:1.244
--- src/usr.bin/xlint/lint1/init.c:1.243	Fri Jun 30 21:06:18 2023
+++ src/usr.bin/xlint/lint1/init.c	Sat Jul  1 06:09:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.243 2023/06/30 21:06:18 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.244 2023/07/01 06:09:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: init.c,v 1.243 2023/06/30 21:06:18 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.244 2023/07/01 06:09:24 rillig Exp $");
 #endif
 
 #include 
@@ -234,18 +234,6 @@ first_named_member(const type_t *tp)
 	return skip_unnamed(tp->t_sou->sou_first_member);
 }
 
-static const sym_t *
-look_up_member(const type_t *tp, const char *name)
-{
-	const sym_t *m;
-
-	lint_assert(is_struct_or_union(tp->t_tspec));
-	for (m = tp->t_sou->sou_first_member; m != NULL; m = m->s_next)
-		if (strcmp(m->s_name, name) == 0)
-			return m;
-	return NULL;
-}
-
 /*
  * C99 6.7.8p22 says that the type of an array of unknown size becomes known
  * at the end of its initializer list.
@@ -862,7 +850,7 @@ initialization_add_designator_member(ini
 	}
 
 proceed:;
-	const sym_t *member = look_up_member(tp, name);
+	const sym_t *member = find_member(tp, name);
 	if (member == NULL) {
 		/* type '%s' does not have member '%s' */
 		error(101, type_name(tp), name);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.538 src/usr.bin/xlint/lint1/tree.c:1.539
--- src/usr.bin/xlint/lint1/tree.c:1.538	Fri Jun 30 21:39:54 2023
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul  1 06:09:24 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.538 2023/06/30 21:39:54 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.539 2023/07/01 06:09:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.538 2023/06/30 21:39:54 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.539 2023/07/01 06:09:24 rillig Exp $");
 #endif
 
 #include 
@@ -1882,7 +1882,7 @@ all_members_compatible(const sym_t *msym
 	return true;
 }
 
-static sym_t *
+sym_t *
 find_member(const type_t *tp, const char *name)
 {
 	for (sym_t *mem = tp->t_sou->sou_first_member;



CVS commit: src

2023-07-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Jul  1 06:09:24 UTC 2023

Modified Files:
src/tests/usr.bin/xlint/lint1: init_braces.c
src/usr.bin/xlint/lint1: externs1.h init.c tree.c

Log Message:
lint: fix initialization of unnamed union member


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/init_braces.c
cvs rdiff -u -r1.183 -r1.184 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.243 -r1.244 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.538 -r1.539 src/usr.bin/xlint/lint1/tree.c

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