CVS commit: src/lib/libc/sys

2021-03-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Mar 28 03:29:32 UTC 2021

Modified Files:
src/lib/libc/sys: bind.2 connect.2 send.2

Log Message:
Document EINVAL for out of range socket address lengths.

This is what happens, but wasn't documented. Applies to bind(2),
connect(2), and send(2).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/lib/libc/sys/bind.2
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/sys/connect.2
cvs rdiff -u -r1.32 -r1.33 src/lib/libc/sys/send.2

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/sys/bind.2
diff -u src/lib/libc/sys/bind.2:1.30 src/lib/libc/sys/bind.2:1.31
--- src/lib/libc/sys/bind.2:1.30	Mon Jul  3 21:32:50 2017
+++ src/lib/libc/sys/bind.2	Sun Mar 28 03:29:31 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: bind.2,v 1.30 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: bind.2,v 1.31 2021/03/28 03:29:31 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)bind.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd April 5, 2015
+.Dd March 27, 2021
 .Dt BIND 2
 .Os
 .Sh NAME
@@ -99,6 +99,8 @@ The socket is already bound to an addres
 the family of the socket and that requested in
 .Fa name->sa_family
 are not equivalent.
+.It Bq Er EINVAL
+The socket address length passed was outside the allowable range.
 .It Bq Er ENOTSOCK
 .Fa s
 is not a socket.

Index: src/lib/libc/sys/connect.2
diff -u src/lib/libc/sys/connect.2:1.28 src/lib/libc/sys/connect.2:1.29
--- src/lib/libc/sys/connect.2:1.28	Mon May 31 12:16:20 2010
+++ src/lib/libc/sys/connect.2	Sun Mar 28 03:29:31 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: connect.2,v 1.28 2010/05/31 12:16:20 njoly Exp $
+.\"	$NetBSD: connect.2,v 1.29 2021/03/28 03:29:31 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)connect.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd May 18, 2004
+.Dd March 27, 2021
 .Dt CONNECT 2
 .Os
 .Sh NAME
@@ -97,6 +97,8 @@ is not a valid descriptor.
 .It Bq Er ENOTSOCK
 .Fa s
 is a descriptor for a file, not a socket.
+.It Bq Er EINVAL
+The socket address length passed was outside the allowable range.
 .It Bq Er EADDRNOTAVAIL
 The specified address is not available on this machine.
 .It Bq Er EAFNOSUPPORT

Index: src/lib/libc/sys/send.2
diff -u src/lib/libc/sys/send.2:1.32 src/lib/libc/sys/send.2:1.33
--- src/lib/libc/sys/send.2:1.32	Sun Jun 11 17:01:26 2017
+++ src/lib/libc/sys/send.2	Sun Mar 28 03:29:31 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: send.2,v 1.32 2017/06/11 17:01:26 abhinav Exp $
+.\"	$NetBSD: send.2,v 1.33 2021/03/28 03:29:31 dholland Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)send.2	8.2 (Berkeley) 2/21/94
 .\"
-.Dd June 22, 2012
+.Dd March 27, 2021
 .Dt SEND 2
 .Os
 .Sh NAME
@@ -217,6 +217,8 @@ The destination for the message is unrea
 .It Bq Er EINVAL
 The total length of the I/O is more than can be expressed by the ssize_t
 return value.
+.It Bq Er EINVAL
+The socket address length passed was outside the allowable range.
 .It Bq Er EMSGSIZE
 The socket requires that message be sent atomically,
 and the size of the message to be sent made this impossible.



CVS commit: [thorpej-cfargs] src/sys/arch/x86/pci

2021-03-27 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 28 01:03:19 UTC 2021

Modified Files:
src/sys/arch/x86/pci [thorpej-cfargs]: amdnb_misc.c amdsmn.c

Log Message:
These devices have only one interface attribute and no locators,
so simplify:

- config_attach_loc() -> config_attach().
- Don't pass CFARG_IATTR, or CFARG_LOCATORS to config_search().


To generate a diff of this commit:
cvs rdiff -u -r1.3.14.3 -r1.3.14.4 src/sys/arch/x86/pci/amdnb_misc.c
cvs rdiff -u -r1.10.4.2 -r1.10.4.3 src/sys/arch/x86/pci/amdsmn.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/arch/x86/pci/amdnb_misc.c
diff -u src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.3 src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.4
--- src/sys/arch/x86/pci/amdnb_misc.c:1.3.14.3	Sun Mar 21 19:06:19 2021
+++ src/sys/arch/x86/pci/amdnb_misc.c	Sun Mar 28 01:03:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdnb_misc.c,v 1.3.14.3 2021/03/21 19:06:19 thorpej Exp $ */
+/*	$NetBSD: amdnb_misc.c,v 1.3.14.4 2021/03/28 01:03:19 thorpej Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.3.14.3 2021/03/21 19:06:19 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdnb_misc.c,v 1.3.14.4 2021/03/28 01:03:19 thorpej Exp $");
 
 #include 
 #include 
@@ -114,7 +114,7 @@ amdnb_misc_search(device_t parent, cfdat
 	if (!attach)
 		return 0;
 
-	config_attach_loc(parent, cf, locs, aux, NULL);
+	config_attach(parent, cf, aux, NULL);
 
 	return 0;
 }
@@ -160,8 +160,6 @@ amdnb_misc_rescan(device_t self, const c
 
 	config_search(self, >sc_pa,
 	CFARG_SUBMATCH, amdnb_misc_search,
-	CFARG_IATTR, ifattr,
-	CFARG_LOCATORS, locators,
 	CFARG_EOL);
 
 	return 0;

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.10.4.2 src/sys/arch/x86/pci/amdsmn.c:1.10.4.3
--- src/sys/arch/x86/pci/amdsmn.c:1.10.4.2	Sun Mar 21 19:06:19 2021
+++ src/sys/arch/x86/pci/amdsmn.c	Sun Mar 28 01:03:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.10.4.2 2021/03/21 19:06:19 thorpej Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.10.4.3 2021/03/28 01:03:19 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2017, 2019 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.2 2021/03/21 19:06:19 thorpej Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.10.4.3 2021/03/28 01:03:19 thorpej Exp $ ");
 
 /*
  * Driver for the AMD Family 15h (model 60+) and 17h CPU
@@ -133,7 +133,6 @@ amdsmn_attach(device_t parent, device_t 
 {
 	struct amdsmn_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
-	int flags = 0;
 	size_t i;
 
 	mutex_init(>smn_lock, MUTEX_DEFAULT, IPL_NONE);
@@ -149,7 +148,7 @@ amdsmn_attach(device_t parent, device_t 
 
 	// aprint_normal(": AMD Family 17h System Management Network\n");
 	aprint_normal(": AMD System Management Network\n");
-	amdsmn_rescan(self, "amdsmnbus", );
+	amdsmn_rescan(self, NULL, NULL);
 }
 
 static int
@@ -159,8 +158,6 @@ amdsmn_rescan(device_t self, const char 
 
 	config_search(self, >pa,
 	CFARG_SUBMATCH, amdsmn_misc_search,
-	CFARG_IATTR, ifattr,
-	CFARG_LOCATORS, locators,
 	CFARG_EOL);
 
 	return 0;



CVS commit: [thorpej-cfargs] src/sys/arch/x86/pci

2021-03-27 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Mar 28 01:01:46 UTC 2021

Modified Files:
src/sys/arch/x86/pci [thorpej-cfargs]: files.pci

Log Message:
Minor rearrangement of the deck chairs to group things together.


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/sys/arch/x86/pci/files.pci

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/x86/pci/files.pci
diff -u src/sys/arch/x86/pci/files.pci:1.25.4.1 src/sys/arch/x86/pci/files.pci:1.25.4.2
--- src/sys/arch/x86/pci/files.pci:1.25.4.1	Tue Mar 23 01:25:48 2021
+++ src/sys/arch/x86/pci/files.pci	Sun Mar 28 01:01:45 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.25.4.1 2021/03/23 01:25:48 thorpej Exp $
+#	$NetBSD: files.pci,v 1.25.4.2 2021/03/28 01:01:45 thorpej Exp $
 
 device 	aapic
 attach 	aapic at pci
@@ -9,9 +9,6 @@ file	arch/x86/pci/agp_machdep.c	agp
 define	agp_x86: agp_ali, agp_amd, agp_amd64, agp_i810, agp_intel, agp_sis, agp_via
 defflag	AGP_X86
 
-define amdnb_miscbus {}
-define amdsmnbus {}
-
 # PCI-Host bridge chipsets
 device	pchb:	pcibus, agpbus, agp_x86
 attach	pchb at pci
@@ -32,11 +29,17 @@ attach  hpet at amdpcib with amdpcib_hpe
 filearch/x86/pci/amdpcib_hpet.c		amdpcib_hpet
 
 # AMD Processors -- Miscellaneous Control
+define	amdnb_miscbus {}
 device	amdnb_misc: amdnb_miscbus
 attach	amdnb_misc at pci
 file	arch/x86/pci/amdnb_misc.c	amdnb_misc
+
+device	amdtemp: sysmon_envsys
+attach	amdtemp at amdnb_miscbus
+file	arch/x86/pci/amdtemp.c		amdtemp
  
 # AMD Family 17h system management network
+define	amdsmnbus {}
 device	amdsmn: amdsmnbus
 attach	amdsmn at pci
 file arch/x86/pci/amdsmn.c		amdsmn
@@ -46,10 +49,6 @@ device	amdzentemp: sysmon_envsys
 attach	amdzentemp at amdsmnbus
 file	arch/x86/pci/amdzentemp.c		amdzentemp
 
-device	amdtemp: sysmon_envsys
-attach	amdtemp at amdnb_miscbus
-file	arch/x86/pci/amdtemp.c		amdtemp
-
 attach  dwiic at pci with pcidwiic
 filearch/x86/pci/dwiic_pci.c	pcidwiic
 



CVS commit: src/lib/libc/sys

2021-03-27 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Mar 27 23:35:37 UTC 2021

Modified Files:
src/lib/libc/sys: getvfsstat.2

Log Message:
In getvfsstat(2), clarify that the size argument is in bytes.

That the size argument is in bytes (not the count of structures) and
the return value is the count of structures (not bytes) is
counterintuitive.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/sys/getvfsstat.2

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/sys/getvfsstat.2
diff -u src/lib/libc/sys/getvfsstat.2:1.3 src/lib/libc/sys/getvfsstat.2:1.4
--- src/lib/libc/sys/getvfsstat.2:1.3	Fri May 19 17:59:28 2006
+++ src/lib/libc/sys/getvfsstat.2	Sat Mar 27 23:35:37 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: getvfsstat.2,v 1.3 2006/05/19 17:59:28 tsutsui Exp $
+.\"	$NetBSD: getvfsstat.2,v 1.4 2021/03/27 23:35:37 dholland Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)getvfsstat.2	8.3 (Berkeley) 5/25/95
 .\"
-.Dd May 19, 2006
+.Dd March 27, 2021
 .Dt GETVFSSTAT 2
 .Os
 .Sh NAME
@@ -79,6 +79,12 @@ Thus, some of the information will be ou
 .Fn getvfsstat
 will not block waiting for information from a file system that is
 unable to respond.
+.Pp
+Note that
+.Fa bufsize
+is the size of the buffer in bytes, not the count of structures that
+will fit in it, and the return value is the count of structures, not
+the size.
 .Sh RETURN VALUES
 Upon successful completion, the number of
 .Fa statvfs



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 23:18:38 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: extract brace_level_next_member from initstack_pop_item_unnamed

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.143 src/usr.bin/xlint/lint1/init.c:1.144
--- src/usr.bin/xlint/lint1/init.c:1.143	Sat Mar 27 22:53:10 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 23:18:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.143 2021/03/27 22:53:10 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.144 2021/03/27 23:18:37 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.143 2021/03/27 22:53:10 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.144 2021/03/27 23:18:37 rillig Exp $");
 #endif
 
 #include 
@@ -559,6 +559,21 @@ brace_level_set_array_dimension(int dim)
 	debug_brace_level(brace_level_rvalue);
 }
 
+static void
+brace_level_next_member(struct brace_level *level)
+{
+	const sym_t *m;
+
+	do {
+		m = level->bl_next_member = level->bl_next_member->s_next;
+		/* XXX: can this assertion be made to fail? */
+		lint_assert(m != NULL);
+	} while (m->s_bitfield && m->s_name == unnamed);
+
+	debug_indent();
+	debug_brace_level(level);
+}
+
 /*
  * A sub-object of an array is initialized using a designator.  This does not
  * have to be an array element directly, it can also be used to initialize
@@ -695,7 +710,6 @@ static void
 initstack_pop_item_unnamed(void)
 {
 	struct brace_level *level = brace_level_lvalue;
-	sym_t *m;
 
 	/*
 	 * If the removed element was a structure member, we must go
@@ -703,15 +717,8 @@ initstack_pop_item_unnamed(void)
 	 */
 	if (level->bl_remaining > 0 && level->bl_type->t_tspec == STRUCT &&
 	!level->bl_seen_named_member) {
-		do {
-			m = level->bl_next_member =
-			level->bl_next_member->s_next;
-			/* XXX: can this assertion be made to fail? */
-			lint_assert(m != NULL);
-			debug_step("pop %s", m->s_name);
-		} while (m->s_bitfield && m->s_name == unnamed);
-		/* XXX: duplicate code for skipping unnamed bit-fields */
-		level->bl_subtype = m->s_type;
+		brace_level_next_member(level);
+		level->bl_subtype = level->bl_next_member->s_type;
 	}
 }
 



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 23:13:49 UTC 2021

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

Log Message:
tests/lint: test initializing a struct ending with unnamed bit-field


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/tests/usr.bin/xlint/lint1/d_c99_init.c
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/d_c99_init.exp

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/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.15 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.16
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.15	Sat Mar 27 16:13:41 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c	Sat Mar 27 23:13:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_init.c,v 1.15 2021/03/27 16:13:41 rillig Exp $	*/
+/*	$NetBSD: d_c99_init.c,v 1.16 2021/03/27 23:13:48 rillig Exp $	*/
 # 3 "d_c99_init.c"
 
 /*
@@ -208,4 +208,13 @@ struct geometry geometry = {
 	.points[0][0][2] = {21, 22 },
 };
 
+struct ends_with_unnamed_bit_field {
+	int member;
+	int : 0;
+} ends_with_unnamed_bit_field = {
+	12345,
+	/* expect+1: too many struct/union initializers */
+	23456,
+};
+
 // See d_struct_init_nested.c for a more complicated example.

Index: src/tests/usr.bin/xlint/lint1/d_c99_init.exp
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.11 src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.12
--- src/tests/usr.bin/xlint/lint1/d_c99_init.exp:1.11	Tue Mar 23 23:12:21 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.exp	Sat Mar 27 23:13:48 2021
@@ -4,3 +4,4 @@ d_c99_init.c(49): error: cannot initiali
 d_c99_init.c(65): error: too many array initializers, expected 3 [173]
 d_c99_init.c(130): error: syntax error 'named member must only be used with struct/union' [249]
 d_c99_init.c(142): error: invalid initializer type int [176]
+d_c99_init.c(217): error: too many struct/union initializers [172]



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 22:53:10 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: extract brace level code into separate functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.142 -r1.143 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.142 src/usr.bin/xlint/lint1/init.c:1.143
--- src/usr.bin/xlint/lint1/init.c:1.142	Sat Mar 27 22:35:10 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 22:53:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.142 2021/03/27 22:35:10 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.143 2021/03/27 22:53:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.142 2021/03/27 22:35:10 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.143 2021/03/27 22:53:10 rillig Exp $");
 #endif
 
 #include 
@@ -520,6 +520,36 @@ designation_add_name(sbuf_t *sb)
 /* TODO: Move the function body up here, to avoid the forward declaration. */
 static void initstack_pop_nobrace(void);
 
+static struct brace_level *
+brace_level_new(type_t *type, type_t *subtype, int remaining)
+{
+	struct brace_level *level = xcalloc(1, sizeof(*level));
+
+	level->bl_type = type;
+	level->bl_subtype = subtype;
+	level->bl_remaining = remaining;
+
+	return level;
+}
+
+static const sym_t *
+brace_level_look_up_member(const char *name)
+{
+	const type_t *tp = current_brace_level()->bl_type;
+	const sym_t *m;
+
+	lint_assert(tp->t_tspec == STRUCT || tp->t_tspec == UNION);
+
+	for (m = tp->t_str->sou_first_member; m != NULL; m = m->s_next) {
+		if (m->s_bitfield && m->s_name == unnamed)
+			continue;
+		if (strcmp(m->s_name, name) == 0)
+			return m;
+	}
+
+	return NULL;
+}
+
 static void
 brace_level_set_array_dimension(int dim)
 {
@@ -600,7 +630,6 @@ designation_shift_level(void)
 void
 initstack_init(void)
 {
-	struct brace_level *level;
 
 	if (initerr)
 		return;
@@ -615,9 +644,7 @@ initstack_init(void)
 		initsym->s_type = duptyp(initsym->s_type);
 	/* TODO: does 'duptyp' create a memory leak? */
 
-	level = brace_level_lvalue = xcalloc(1, sizeof *brace_level_lvalue);
-	level->bl_subtype = initsym->s_type;
-	level->bl_remaining = 1;
+	brace_level_lvalue = brace_level_new(NULL, initsym->s_type, 1);
 
 	debug_initstack();
 	debug_leave();
@@ -628,7 +655,7 @@ static void
 initstack_pop_item_named_member(const char *name)
 {
 	struct brace_level *level = brace_level_lvalue;
-	sym_t *m;
+	const sym_t *m;
 
 	/*
 	 * TODO: fix wording of the debug message; this doesn't seem to be
@@ -644,29 +671,23 @@ initstack_pop_item_named_member(const ch
 		return;
 	}
 
-	for (m = level->bl_type->t_str->sou_first_member;
-	 m != NULL; m = m->s_next) {
-
-		if (m->s_bitfield && m->s_name == unnamed)
-			continue;
+	m = brace_level_look_up_member(name);
+	if (m == NULL) {
+		/* TODO: add type information to the message */
+		/* undefined struct/union member: %s */
+		error(101, name);
 
-		if (strcmp(m->s_name, name) == 0) {
-			debug_step("found matching member");
-			level->bl_subtype = m->s_type;
-			/* XXX: why ++? */
-			level->bl_remaining++;
-			/* XXX: why is bl_seen_named_member not set? */
-			designation_shift_level();
-			return;
-		}
+		designation_shift_level();
+		level->bl_seen_named_member = true;
+		return;
 	}
 
-	/* TODO: add type information to the message */
-	/* undefined struct/union member: %s */
-	error(101, name);
-
+	debug_step("found matching member");
+	level->bl_subtype = m->s_type;
+	/* XXX: why ++? */
+	level->bl_remaining++;
+	/* XXX: why is bl_seen_named_member not set? */
 	designation_shift_level();
-	level->bl_seen_named_member = true;
 }
 
 /* TODO: think of a better name than 'pop' */



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 22:35:10 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: prepare support for adding array designators

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.141 src/usr.bin/xlint/lint1/init.c:1.142
--- src/usr.bin/xlint/lint1/init.c:1.141	Sat Mar 27 21:56:51 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 22:35:10 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.141 2021/03/27 21:56:51 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.142 2021/03/27 22:35:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.141 2021/03/27 21:56:51 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.142 2021/03/27 22:35:10 rillig Exp $");
 #endif
 
 #include 
@@ -481,13 +481,24 @@ end_initialization(void)
 	debug_step("end initialization");
 }
 
-void
-designation_add_name(sbuf_t *sb)
+static struct designator *
+designator_new(const char *name)
 {
-	struct designation *dd = current_designation_mod();
-
 	struct designator *d = xcalloc(1, sizeof *d);
-	d->name = sb->sb_name;
+	d->name = name;
+	return d;
+}
+
+static void
+designator_free(struct designator *d)
+{
+	free(d);
+}
+
+static void
+designation_add(struct designator *d)
+{
+	struct designation *dd = _init()->designation;
 
 	if (dd->head != NULL) {
 		dd->tail->next = d;
@@ -500,9 +511,24 @@ designation_add_name(sbuf_t *sb)
 	debug_designation();
 }
 
+void
+designation_add_name(sbuf_t *sb)
+{
+	designation_add(designator_new(sb->sb_name));
+}
+
 /* TODO: Move the function body up here, to avoid the forward declaration. */
 static void initstack_pop_nobrace(void);
 
+static void
+brace_level_set_array_dimension(int dim)
+{
+	debug_step("setting the array size to %d", dim);
+	brace_level_lvalue->bl_type->t_dim = dim;
+	debug_indent();
+	debug_brace_level(brace_level_rvalue);
+}
+
 /*
  * A sub-object of an array is initialized using a designator.  This does not
  * have to be an array element directly, it can also be used to initialize
@@ -526,8 +552,11 @@ designation_add_subscript(range_t range)
 	struct brace_level *level;
 
 	debug_enter();
-	debug_step("subscript range is %zu ... %zu", range.lo, range.hi);
-	debug_initstack();
+	if (range.lo == range.hi)
+		debug_step("subscript is %zu", range.hi);
+	else
+		debug_step("subscript range is %zu ... %zu",
+		range.lo, range.hi);
 
 	initstack_pop_nobrace();
 
@@ -535,10 +564,8 @@ designation_add_subscript(range_t range)
 	if (level->bl_array_of_unknown_size) {
 		/* No +1 here, extend_if_array_of_unknown_size will add it. */
 		int auto_dim = (int)range.hi;
-		if (auto_dim > level->bl_type->t_dim) {
-			debug_step("setting the array size to %d", auto_dim);
-			level->bl_type->t_dim = auto_dim;
-		}
+		if (auto_dim > level->bl_type->t_dim)
+			brace_level_set_array_dimension(auto_dim);
 	}
 
 	debug_leave();
@@ -548,17 +575,17 @@ designation_add_subscript(range_t range)
 static void
 designation_shift_level(void)
 {
-	/* TODO: remove direct access to 'init' */
-	lint_assert(init != NULL);
-	lint_assert(init->designation.head != NULL);
-	if (init->designation.head == init->designation.tail) {
-		free(init->designation.head);
-		init->designation.head = NULL;
-		init->designation.tail = NULL;
+	struct designation *des = current_designation_mod();
+	lint_assert(des->head != NULL);
+
+	if (des->head == des->tail) {
+		designator_free(des->head);
+		des->head = NULL;
+		des->tail = NULL;
 	} else {
-		struct designator *head = init->designation.head;
-		init->designation.head = init->designation.head->next;
-		free(head);
+		struct designator *head = des->head;
+		des->head = des->head->next;
+		designator_free(head);
 	}
 
 	debug_designation();



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 22:13:55 UTC 2021

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

Log Message:
lint: move handling of function renaming over to declare_extern

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/usr.bin/xlint/lint1/decl.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.165 src/usr.bin/xlint/lint1/decl.c:1.166
--- src/usr.bin/xlint/lint1/decl.c:1.165	Sat Mar 27 22:04:39 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Mar 27 22:13:55 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.165 2021/03/27 22:04:39 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.166 2021/03/27 22:13:55 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.165 2021/03/27 22:04:39 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.166 2021/03/27 22:13:55 rillig Exp $");
 #endif
 
 #include 
@@ -1895,10 +1895,19 @@ enumeration_constant(sym_t *sym, int val
  * Process a single external declarator.
  */
 static void
-declare_extern(sym_t *dsym, bool initflg)
+declare_extern(sym_t *dsym, bool initflg, sbuf_t *renaming)
 {
 	bool	dowarn, rval, redec;
 	sym_t	*rdsym;
+	char	*s;
+
+	if (renaming != NULL) {
+		lint_assert(dsym->s_rename == NULL);
+
+		s = getlblk(1, renaming->sb_len + 1);
+		(void)memcpy(s, renaming->sb_name, renaming->sb_len + 1);
+		dsym->s_rename = s;
+	}
 
 	check_function_definition(dsym, true);
 
@@ -2017,36 +2026,22 @@ declare_extern(sym_t *dsym, bool initflg
 void
 declare(sym_t *decl, bool initflg, sbuf_t *renaming)
 {
-	char *s;
-
-	switch (dcs->d_ctx) {
-	case EXTERN:
-		if (renaming != NULL) {
-			lint_assert(decl->s_rename == NULL);
 
-			s = getlblk(1, renaming->sb_len + 1);
-			(void)memcpy(s, renaming->sb_name, renaming->sb_len + 1);
-			decl->s_rename = s;
-		}
-		declare_extern(decl, initflg);
-		break;
-	case ARG:
+	if (dcs->d_ctx == EXTERN) {
+		declare_extern(decl, initflg, renaming);
+	} else if (dcs->d_ctx == ARG) {
 		if (renaming != NULL) {
 			/* symbol renaming can't be used on function arguments */
 			error(310);
-			break;
-		}
-		(void)declare_argument(decl, initflg);
-		break;
-	default:
+		} else
+			(void)declare_argument(decl, initflg);
+	} else {
 		lint_assert(dcs->d_ctx == AUTO);
 		if (renaming != NULL) {
 			/* symbol renaming can't be used on automatic variables */
 			error(311);
-			break;
-		}
-		declare_local(decl, initflg);
-		break;
+		} else
+			declare_local(decl, initflg);
 	}
 
 	if (initflg && !*current_initerr())



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 22:04:39 UTC 2021

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

Log Message:
lint: rename decl1ext, reduce visibility

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.164 -r1.165 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.91 -r1.92 src/usr.bin/xlint/lint1/externs1.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/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.164 src/usr.bin/xlint/lint1/decl.c:1.165
--- src/usr.bin/xlint/lint1/decl.c:1.164	Sat Mar 27 12:42:22 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Mar 27 22:04:39 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.165 2021/03/27 22:04:39 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.165 2021/03/27 22:04:39 rillig Exp $");
 #endif
 
 #include 
@@ -1891,50 +1891,11 @@ enumeration_constant(sym_t *sym, int val
 	return sym;
 }
 
-void
-declare(sym_t *decl, bool initflg, sbuf_t *renaming)
-{
-	char *s;
-
-	switch (dcs->d_ctx) {
-	case EXTERN:
-		if (renaming != NULL) {
-			lint_assert(decl->s_rename == NULL);
-
-			s = getlblk(1, renaming->sb_len + 1);
-			(void)memcpy(s, renaming->sb_name, renaming->sb_len + 1);
-			decl->s_rename = s;
-		}
-		decl1ext(decl, initflg);
-		break;
-	case ARG:
-		if (renaming != NULL) {
-			/* symbol renaming can't be used on function arguments */
-			error(310);
-			break;
-		}
-		(void)declare_argument(decl, initflg);
-		break;
-	default:
-		lint_assert(dcs->d_ctx == AUTO);
-		if (renaming != NULL) {
-			/* symbol renaming can't be used on automatic variables */
-			error(311);
-			break;
-		}
-		declare_local(decl, initflg);
-		break;
-	}
-
-	if (initflg && !*current_initerr())
-		initstack_init();
-}
-
 /*
  * Process a single external declarator.
  */
-void
-decl1ext(sym_t *dsym, bool initflg)
+static void
+declare_extern(sym_t *dsym, bool initflg)
 {
 	bool	dowarn, rval, redec;
 	sym_t	*rdsym;
@@ -2053,6 +2014,45 @@ decl1ext(sym_t *dsym, bool initflg)
 
 }
 
+void
+declare(sym_t *decl, bool initflg, sbuf_t *renaming)
+{
+	char *s;
+
+	switch (dcs->d_ctx) {
+	case EXTERN:
+		if (renaming != NULL) {
+			lint_assert(decl->s_rename == NULL);
+
+			s = getlblk(1, renaming->sb_len + 1);
+			(void)memcpy(s, renaming->sb_name, renaming->sb_len + 1);
+			decl->s_rename = s;
+		}
+		declare_extern(decl, initflg);
+		break;
+	case ARG:
+		if (renaming != NULL) {
+			/* symbol renaming can't be used on function arguments */
+			error(310);
+			break;
+		}
+		(void)declare_argument(decl, initflg);
+		break;
+	default:
+		lint_assert(dcs->d_ctx == AUTO);
+		if (renaming != NULL) {
+			/* symbol renaming can't be used on automatic variables */
+			error(311);
+			break;
+		}
+		declare_local(decl, initflg);
+		break;
+	}
+
+	if (initflg && !*current_initerr())
+		initstack_init();
+}
+
 /*
  * Copies information about usage into a new symbol table entry of
  * the same symbol.

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.91 src/usr.bin/xlint/lint1/externs1.h:1.92
--- src/usr.bin/xlint/lint1/externs1.h:1.91	Sat Mar 27 12:42:22 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Mar 27 22:04:39 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.91 2021/03/27 12:42:22 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.92 2021/03/27 22:04:39 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -171,7 +171,6 @@ extern	type_t	*complete_tag_struct_or_un
 extern	type_t	*complete_tag_enum(type_t *, sym_t *);
 extern	sym_t	*enumeration_constant(sym_t *, int, bool);
 extern	void	declare(sym_t *, bool, sbuf_t *);
-extern	void	decl1ext(sym_t *, bool);
 extern	void	copy_usage_info(sym_t *, sym_t *);
 extern	bool	check_redeclaration(sym_t *, bool *);
 extern	bool	eqptrtype(const type_t *, const type_t *, bool);



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 21:56:51 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: add function for setting the initialization error

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.140 src/usr.bin/xlint/lint1/init.c:1.141
--- src/usr.bin/xlint/lint1/init.c:1.140	Sat Mar 27 19:59:22 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 21:56:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.140 2021/03/27 19:59:22 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.141 2021/03/27 21:56:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.140 2021/03/27 19:59:22 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.141 2021/03/27 21:56:51 rillig Exp $");
 #endif
 
 #include 
@@ -320,6 +320,12 @@ free_initialization(struct initializatio
 	free(in);
 }
 
+static void
+set_initerr(void)
+{
+	current_init()->initerr = true;
+}
+
 #define initerr		(*current_initerr())
 #define initsym		(*current_initsym())
 #define brace_level_rvalue	(current_brace_level())
@@ -607,7 +613,7 @@ initstack_pop_item_named_member(const ch
 	level->bl_type->t_tspec != UNION) {
 		/* syntax error '%s' */
 		error(249, "named member must only be used with struct/union");
-		initerr = true;
+		set_initerr();
 		return;
 	}
 
@@ -782,7 +788,7 @@ initstack_push_array(void)
 	level->bl_enclosing->bl_enclosing != NULL) {
 		/* initialization of an incomplete type */
 		error(175);
-		initerr = true;
+		set_initerr();
 		return;
 	}
 
@@ -847,7 +853,7 @@ initstack_push_struct_or_union(void)
 	if (is_incomplete(level->bl_type)) {
 		/* initialization of an incomplete type */
 		error(175);
-		initerr = true;
+		set_initerr();
 		return false;
 	}
 
@@ -880,7 +886,7 @@ initstack_push_struct_or_union(void)
 	if (cnt == 0) {
 		/* cannot init. struct/union with no named member */
 		error(179);
-		initerr = true;
+		set_initerr();
 		return false;
 	}
 	level->bl_remaining = level->bl_type->t_tspec == STRUCT ? cnt : 1;
@@ -976,7 +982,7 @@ check_too_many_initializers(void)
 		/* too many initializers */
 		error(174);
 	}
-	initerr = true;
+	set_initerr();
 }
 
 /*
@@ -995,7 +1001,7 @@ initstack_next_brace(void)
 	is_scalar(brace_level_rvalue->bl_type->t_tspec)) {
 		/* invalid initializer type %s */
 		error(176, type_name(brace_level_rvalue->bl_type));
-		initerr = true;
+		set_initerr();
 	}
 	if (!initerr)
 		check_too_many_initializers();



CVS commit: src/sys/dev/vmt

2021-03-27 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Sat Mar 27 21:23:15 UTC 2021

Modified Files:
src/sys/dev/vmt: vmt_subr.c vmtvar.h

Log Message:
Removed little endian dependencies.
Now vmt(4) works on aarch64eb on vmware ESXIonARM.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/vmt/vmt_subr.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/vmt/vmtvar.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/vmt/vmt_subr.c
diff -u src/sys/dev/vmt/vmt_subr.c:1.2 src/sys/dev/vmt/vmt_subr.c:1.3
--- src/sys/dev/vmt/vmt_subr.c:1.2	Tue Nov 17 17:59:31 2020
+++ src/sys/dev/vmt/vmt_subr.c	Sat Mar 27 21:23:14 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: vmt_subr.c,v 1.2 2020/11/17 17:59:31 ryo Exp $ */
+/* $NetBSD: vmt_subr.c,v 1.3 2021/03/27 21:23:14 ryo Exp $ */
 /* $OpenBSD: vmt.c,v 1.11 2011/01/27 21:29:25 dtucker Exp $ */
 
 /*
@@ -90,12 +90,10 @@ vmt_probe_cmd(struct vm_backdoor *frame,
 {
 	memset(frame, 0, sizeof(*frame));
 
-	(frame->eax).word = VM_MAGIC;
-	(frame->ebx).word = ~VM_MAGIC;
-	(frame->ecx).part.low = cmd;
-	(frame->ecx).part.high = 0x;
-	(frame->edx).part.low  = VM_PORT_CMD;
-	(frame->edx).part.high = 0;
+	frame->eax = VM_MAGIC;
+	frame->ebx = ~VM_MAGIC & VM_REG_WORD_MASK;
+	frame->ecx = VM_REG_CMD(0x, cmd);
+	frame->edx = VM_REG_CMD(0, VM_PORT_CMD);
 
 	vm_cmd(frame);
 }
@@ -103,26 +101,18 @@ vmt_probe_cmd(struct vm_backdoor *frame,
 bool
 vmt_probe(void)
 {
-#if BYTE_ORDER == BIG_ENDIAN
-	/*
-	 * XXX: doesn't support in big-endian.
-	 * vmt has some code depends on little-endian.
-	 */
-	return false;
-#else
 	struct vm_backdoor frame;
 
 	vmt_probe_cmd(, VM_CMD_GET_VERSION);
-	if (frame.eax.word == 0x ||
-	frame.ebx.word != VM_MAGIC)
+	if (__SHIFTOUT(frame.eax, VM_REG_WORD_MASK) == 0x ||
+	__SHIFTOUT(frame.ebx, VM_REG_WORD_MASK) != VM_MAGIC)
 		return false;
 
 	vmt_probe_cmd(, VM_CMD_GET_SPEED);
-	if (frame.eax.word == VM_MAGIC)
+	if (__SHIFTOUT(frame.eax, VM_REG_WORD_MASK) == VM_MAGIC)
 		return false;
 
 	return true;
-#endif
 }
 
 void
@@ -137,8 +127,8 @@ vmt_common_attach(struct vmt_softc *sc)
 
 	/* check again */
 	vmt_probe_cmd(, VM_CMD_GET_VERSION);
-	if (frame.eax.word == 0x ||
-	frame.ebx.word != VM_MAGIC) {
+	if (__SHIFTOUT(frame.eax, VM_REG_WORD_MASK) == 0x ||
+	__SHIFTOUT(frame.ebx, VM_REG_WORD_MASK) != VM_MAGIC) {
 		aprint_error_dev(self, "failed to get VMware version\n");
 		return;
 	}
@@ -149,16 +139,17 @@ vmt_common_attach(struct vmt_softc *sc)
 		uint32_t u;
 
 		vmt_probe_cmd(, VM_CMD_GET_BIOS_UUID);
-		uuid.time_low = htobe32(frame.eax.word);
-		u = htobe32(frame.ebx.word);
+		uuid.time_low =
+		bswap32(__SHIFTOUT(frame.eax, VM_REG_WORD_MASK));
+		u = bswap32(__SHIFTOUT(frame.ebx, VM_REG_WORD_MASK));
 		uuid.time_mid = u >> 16;
 		uuid.time_hi_and_version = u;
-		u = htobe32(frame.ecx.word);
+		u = bswap32(__SHIFTOUT(frame.ecx, VM_REG_WORD_MASK));
 		uuid.clock_seq_hi_and_reserved = u >> 24;
 		uuid.clock_seq_low = u >> 16;
 		uuid.node[0] = u >> 8;
 		uuid.node[1] = u;
-		u = htobe32(frame.edx.word);
+		u = bswap32(__SHIFTOUT(frame.edx, VM_REG_WORD_MASK));
 		uuid.node[2] = u >> 24;
 		uuid.node[3] = u >> 16;
 		uuid.node[4] = u >> 8;
@@ -421,14 +412,16 @@ vmt_sync_guest_clock(struct vmt_softc *s
 	struct timespec ts;
 
 	memset(, 0, sizeof(frame));
-	frame.eax.word = VM_MAGIC;
-	frame.ecx.part.low = VM_CMD_GET_TIME_FULL;
-	frame.edx.part.low  = VM_PORT_CMD;
+	frame.eax = VM_MAGIC;
+	frame.ecx = VM_CMD_GET_TIME_FULL;
+	frame.edx = VM_REG_CMD(0, VM_PORT_CMD);
 	vm_cmd();
 
-	if (frame.eax.word != 0x) {
-		ts.tv_sec = ((uint64_t)frame.esi.word << 32) | frame.edx.word;
-		ts.tv_nsec = frame.ebx.word * 1000;
+	if (__SHIFTOUT(frame.eax, VM_REG_WORD_MASK) != 0x) {
+		ts.tv_sec = ((uint64_t)(
+		__SHIFTOUT(frame.esi, VM_REG_WORD_MASK) << 32)) |
+		__SHIFTOUT(frame.edx, VM_REG_WORD_MASK);
+		ts.tv_nsec = __SHIFTOUT(frame.ebx, VM_REG_WORD_MASK) * 1000;
 		tc_setclock();
 	}
 }
@@ -738,25 +731,25 @@ vm_rpc_open(struct vm_rpc *rpc, uint32_t
 	struct vm_backdoor frame;
 
 	memset(, 0, sizeof(frame));
-	frame.eax.word  = VM_MAGIC;
-	frame.ebx.word  = proto | VM_RPC_FLAG_COOKIE;
-	frame.ecx.part.low  = VM_CMD_RPC;
-	frame.ecx.part.high = VM_RPC_OPEN;
-	frame.edx.part.low  = VM_PORT_CMD;
-	frame.edx.part.high = 0;
+	frame.eax = VM_MAGIC;
+	frame.ebx = proto | VM_RPC_FLAG_COOKIE;
+	frame.ecx = VM_REG_CMD_RPC(VM_RPC_OPEN);
+	frame.edx = VM_REG_PORT_CMD(0);
 
 	vm_cmd();
 
-	if (frame.ecx.part.high != 1 || frame.edx.part.low != 0) {
+	if (__SHIFTOUT(frame.ecx, VM_REG_HIGH_MASK) != 1 ||
+	__SHIFTOUT(frame.edx, VM_REG_LOW_MASK) != 0) {
 		/* open-vm-tools retries without VM_RPC_FLAG_COOKIE here.. */
-		printf("vmware: open failed, eax=%08x, ecx=%08x, edx=%08x\n",
-			frame.eax.word, frame.ecx.word, frame.edx.word);
+		printf("vmware: open failed, eax=%#"PRIxREGISTER
+		", 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 19:59:22 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: remove unnecessary typedefs

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.139 src/usr.bin/xlint/lint1/init.c:1.140
--- src/usr.bin/xlint/lint1/init.c:1.139	Sat Mar 27 19:48:00 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 19:59:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.139 2021/03/27 19:48:00 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.140 2021/03/27 19:59:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.139 2021/03/27 19:48:00 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.140 2021/03/27 19:59:22 rillig Exp $");
 #endif
 
 #include 
@@ -215,11 +215,11 @@ struct brace_level {
  *
  * See also: C99 6.7.8 "Initialization"
  */
-typedef struct designator {
+struct designator {
 	const char *name;		/* for struct and union */
 	/* TODO: add 'subscript' for arrays */
 	struct designator *next;
-} designator;
+};
 
 /*
  * The optional designation for an initializer, saying which sub-object to
@@ -228,10 +228,10 @@ typedef struct designator {
  *
  * See also: C99 6.7.8 "Initialization"
  */
-typedef struct {
-	designator *head;
-	designator *tail;
-} designation;
+struct designation {
+	struct designator *head;
+	struct designator *tail;
+};
 
 struct initialization {
 	/*
@@ -252,7 +252,7 @@ struct initialization {
 	 * The C99 designator, if any, for the current initialization
 	 * expression.
 	 */
-	designation designation;
+	struct designation designation;
 
 	struct initialization *next;
 };
@@ -283,13 +283,13 @@ current_initsym(void)
 	return _init()->initsym;
 }
 
-static designation *
+static struct designation *
 current_designation_mod(void)
 {
 	return _init()->designation;
 }
 
-static designation
+static struct designation
 current_designation(void)
 {
 	return *current_designation_mod();
@@ -383,7 +383,7 @@ debug_leave(const char *func)
 static void
 debug_designation(void)
 {
-	const designator *head = current_designation().head, *p;
+	const struct designator *head = current_designation().head, *p;
 	if (head == NULL)
 		return;
 
@@ -478,9 +478,9 @@ end_initialization(void)
 void
 designation_add_name(sbuf_t *sb)
 {
-	designation *dd = current_designation_mod();
+	struct designation *dd = current_designation_mod();
 
-	designator *d = xcalloc(1, sizeof *d);
+	struct designator *d = xcalloc(1, sizeof *d);
 	d->name = sb->sb_name;
 
 	if (dd->head != NULL) {
@@ -550,7 +550,7 @@ designation_shift_level(void)
 		init->designation.head = NULL;
 		init->designation.tail = NULL;
 	} else {
-		designator *head = init->designation.head;
+		struct designator *head = init->designation.head;
 		init->designation.head = init->designation.head->next;
 		free(head);
 	}
@@ -666,7 +666,7 @@ static void
 initstack_pop_item(void)
 {
 	struct brace_level *level;
-	designator *first_designator;
+	struct designator *first_designator;
 
 	debug_enter();
 



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 19:48:00 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: rename initstack_element to brace_level

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.138 src/usr.bin/xlint/lint1/init.c:1.139
--- src/usr.bin/xlint/lint1/init.c:1.138	Sat Mar 27 16:37:12 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 19:48:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.138 2021/03/27 16:37:12 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.139 2021/03/27 19:48:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.138 2021/03/27 16:37:12 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.139 2021/03/27 19:48:00 rillig Exp $");
 #endif
 
 #include 
@@ -78,14 +78,11 @@ __RCSID("$NetBSD: init.c,v 1.138 2021/03
  *		init_rbrace			for each '}'
  *	end_initialization
  *
- * The state of the current initialization is stored in initstk, a stack of
- * initstack_element, one element per type aggregate level.
- * XXX: Or is that "one element per brace level"?  C99 mandates in 6.7.8p17
- * that "each brace-enclosed initializer list has an associated current
- * object".
+ * Each '{' begins a new brace level, each '}' ends the current brace level.
+ * Each brace level has an associated "current object".
  *
- * Most of the time, the topmost level of initstk contains a scalar type, and
- * its remaining count toggles between 1 and 0.
+ * Most of the time, the topmost level of brace_level contains a scalar type,
+ * and its remaining count toggles between 1 and 0.
  *
  * See also:
  *	C99 6.7.8 "Initialization"
@@ -94,7 +91,7 @@ __RCSID("$NetBSD: init.c,v 1.138 2021/03
 
 
 /*
- * Describes a single level of an ongoing initialization.
+ * Describes a single brace level of an ongoing initialization.
  *
  * XXX: Since C99, the initializers can be listed in arbitrary order by using
  * designators to specify the sub-object to be initialized.  The member names
@@ -104,10 +101,11 @@ __RCSID("$NetBSD: init.c,v 1.138 2021/03
  * See C99 6.7.8, which spans 6 pages full of tricky details and carefully
  * selected examples.
  */
-typedef	struct initstack_element {
+struct brace_level {
 
 	/*
-	 * The type to be initialized at this level.
+	 * The type of the current object that is initialized at this brace
+	 * level.
 	 *
 	 * On the outermost element, this is always NULL since the outermost
 	 * initializer-expression may be enclosed in an optional pair of
@@ -119,7 +117,7 @@ typedef	struct initstack_element {
 	 *
 	 * Everywhere else it is nonnull.
 	 */
-	type_t	*i_type;
+	type_t	*bl_type;
 
 	/*
 	 * The type that will be initialized at the next initialization level,
@@ -130,19 +128,19 @@ typedef	struct initstack_element {
 	 * For a struct or union type, it is one of the member types, but
 	 * without 'const'.
 	 *
-	 * The outermost stack element has no i_type but nevertheless has
-	 * i_subt.  For example, in 'int var = { 12345 }', initially there is
-	 * an initstack_element with i_subt 'int'.  When the '{' is processed,
-	 * an element with i_type 'int' is pushed to the stack.  When the
+	 * The outermost stack element has no bl_type but nevertheless has
+	 * bl_subtype.  For example, in 'int var = { 12345 }', initially there
+	 * is a brace_level with bl_subtype 'int'.  When the '{' is processed,
+	 * an element with bl_type 'int' is pushed to the stack.  When the
 	 * corresponding '}' is processed, the inner element is popped again.
 	 *
 	 * During initialization, only the top 2 elements of the stack are
 	 * looked at.
 	 *
-	 * XXX: Having i_subt here is the wrong approach, it should not be
-	 * necessary at all; see i_type.
+	 * XXX: Having bl_subtype here is the wrong approach, it should not be
+	 * necessary at all; see bl_type.
 	 */
-	type_t	*i_subt;
+	type_t	*bl_subtype;
 
 	/*
 	 * Whether this level of the initializer requires a '}' to be
@@ -152,16 +150,13 @@ typedef	struct initstack_element {
 	 * an inner array; for example, { 1, 2, 3, 4 } is a valid initializer
 	 * for 'int arr[2][2]'.
 	 *
-	 * TODO: Do structs containing structs need a closing brace?
-	 * TODO: Do arrays of structs need a closing brace after each struct?
-	 *
 	 * XXX: Double-check whether this is the correct approach at all; see
-	 * i_type.
+	 * bl_type.
 	 */
-	bool i_brace: 1;
+	bool bl_brace: 1;
 
-	/* Whether i_type is an array of unknown size. */
-	bool i_array_of_unknown_size: 1;
+	/* Whether bl_type is an array of unknown size. */
+	bool bl_array_of_unknown_size: 1;
 
 	/*
 	 * XXX: This feels wrong.  Whether or not there has been a named
@@ -169,15 +164,15 

CVS commit: src/lib/libedit

2021-03-27 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Mar 27 18:55:02 UTC 2021

Modified Files:
src/lib/libedit: filecomplete.c filecomplete.h

Log Message:
Add fn_complete2() that controls the quoting of the returned match.
Before it was based on the heuristic that we were not supplied an
attempted_completion_function, which worked well because programs
that supplied that function were not shells and did not want/understand
shell quoting. Recently though Piotr Stefaniak wanted to enhance command
completion for the Bourne Shell and this could benefit quoting the returned
command. This function adds an extra flags argument that controls that quoting.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/lib/libedit/filecomplete.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libedit/filecomplete.h

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

Modified files:

Index: src/lib/libedit/filecomplete.c
diff -u src/lib/libedit/filecomplete.c:1.64 src/lib/libedit/filecomplete.c:1.65
--- src/lib/libedit/filecomplete.c:1.64	Sun Jan  5 02:12:05 2020
+++ src/lib/libedit/filecomplete.c	Sat Mar 27 14:55:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecomplete.c,v 1.64 2020/01/05 07:12:05 abhinav Exp $	*/
+/*	$NetBSD: filecomplete.c,v 1.65 2021/03/27 18:55:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.64 2020/01/05 07:12:05 abhinav Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.65 2021/03/27 18:55:02 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -652,12 +652,13 @@ find_word_to_complete(const wchar_t * cu
  *   '!' could never be invoked
  */
 int
-fn_complete(EditLine *el,
-	char *(*complet_func)(const char *, int),
-	char **(*attempted_completion_function)(const char *, int, int),
-	const wchar_t *word_break, const wchar_t *special_prefixes,
-	const char *(*app_func)(const char *), size_t query_items,
-	int *completion_type, int *over, int *point, int *end)
+fn_complete2(EditLine *el,
+char *(*complete_func)(const char *, int),
+char **(*attempted_completion_function)(const char *, int, int),
+const wchar_t *word_break, const wchar_t *special_prefixes,
+const char *(*app_func)(const char *), size_t query_items,
+int *completion_type, int *over, int *point, int *end,
+unsigned int flags)
 {
 	const LineInfoW *li;
 	wchar_t *temp;
@@ -675,8 +676,8 @@ fn_complete(EditLine *el,
 	if (completion_type != NULL)
 		*completion_type = what_to_do;
 
-	if (!complet_func)
-		complet_func = fn_filename_completion_function;
+	if (!complete_func)
+		complete_func = fn_filename_completion_function;
 	if (!app_func)
 		app_func = append_char_function;
 
@@ -703,7 +704,7 @@ fn_complete(EditLine *el,
 	if (!attempted_completion_function ||
 	(over != NULL && !*over && !matches))
 		matches = completion_matches(
-		ct_encode_string(temp, >el_scratch), complet_func);
+		ct_encode_string(temp, >el_scratch), complete_func);
 
 	if (over != NULL)
 		*over = 0;
@@ -720,7 +721,7 @@ fn_complete(EditLine *el,
 
 	if (matches[0][0] != '\0') {
 		el_deletestr(el, (int)len);
-		if (!attempted_completion_function)
+		if (flags & FN_QUOTE_MATCH)
 			completion = escape_filename(el, matches[0],
 			single_match, app_func);
 		else
@@ -817,6 +818,20 @@ out:
 	return retval;
 }
 
+int
+fn_complete(EditLine *el,
+char *(*complete_func)(const char *, int),
+char **(*attempted_completion_function)(const char *, int, int),
+const wchar_t *word_break, const wchar_t *special_prefixes,
+const char *(*app_func)(const char *), size_t query_items,
+int *completion_type, int *over, int *point, int *end)
+{
+	return fn_complete2(el, complete_func, attempted_completion_function,
+	word_break, special_prefixes, app_func, query_items,
+	completion_type, over, point, end,
+	attempted_completion_function ? 0 : FN_QUOTE_MATCH);
+}
+
 /*
  * el-compatible wrapper around rl_complete; needed for key binding
  */

Index: src/lib/libedit/filecomplete.h
diff -u src/lib/libedit/filecomplete.h:1.11 src/lib/libedit/filecomplete.h:1.12
--- src/lib/libedit/filecomplete.h:1.11	Fri Apr 21 01:38:03 2017
+++ src/lib/libedit/filecomplete.h	Sat Mar 27 14:55:02 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: filecomplete.h,v 1.11 2017/04/21 05:38:03 abhinav Exp $	*/
+/*	$NetBSD: filecomplete.h,v 1.12 2021/03/27 18:55:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -36,6 +36,12 @@ int fn_complete(EditLine *,
 char **(*)(const char *, int, int),
 const wchar_t *, const wchar_t *, const char *(*)(const char *), size_t,
 int *, int *, int *, int *);
+int fn_complete2(EditLine *,
+char *(*)(const char *, int),
+char **(*)(const char *, int, int),
+const wchar_t *, const wchar_t *, const char *(*)(const char *), size_t,
+

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 16:37:12 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: extract look_up_member from initstack_push_struct_or_union

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.137 src/usr.bin/xlint/lint1/init.c:1.138
--- src/usr.bin/xlint/lint1/init.c:1.137	Sat Mar 27 16:24:21 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 16:37:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.137 2021/03/27 16:24:21 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.138 2021/03/27 16:37:12 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.137 2021/03/27 16:24:21 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.138 2021/03/27 16:37:12 rillig Exp $");
 #endif
 
 #include 
@@ -798,32 +798,11 @@ initstack_push_array(void)
 	type_name(istk->i_type), istk->i_remaining);
 }
 
-/* TODO: document me */
-/* TODO: think of a better name than 'push' */
-static bool
-initstack_push_struct_or_union(void)
+static sym_t *
+look_up_member(initstack_element *istk, int *count)
 {
-	/*
-	 * TODO: remove unnecessary 'const' for variables in functions that
-	 * fit on a single screen.  Keep it for larger functions.
-	 */
-	initstack_element *istk = initstk_lvalue;
-	int cnt;
 	sym_t *m;
 
-	if (is_incomplete(istk->i_type)) {
-		/* initialization of an incomplete type */
-		error(175);
-		initerr = true;
-		return false;
-	}
-
-	cnt = 0;
-	debug_designation();
-	debug_step("lookup for '%s'%s",
-	type_name(istk->i_type),
-	istk->i_seen_named_member ? ", seen named member" : "");
-
 	for (m = istk->i_type->t_str->sou_first_member;
 	 m != NULL; m = m->s_next) {
 		if (m->s_bitfield && m->s_name == unnamed)
@@ -842,17 +821,48 @@ initstack_push_struct_or_union(void)
 			m->s_name, current_designation().head->name);
 			if (strcmp(m->s_name,
 			current_designation().head->name) == 0) {
-cnt++;
+(*count)++;
 break;
 			} else
 continue;
 		}
-		if (++cnt == 1) {
+		if (++(*count) == 1) {
 			istk->i_next_member = m;
 			istk->i_subt = m->s_type;
 		}
 	}
 
+	return m;
+}
+
+/* TODO: document me */
+/* TODO: think of a better name than 'push' */
+static bool
+initstack_push_struct_or_union(void)
+{
+	/*
+	 * TODO: remove unnecessary 'const' for variables in functions that
+	 * fit on a single screen.  Keep it for larger functions.
+	 */
+	initstack_element *istk = initstk_lvalue;
+	int cnt;
+	sym_t *m;
+
+	if (is_incomplete(istk->i_type)) {
+		/* initialization of an incomplete type */
+		error(175);
+		initerr = true;
+		return false;
+	}
+
+	cnt = 0;
+	debug_designation();
+	debug_step("lookup for '%s'%s",
+	type_name(istk->i_type),
+	istk->i_seen_named_member ? ", seen named member" : "");
+
+	m = look_up_member(istk, );
+
 	if (current_designation().head != NULL) {
 		if (m == NULL) {
 			debug_step("pop struct");



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 16:24:21 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: clean up initstack_pop_item_named_member

Previously, the code accessed the global variable for the designator
several times, even though the designator cannot change during this part
of the code.  Make this obvious by passing this designator as a
parameter instead.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.136 src/usr.bin/xlint/lint1/init.c:1.137
--- src/usr.bin/xlint/lint1/init.c:1.136	Sat Mar 27 13:17:42 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 16:24:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.136 2021/03/27 13:17:42 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.137 2021/03/27 16:24:21 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.136 2021/03/27 13:17:42 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.137 2021/03/27 16:24:21 rillig Exp $");
 #endif
 
 #include 
@@ -598,7 +598,7 @@ initstack_init(void)
 
 /* TODO: document me */
 static void
-initstack_pop_item_named_member(void)
+initstack_pop_item_named_member(const char *name)
 {
 	initstack_element *istk = initstk_lvalue;
 	sym_t *m;
@@ -607,8 +607,7 @@ initstack_pop_item_named_member(void)
 	 * TODO: fix wording of the debug message; this doesn't seem to be
 	 * related to initializing the named member.
 	 */
-	debug_step("initializing named member '%s'",
-	current_designation().head->name);
+	debug_step("initializing named member '%s'", name);
 
 	if (istk->i_type->t_tspec != STRUCT &&
 	istk->i_type->t_tspec != UNION) {
@@ -624,7 +623,7 @@ initstack_pop_item_named_member(void)
 		if (m->s_bitfield && m->s_name == unnamed)
 			continue;
 
-		if (strcmp(m->s_name, current_designation().head->name) == 0) {
+		if (strcmp(m->s_name, name) == 0) {
 			debug_step("found matching member");
 			istk->i_subt = m->s_type;
 			/* XXX: why ++? */
@@ -635,8 +634,9 @@ initstack_pop_item_named_member(void)
 		}
 	}
 
+	/* TODO: add type information to the message */
 	/* undefined struct/union member: %s */
-	error(101, current_designation().head->name);
+	error(101, name);
 
 	designation_shift_level();
 	istk->i_seen_named_member = true;
@@ -672,6 +672,7 @@ static void
 initstack_pop_item(void)
 {
 	initstack_element *istk;
+	designator *first_designator;
 
 	debug_enter();
 
@@ -689,8 +690,9 @@ initstack_pop_item(void)
 	lint_assert(istk->i_remaining >= 0);
 	debug_step("%d elements remaining", istk->i_remaining);
 
-	if (current_designation().head != NULL)
-		initstack_pop_item_named_member();
+	first_designator = current_designation().head;
+	if (first_designator != NULL && first_designator->name != NULL)
+		initstack_pop_item_named_member(first_designator->name);
 	else
 		initstack_pop_item_unnamed();
 



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 16:13:41 UTC 2021

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

Log Message:
tests/lint: document expectations in test about array initialization


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/d_c99_init.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/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.14 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.15
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.14	Sat Mar 27 15:49:33 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c	Sat Mar 27 16:13:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_init.c,v 1.14 2021/03/27 15:49:33 rillig Exp $	*/
+/*	$NetBSD: d_c99_init.c,v 1.15 2021/03/27 16:13:41 rillig Exp $	*/
 # 3 "d_c99_init.c"
 
 /*
@@ -196,13 +196,16 @@ struct geometry {
  * structs.
  */
 struct geometry geometry = {
-// FIXME: assertion "istk->i_type != NULL" failed in initstack_push
-//.pentagons[0].points[4].x = 1,
-.points[0][0][0] = { 0, 0 },
-.points[2][4][1] = {301, 302 },
-.points[3][0][0] = {3001, 3002 },
-.points[0][5][0] = {501, 502 },
-.points[0][0][2] = {21, 22 },
+	// FIXME: assertion "istk->i_type != NULL" failed in initstack_push
+	//.pentagons[0].points[4].x = 1,
+	.points[0][0][0] = { 0, 0 },
+	.points[2][4][1] = {301, 302 },
+	/* TODO: expect+1: array index 3 must be between 0 and 2 */
+	.points[3][0][0] = {3001, 3002 },
+	/* TODO: expect+1: array index 5 must be between 0 and 4 */
+	.points[0][5][0] = {501, 502 },
+	/* TODO: expect+1: array index 2 must be between 0 and 1 */
+	.points[0][0][2] = {21, 22 },
 };
 
 // See d_struct_init_nested.c for a more complicated example.



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 15:49:33 UTC 2021

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

Log Message:
tests/lint: trigger assertion failure in array initialization


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/d_c99_init.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/d_c99_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.13 src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.14
--- src/tests/usr.bin/xlint/lint1/d_c99_init.c:1.13	Tue Mar 23 23:12:21 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_init.c	Sat Mar 27 15:49:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: d_c99_init.c,v 1.13 2021/03/23 23:12:21 rillig Exp $	*/
+/*	$NetBSD: d_c99_init.c,v 1.14 2021/03/27 15:49:33 rillig Exp $	*/
 # 3 "d_c99_init.c"
 
 /*
@@ -176,4 +176,33 @@ struct point points[] = {
 	}
 };
 
+
+struct triangle {
+	struct point points[3];
+};
+
+struct pentagon {
+	struct point points[5];
+};
+
+struct geometry {
+	struct pentagon pentagons[6];
+	struct triangle triangles[10];
+	struct point points[3][5][2];
+};
+
+/*
+ * Initialization of a complex struct containing nested arrays and nested
+ * structs.
+ */
+struct geometry geometry = {
+// FIXME: assertion "istk->i_type != NULL" failed in initstack_push
+//.pentagons[0].points[4].x = 1,
+.points[0][0][0] = { 0, 0 },
+.points[2][4][1] = {301, 302 },
+.points[3][0][0] = {3001, 3002 },
+.points[0][5][0] = {501, 502 },
+.points[0][0][2] = {21, 22 },
+};
+
 // See d_struct_init_nested.c for a more complicated example.



CVS commit: [netbsd-9] src/doc

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 14:38:15 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
Ticket #1237


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.60 -r1.1.2.61 src/doc/CHANGES-9.2

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-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.60 src/doc/CHANGES-9.2:1.1.2.61
--- src/doc/CHANGES-9.2:1.1.2.60	Sat Mar 27 13:02:49 2021
+++ src/doc/CHANGES-9.2	Sat Mar 27 14:38:15 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.60 2021/03/27 13:02:49 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.61 2021/03/27 14:38:15 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1889,3 +1889,417 @@ sys/dev/usb/usbdevs_data.h			(regen)
 	PR 56056: fix usb device id for BELKIN F5D7050E.
 	[nia, ticket #1236]
 
+crypto/external/bsd/openssl/dist/VMS/msg_install.com up to 1.1.1.1
+crypto/external/bsd/openssl/dist/VMS/msg_staging.com up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-cert-ec-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-cert-ec-named.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-key-ec-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-key-ec-named.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-cert-ec-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-cert-ec-named-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-cert-ec-named-named.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-key-ec-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-key-ec-named-explicit.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-key-ec-named-named.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-self-signed.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/root-expired.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-pss-cert.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ca-pss-key.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/ee-pss-cert.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/certs/invalid-cert.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/04-test_pem_data/cert-254-chars-at-the-end.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/04-test_pem_data/cert-254-chars-in-the-middle.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/04-test_pem_data/cert-oneline-multiple-of-254.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/05-test_cmac.t up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/15-test_genec.t up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/recipes/20-test_dgst.t up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/cmactest.c up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/tested25519.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/tested25519pub.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/tested448.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/test/tested448pub.pem up to 1.1.1.1
+crypto/external/bsd/openssl/dist/crypto/ec/asm/ecp_nistz256-avx2.pl delete
+crypto/external/bsd/openssl/dist/AUTHORSup to 1.1.1.3
+crypto/external/bsd/openssl/dist/CHANGESup to 1.27
+crypto/external/bsd/openssl/dist/CONTRIBUTING   up to 1.1.1.9
+crypto/external/bsd/openssl/dist/Configure  up to 1.28
+crypto/external/bsd/openssl/dist/INSTALLup to 1.1.1.14
+crypto/external/bsd/openssl/dist/NEWS   up to 1.27
+crypto/external/bsd/openssl/dist/NOTES.ANDROID  up to 1.1.1.5
+crypto/external/bsd/openssl/dist/NOTES.PERL up to 1.1.1.3
+crypto/external/bsd/openssl/dist/NOTES.VMS  up to 1.1.1.5
+crypto/external/bsd/openssl/dist/NOTES.WIN  up to 1.1.1.5
+crypto/external/bsd/openssl/dist/README up to 1.27
+crypto/external/bsd/openssl/dist/appveyor.yml   up to 1.1.1.6
+crypto/external/bsd/openssl/dist/config up to 1.1.1.12
+crypto/external/bsd/openssl/dist/e_os.h up to 1.17
+crypto/external/bsd/openssl/dist/Configurations/10-main.conf up to 1.1.1.9
+crypto/external/bsd/openssl/dist/Configurations/descrip.mms.tmpl up to 1.1.1.7
+crypto/external/bsd/openssl/dist/Configurations/unix-Makefile.tmpl up to 1.1.1.11
+crypto/external/bsd/openssl/dist/Configurations/windows-makefile.tmpl up to 1.1.1.7
+crypto/external/bsd/openssl/dist/apps/ca.c  up to 1.21
+crypto/external/bsd/openssl/dist/apps/cms.c up to 1.1.1.15
+crypto/external/bsd/openssl/dist/apps/genpkey.c up to 1.1.1.6
+crypto/external/bsd/openssl/dist/apps/rsa8192.pem up to 1.1.1.2
+crypto/external/bsd/openssl/dist/apps/s_cb.cup to 1.1.1.19
+crypto/external/bsd/openssl/dist/apps/s_client.c up to 1.23
+crypto/external/bsd/openssl/dist/apps/s_time.c  up to 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 13:59:18 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: d_c99_complex_split.c d_cast_lhs.c
d_ellipsis_in_switch.c d_gcc_compound_statements1.c
d_nolimit_init.c t_integration.sh

Log Message:
tests/lint: move description of tests into the tests themselves

In most cases the descriptions didn't add much to the test name anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/d_cast_lhs.c \
src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c \
src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/d_nolimit_init.c
cvs rdiff -u -r1.35 -r1.36 src/tests/usr.bin/xlint/lint1/t_integration.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/lint1/d_c99_complex_split.c
diff -u src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.4 src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.5
--- src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c:1.4	Sun Jan 31 14:57:28 2021
+++ src/tests/usr.bin/xlint/lint1/d_c99_complex_split.c	Sat Mar 27 13:59:18 2021
@@ -1,6 +1,11 @@
-/*	$NetBSD: d_c99_complex_split.c,v 1.4 2021/01/31 14:57:28 rillig Exp $	*/
+/*	$NetBSD: d_c99_complex_split.c,v 1.5 2021/03/27 13:59:18 rillig Exp $	*/
 # 3 "d_c99_complex_split.c"
 
+/*
+ * Checks that the real and imaginary parts of a complex number can be
+ * accessed (since C99).
+ */
+
 int
 b(double a)
 {

Index: src/tests/usr.bin/xlint/lint1/d_cast_lhs.c
diff -u src/tests/usr.bin/xlint/lint1/d_cast_lhs.c:1.3 src/tests/usr.bin/xlint/lint1/d_cast_lhs.c:1.4
--- src/tests/usr.bin/xlint/lint1/d_cast_lhs.c:1.3	Sun Jan 31 14:57:28 2021
+++ src/tests/usr.bin/xlint/lint1/d_cast_lhs.c	Sat Mar 27 13:59:18 2021
@@ -1,7 +1,12 @@
-/*	$NetBSD: d_cast_lhs.c,v 1.3 2021/01/31 14:57:28 rillig Exp $	*/
+/*	$NetBSD: d_cast_lhs.c,v 1.4 2021/03/27 13:59:18 rillig Exp $	*/
 # 3 "d_cast_lhs.c"
 
-/* pointer casts are valid lhs lvalues */
+/*
+ * pointer casts are valid lhs lvalues
+ *
+ * XXX: C99 6.5.4 "Cast operators" footnote 85 says "A cast does not yield an
+ * lvalue".  It does not mention any exceptional rule for pointers.
+ */
 struct sockaddr {
 };
 
Index: src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c
diff -u src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c:1.3 src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c:1.4
--- src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c:1.3	Sun Jan 31 14:57:28 2021
+++ src/tests/usr.bin/xlint/lint1/d_ellipsis_in_switch.c	Sat Mar 27 13:59:18 2021
@@ -1,6 +1,8 @@
-/*	$NetBSD: d_ellipsis_in_switch.c,v 1.3 2021/01/31 14:57:28 rillig Exp $	*/
+/*	$NetBSD: d_ellipsis_in_switch.c,v 1.4 2021/03/27 13:59:18 rillig Exp $	*/
 # 3 "d_ellipsis_in_switch.c"
 
+/* Using a range in a case label is a GCC extension. */
+
 int
 x(void)
 {
Index: src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c
diff -u src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.3 src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.4
--- src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c:1.3	Sun Jan 31 14:57:28 2021
+++ src/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c	Sat Mar 27 13:59:18 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: d_gcc_compound_statements1.c,v 1.3 2021/01/31 14:57:28 rillig Exp $	*/
+/*	$NetBSD: d_gcc_compound_statements1.c,v 1.4 2021/03/27 13:59:18 rillig Exp $	*/
 # 3 "d_gcc_compound_statements1.c"
 
-/* GCC compound statements */
+/* GCC compound statement with expression */
 
 foo(unsigned long z)
 {

Index: src/tests/usr.bin/xlint/lint1/d_nolimit_init.c
diff -u src/tests/usr.bin/xlint/lint1/d_nolimit_init.c:1.2 src/tests/usr.bin/xlint/lint1/d_nolimit_init.c:1.3
--- src/tests/usr.bin/xlint/lint1/d_nolimit_init.c:1.2	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_nolimit_init.c	Sat Mar 27 13:59:18 2021
@@ -1,7 +1,10 @@
-/*	$NetBSD: d_nolimit_init.c,v 1.2 2021/01/31 14:39:31 rillig Exp $	*/
+/*	$NetBSD: d_nolimit_init.c,v 1.3 2021/03/27 13:59:18 rillig Exp $	*/
 # 3 "d_nolimit_init.c"
 
-/* no limit initializers */
-char foo[][4] = {
+/*
+ * no limit initializers, or as C99 calls it, initialization of an array of
+ * unknown size
+ */
+char weekday_names[][4] = {
 	"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
 };

Index: src/tests/usr.bin/xlint/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.35 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.36
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.35	Sat Mar 27 13:28:03 2021
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Sat Mar 27 13:59:18 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.35 2021/03/27 13:28:03 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.36 2021/03/27 13:59:18 rillig Exp 

CVS commit: [netbsd-8] src/doc

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:41:50 UTC 2021

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Tickets #1667 and #1668


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.80 -r1.1.2.81 src/doc/CHANGES-8.3

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-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.80 src/doc/CHANGES-8.3:1.1.2.81
--- src/doc/CHANGES-8.3:1.1.2.80	Mon Mar 22 18:08:34 2021
+++ src/doc/CHANGES-8.3	Sat Mar 27 13:41:50 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.80 2021/03/22 18:08:34 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.81 2021/03/27 13:41:50 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1801,3 +1801,37 @@ sys/net/if_l2tp.h1.10
 	Fix l2tp(4) ioctl type.
 	[knakahara, ticket #1665]
 
+sys/dev/usb/usbdevs1.793
+sys/dev/usb/usbdevs.h(regen)
+sys/dev/usb/usbdevs_data.h			(regen)
+
+	PR 56056: fix usb device id for BELKIN F5D7050E.
+	[nia, ticket #1667]
+
+Makefile			1.30-1.31 (patch)
+Makefile.boot			1.7-1.9 (patch)
+auth-bozo.c			1.25-1.26 (patch)
+bozohttpd.8			1.80-1.87 (patch)
+bozohttpd.c			1.114-1.123,1.125-1.128 (patch)
+bozohttpd.h			1.61-1.68 (patch)
+cgi-bozo.c			1.49-1.53 (patch)
+content-bozo.c			1.17-1.20 (patch)
+daemon-bozo.c			1-.22 (patch)
+dir-index-bozo.c		1.33-1.34 (patch)
+main.c1.23-1.27 (patch)
+printenv.lua			1.4-1.5 (patch)
+ssl-bozo.c			1.27-1.29 (patch)
+libbozohttpd/libbozohttpd.3	1.5-1.6 (patch)
+small/Makefile			1.4 (patch)
+testsuite/Makefile		1.14 (patch)
+testsuite/t16.in		1.1 (patch)
+testsuite/t16.out		1.1 (patch)
+testsuite/t17.in		1.1 (patch)
+testsuite/t17.out		1.1 (patch)
+testsuite/t18.in		1.1 (patch)
+testsuite/t18.out		1.1 (patch)
+
+	Update bozohttpd to 20210227.
+	[mrg, ticket #1668]
+
+



CVS commit: [netbsd-8] src/libexec/httpd

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:38:52 UTC 2021

Modified Files:
src/libexec/httpd [netbsd-8]: CHANGES Makefile Makefile.boot
auth-bozo.c bozohttpd.8 bozohttpd.c bozohttpd.h cgi-bozo.c
content-bozo.c daemon-bozo.c dir-index-bozo.c main.c printenv.lua
ssl-bozo.c
src/libexec/httpd/libbozohttpd [netbsd-8]: Makefile libbozohttpd.3
src/libexec/httpd/small [netbsd-8]: Makefile
src/libexec/httpd/testsuite [netbsd-8]: Makefile
Added Files:
src/libexec/httpd/testsuite [netbsd-8]: t16.in t16.out t17.in t17.out
t18.in t18.out

Log Message:
Pull up the following via patch, requested by mrg in ticket #1668:

Makefile1.30-1.31
Makefile.boot   1.7-1.9
auth-bozo.c 1.25-1.26
bozohttpd.8 1.80-1.87
bozohttpd.c 1.114-1.123,1.125-1.128
bozohttpd.h 1.61-1.68
cgi-bozo.c  1.49-1.53
content-bozo.c  1.17-1.20
daemon-bozo.c   1-.22
dir-index-bozo.c1.33-1.34
main.c  1.23-1.27
printenv.lua1.4-1.5
ssl-bozo.c  1.27-1.29
libbozohttpd/libbozohttpd.3 1.5-1.6
small/Makefile  1.4
testsuite/Makefile  1.14
testsuite/t16.in1.1
testsuite/t16.out   1.1
testsuite/t17.in1.1
testsuite/t17.out   1.1
testsuite/t18.in1.1
testsuite/t18.out   1.1

Update to bozohttpd 20210227.

changes in bozohttpd 20210227:
o  new support for content types: .tar.bz2, .tar.xz, .tar.lz,
   .tar.zst, .tbz2, .txz, .tlz, .zipx, .xz, .zst, .sz, .lz, .lzma,
   .lzo, .7z, .lzo, .cab, .dmg, .jar, and .rar.  should fix
   netbsd PR#56026:
   MIME type of .tar.xz file on ny{cdn,ftp}.NetBSD.org is invalid

changes in bozohttpd 20210211:
o  fix various NULL derefs from malformed headers.  mostly from
   .
o  fix memory leaks in library interface: add bozo_cleanup().

changes in bozohttpd 20201014:
o  also set -D_GNU_SOURCE in Makefile.boot.  from
   hadrien.lac...@posteo.net.
o  fix array size botch (assertion, not exploitable.)  from
   mar...@netbsd.org.
o  also match %2F as well as %2f.  from l...@vuxu.org.
o  many manual and help fixes.  clean ups for higher lint levels,
   consistency/style clean ups.  various option fixes including made
   -f imply -b.  from  for freebsd.

changes in bozohttpd 20200912:
o  add .m4a and .m4v file extensions.

changes in bozohttpd 20200820:
o  make this work on sun2 by reducing mmap window there.
o  fix SSL shutdown sequence.  from s...@netbsd.org.
o  add readme support to directory indexing.  from jmcne...@netbsd.org
o  add blocklist(8) support.  from jru...@netbsd.org.


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.3 -r1.25.4.4 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.27.2.1 -r1.27.2.2 src/libexec/httpd/Makefile
cvs rdiff -u -r1.6 -r1.6.18.1 src/libexec/httpd/Makefile.boot
cvs rdiff -u -r1.18.8.2 -r1.18.8.3 src/libexec/httpd/auth-bozo.c
cvs rdiff -u -r1.65.4.2 -r1.65.4.3 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.86.4.5 -r1.86.4.6 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.47.4.3 -r1.47.4.4 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.37.4.4 -r1.37.4.5 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.14.6.1 -r1.14.6.2 src/libexec/httpd/content-bozo.c
cvs rdiff -u -r1.17.8.2 -r1.17.8.3 src/libexec/httpd/daemon-bozo.c
cvs rdiff -u -r1.25.8.2 -r1.25.8.3 src/libexec/httpd/dir-index-bozo.c
cvs rdiff -u -r1.16.6.2 -r1.16.6.3 src/libexec/httpd/main.c
cvs rdiff -u -r1.3 -r1.3.8.1 src/libexec/httpd/printenv.lua
cvs rdiff -u -r1.22.8.2 -r1.22.8.3 src/libexec/httpd/ssl-bozo.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/libexec/httpd/libbozohttpd/Makefile
cvs rdiff -u -r1.4 -r1.4.4.1 src/libexec/httpd/libbozohttpd/libbozohttpd.3
cvs rdiff -u -r1.3 -r1.3.16.1 src/libexec/httpd/small/Makefile
cvs rdiff -u -r1.7.4.2 -r1.7.4.3 src/libexec/httpd/testsuite/Makefile
cvs rdiff -u -r0 -r1.1.2.2 src/libexec/httpd/testsuite/t16.in \
src/libexec/httpd/testsuite/t17.in src/libexec/httpd/testsuite/t18.in
cvs rdiff -u -r0 -r1.1.4.2 src/libexec/httpd/testsuite/t16.out \
src/libexec/httpd/testsuite/t17.out src/libexec/httpd/testsuite/t18.out

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.25.4.3 src/libexec/httpd/CHANGES:1.25.4.4
--- src/libexec/httpd/CHANGES:1.25.4.3	Wed Jun 12 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 13:28:03 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: t_integration.sh

Log Message:
tests/lint: do not force tests to start with 'd_'

Using only parts of the test name files in t_integration.sh made it
unnecessarily difficult to find a test based on its filename.  The tests
for the individual messages already have a different prefix.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/tests/usr.bin/xlint/lint1/t_integration.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/lint1/t_integration.sh
diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.34 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.35
--- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.34	Tue Mar 23 21:19:08 2021
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh	Sat Mar 27 13:28:03 2021
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.34 2021/03/23 21:19:08 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.35 2021/03/27 13:28:03 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -83,101 +83,101 @@ test_case()
 		atf_set \"require.progs\" \"${LINT1}\"
 	}"
 	eval "${name}_body() {
-		check_lint1 d_${name}.c
+		check_lint1 ${name}.c
 	}"
 
 	Names="${Names} ${name}"
 }
 
-test_case bltinoffsetof
-test_case c99_anon_struct
-test_case c99_anon_union
-test_case c99_bool
-test_case c99_bool_strict
-test_case c99_bool_strict_syshdr
-test_case c99_compound_literal_comma
-test_case c99_decls_after_stmt2
-test_case c99_flex_array_packed
-test_case c99_init
-test_case c99_nested_struct
-test_case c99_union_cast
-test_case c99_union_init4
-test_case c99_union_init5
-test_case cast_fun_array_param
-test_case cast_typeof
-test_case decl_old_style_arguments
-test_case fold_test
-test_case gcc_extension
-test_case init_array_using_string
-test_case init_pop_member
-test_case lint_assert
-test_case return_type
-test_case type_question_colon
-test_case typefun
-test_case typename_as_var
-
-test_case c99_struct_init
-test_case c99_union_init1
-test_case c99_union_init2
-test_case c99_union_init3
-test_case c99_recursive_init
-test_case c9x_recursive_init
-test_case nested_structs
-test_case packed_structs
-test_case pr_22119
-test_case struct_init_nested
+test_case d_bltinoffsetof
+test_case d_c99_anon_struct
+test_case d_c99_anon_union
+test_case d_c99_bool
+test_case d_c99_bool_strict
+test_case d_c99_bool_strict_syshdr
+test_case d_c99_compound_literal_comma
+test_case d_c99_decls_after_stmt2
+test_case d_c99_flex_array_packed
+test_case d_c99_init
+test_case d_c99_nested_struct
+test_case d_c99_union_cast
+test_case d_c99_union_init4
+test_case d_c99_union_init5
+test_case d_cast_fun_array_param
+test_case d_cast_typeof
+test_case d_decl_old_style_arguments
+test_case d_fold_test
+test_case d_gcc_extension
+test_case d_init_array_using_string
+test_case d_init_pop_member
+test_case d_lint_assert
+test_case d_return_type
+test_case d_type_question_colon
+test_case d_typefun
+test_case d_typename_as_var
+
+test_case d_c99_struct_init
+test_case d_c99_union_init1
+test_case d_c99_union_init2
+test_case d_c99_union_init3
+test_case d_c99_recursive_init
+test_case d_c9x_recursive_init
+test_case d_nested_structs
+test_case d_packed_structs
+test_case d_pr_22119
+test_case d_struct_init_nested
 
-test_case cast_init
-test_case cast_init2		"Checks cast initialization as the rhs of a" \
+test_case d_cast_init
+test_case d_cast_init2		"Checks cast initialization as the rhs of a" \
 "- operand"
-test_case cast_lhs		"Checks whether pointer casts are valid lhs" \
+test_case d_cast_lhs		"Checks whether pointer casts are valid lhs" \
 "lvalues"
 
-test_case gcc_func		"Checks GCC __FUNCTION__"
-test_case c99_func		"Checks C99 __func__"
+test_case d_gcc_func		"Checks GCC __FUNCTION__"
+test_case d_c99_func		"Checks C99 __func__"
 
-test_case gcc_variable_array_init "Checks GCC variable array initializers"
-test_case c9x_array_init
-test_case c99_decls_after_stmt
-test_case c99_decls_after_stmt3
-test_case nolimit_init		"Checks no limit initializers"
-test_case zero_sized_arrays
-
-test_case compound_literals1
-test_case compound_literals2
-test_case gcc_compound_statements1
-test_case gcc_compound_statements2 "Checks GCC compound statements with" \
+test_case d_gcc_variable_array_init "Checks GCC variable array initializers"
+test_case d_c9x_array_init
+test_case d_c99_decls_after_stmt
+test_case d_c99_decls_after_stmt3
+test_case d_nolimit_init	"Checks no limit initializers"
+test_case d_zero_sized_arrays
+
+test_case d_compound_literals1
+test_case d_compound_literals2
+test_case d_gcc_compound_statements1
+test_case d_gcc_compound_statements2 "Checks GCC compound statements with" \
 "non-expressions"
-test_case gcc_compound_statements3 "Checks GCC compound 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 13:17:43 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: fix and update comments about initialization


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.135 src/usr.bin/xlint/lint1/init.c:1.136
--- src/usr.bin/xlint/lint1/init.c:1.135	Sat Mar 27 13:08:20 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 13:17:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.135 2021/03/27 13:08:20 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.136 2021/03/27 13:17:42 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.135 2021/03/27 13:08:20 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.136 2021/03/27 13:17:42 rillig Exp $");
 #endif
 
 #include 
@@ -94,7 +94,7 @@ __RCSID("$NetBSD: init.c,v 1.135 2021/03
 
 
 /*
- * Type of stack which is used for initialization of aggregate types.
+ * Describes a single level of an ongoing initialization.
  *
  * XXX: Since C99, the initializers can be listed in arbitrary order by using
  * designators to specify the sub-object to be initialized.  The member names
@@ -401,8 +401,6 @@ debug_designation(void)
 }
 
 /*
- * TODO: try whether a single-line output is more readable
- *
  * TODO: only log the top of the stack after each modifying operation
  *
  * TODO: wrap all write accesses to initstack_element in setter functions



CVS commit: [netbsd-8] src/sys/dev/usb

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:10:45 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdevs.h usbdevs_data.h

Log Message:
Regen for ticket #1667 (BELKIN F5D7050E fix)


To generate a diff of this commit:
cvs rdiff -u -r1.727.2.6 -r1.727.2.7 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.728.2.6 -r1.728.2.7 src/sys/dev/usb/usbdevs_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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.727.2.6 src/sys/dev/usb/usbdevs.h:1.727.2.7
--- src/sys/dev/usb/usbdevs.h:1.727.2.6	Thu Feb 27 14:34:11 2020
+++ src/sys/dev/usb/usbdevs.h	Sat Mar 27 13:10:43 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.727.2.6 2020/02/27 14:34:11 martin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.727.2.7 2021/03/27 13:10:43 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.736.2.6 2020/02/27 14:32:31 martin Exp
+ *	NetBSD: usbdevs,v 1.736.2.7 2021/03/27 13:09:46 martin Exp
  */
 
 /*-
@@ -1087,7 +1087,7 @@
 #define	USB_PRODUCT_BELKIN_F5D7051	0x7051		/* F5D7051 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_F5D7050A	0x705a		/* F5D705A 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_F5D7050C	0x705c		/* F5D705C 54g USB Network Adapter */
-#define	USB_PRODUCT_BELKIN_F5D7050E	0x705c		/* F5D705E 54g USB Network Adapter */
+#define	USB_PRODUCT_BELKIN_F5D7050E	0x705e		/* F5D705E 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_RT2870_1	0x8053		/* RT2870 */
 #define	USB_PRODUCT_BELKIN_RT2870_2	0x805c		/* RT2870 */
 #define	USB_PRODUCT_BELKIN_F5D8053V3	0x815c		/* F5D8053 v3 */

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.728.2.6 src/sys/dev/usb/usbdevs_data.h:1.728.2.7
--- src/sys/dev/usb/usbdevs_data.h:1.728.2.6	Thu Feb 27 14:34:11 2020
+++ src/sys/dev/usb/usbdevs_data.h	Sat Mar 27 13:10:43 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.728.2.6 2020/02/27 14:34:11 martin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.728.2.7 2021/03/27 13:10:43 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.736.2.6 2020/02/27 14:32:31 martin Exp
+ *	NetBSD: usbdevs,v 1.736.2.7 2021/03/27 13:09:46 martin Exp
  */
 
 /*-



CVS commit: [netbsd-8] src/sys/dev/usb

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:09:46 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-8]: usbdevs

Log Message:
Pull up following revision(s) (requested by nia in ticket #1667):

sys/dev/usb/usbdevs: revision 1.793

correct usb device id for BELKIN F5D7050E

matches freebsd / openbsd (sources of urtw driver), various online
sources

PR kern/56056


To generate a diff of this commit:
cvs rdiff -u -r1.736.2.6 -r1.736.2.7 src/sys/dev/usb/usbdevs

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/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.736.2.6 src/sys/dev/usb/usbdevs:1.736.2.7
--- src/sys/dev/usb/usbdevs:1.736.2.6	Thu Feb 27 14:32:31 2020
+++ src/sys/dev/usb/usbdevs	Sat Mar 27 13:09:46 2021
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.736.2.6 2020/02/27 14:32:31 martin Exp $
+$NetBSD: usbdevs,v 1.736.2.7 2021/03/27 13:09:46 martin Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1080,7 +1080,7 @@ product BELKIN F5D7050		0x7050	F5D7050 5
 product BELKIN F5D7051		0x7051	F5D7051 54g USB Network Adapter
 product BELKIN F5D7050A		0x705a	F5D705A 54g USB Network Adapter
 product BELKIN F5D7050C		0x705c	F5D705C 54g USB Network Adapter
-product BELKIN F5D7050E		0x705c	F5D705E 54g USB Network Adapter
+product BELKIN F5D7050E		0x705e	F5D705E 54g USB Network Adapter
 product BELKIN RT2870_1		0x8053	RT2870
 product BELKIN RT2870_2		0x805c	RT2870
 product BELKIN F5D8053V3	0x815c	F5D8053 v3



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 13:08:20 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: init.c

Log Message:
lint: merge duplicate code in initialization

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.bin/xlint/lint1/init.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/init.c
diff -u src/usr.bin/xlint/lint1/init.c:1.134 src/usr.bin/xlint/lint1/init.c:1.135
--- src/usr.bin/xlint/lint1/init.c:1.134	Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/lint1/init.c	Sat Mar 27 13:08:20 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.134 2021/03/26 20:31:07 rillig Exp $	*/
+/*	$NetBSD: init.c,v 1.135 2021/03/27 13:08:20 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.134 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.135 2021/03/27 13:08:20 rillig Exp $");
 #endif
 
 #include 
@@ -215,8 +215,9 @@ typedef	struct initstack_element {
 } initstack_element;
 
 /*
- * Leads the path to the sub-object to initialize using the expression.
- * Example designators are '.member' or '.member[123].member.member[1][1]'.
+ * A single component on the path to the sub-object that is initialized by an
+ * initializer expression.  Either a struct or union member, or an array
+ * subscript.
  *
  * See also: C99 6.7.8 "Initialization"
  */
@@ -227,6 +228,10 @@ typedef struct designator {
 } designator;
 
 /*
+ * The optional designation for an initializer, saying which sub-object to
+ * initialize.  Examples for designations are '.member' or
+ * '.member[123].member.member[1][1]'.
+ *
  * See also: C99 6.7.8 "Initialization"
  */
 typedef struct {
@@ -265,27 +270,29 @@ static struct initialization *init;
 static	bool	init_array_using_string(tnode_t *);
 
 
-/* TODO: replace the following functions with current_init */
+static struct initialization *
+current_init(void)
+{
+	lint_assert(init != NULL);
+	return init;
+}
 
 bool *
 current_initerr(void)
 {
-	lint_assert(init != NULL);
-	return >initerr;
+	return _init()->initerr;
 }
 
 sym_t **
 current_initsym(void)
 {
-	lint_assert(init != NULL);
-	return >initsym;
+	return _init()->initsym;
 }
 
 static designation *
 current_designation_mod(void)
 {
-	lint_assert(init != NULL);
-	return >designation;
+	return _init()->designation;
 }
 
 static designation
@@ -297,15 +304,13 @@ current_designation(void)
 static const initstack_element *
 current_initstk(void)
 {
-	lint_assert(init != NULL);
-	return init->initstk;
+	return current_init()->initstk;
 }
 
 static initstack_element **
 current_initstk_lvalue(void)
 {
-	lint_assert(init != NULL);
-	return >initstk;
+	return _init()->initstk;
 }
 
 static void



CVS commit: [netbsd-9] src/doc

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:02:49 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
Ticket #1236


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.59 -r1.1.2.60 src/doc/CHANGES-9.2

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-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.59 src/doc/CHANGES-9.2:1.1.2.60
--- src/doc/CHANGES-9.2:1.1.2.59	Mon Mar 22 18:24:14 2021
+++ src/doc/CHANGES-9.2	Sat Mar 27 13:02:49 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.59 2021/03/22 18:24:14 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.60 2021/03/27 13:02:49 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1882,3 +1882,10 @@ external/cddl/osnet/dist/uts/common/fs/z
 	PR 55042: avoid a panic when creating a directory on a NFS served ZFS.
 	[hannken, ticket #1235]
 
+sys/dev/usb/usbdevs1.793
+sys/dev/usb/usbdevs.h(regen)
+sys/dev/usb/usbdevs_data.h			(regen)
+
+	PR 56056: fix usb device id for BELKIN F5D7050E.
+	[nia, ticket #1236]
+



CVS commit: [netbsd-9] src/sys/dev/usb

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:02:00 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: usbdevs.h usbdevs_data.h

Log Message:
regen for ticket #1236 (BELKIN F5D7050E fix)


To generate a diff of this commit:
cvs rdiff -u -r1.760.4.7 -r1.760.4.8 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_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/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.760.4.7 src/sys/dev/usb/usbdevs.h:1.760.4.8
--- src/sys/dev/usb/usbdevs.h:1.760.4.7	Thu Feb  4 19:23:59 2021
+++ src/sys/dev/usb/usbdevs.h	Sat Mar 27 13:01:58 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.760.4.7 2021/02/04 19:23:59 martin Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.760.4.8 2021/03/27 13:01:58 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.770.4.7 2021/02/04 19:23:10 martin Exp
+ *	NetBSD: usbdevs,v 1.770.4.8 2021/03/27 13:00:45 martin Exp
  */
 
 /*-
@@ -1086,7 +1086,7 @@
 #define	USB_PRODUCT_BELKIN_F5D7051	0x7051		/* F5D7051 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_F5D7050A	0x705a		/* F5D705A 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_F5D7050C	0x705c		/* F5D705C 54g USB Network Adapter */
-#define	USB_PRODUCT_BELKIN_F5D7050E	0x705c		/* F5D705E 54g USB Network Adapter */
+#define	USB_PRODUCT_BELKIN_F5D7050E	0x705e		/* F5D705E 54g USB Network Adapter */
 #define	USB_PRODUCT_BELKIN_RT2870_1	0x8053		/* RT2870 */
 #define	USB_PRODUCT_BELKIN_RT2870_2	0x805c		/* RT2870 */
 #define	USB_PRODUCT_BELKIN_F5D8053V3	0x815c		/* F5D8053 v3 */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.760.4.7 src/sys/dev/usb/usbdevs_data.h:1.760.4.8
--- src/sys/dev/usb/usbdevs_data.h:1.760.4.7	Thu Feb  4 19:23:59 2021
+++ src/sys/dev/usb/usbdevs_data.h	Sat Mar 27 13:01:58 2021
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.760.4.7 2021/02/04 19:23:59 martin Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.760.4.8 2021/03/27 13:01:58 martin Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.770.4.7 2021/02/04 19:23:10 martin Exp
+ *	NetBSD: usbdevs,v 1.770.4.8 2021/03/27 13:00:45 martin Exp
  */
 
 /*-



CVS commit: [netbsd-9] src/sys/dev/usb

2021-03-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Mar 27 13:00:45 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: usbdevs

Log Message:
Pull up following revision(s) (requested by nia in ticket #1236):

sys/dev/usb/usbdevs: revision 1.793

correct usb device id for BELKIN F5D7050E

matches freebsd / openbsd (sources of urtw driver), various online
sources

PR kern/56056


To generate a diff of this commit:
cvs rdiff -u -r1.770.4.7 -r1.770.4.8 src/sys/dev/usb/usbdevs

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/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.770.4.7 src/sys/dev/usb/usbdevs:1.770.4.8
--- src/sys/dev/usb/usbdevs:1.770.4.7	Thu Feb  4 19:23:10 2021
+++ src/sys/dev/usb/usbdevs	Sat Mar 27 13:00:45 2021
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.770.4.7 2021/02/04 19:23:10 martin Exp $
+$NetBSD: usbdevs,v 1.770.4.8 2021/03/27 13:00:45 martin Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1079,7 +1079,7 @@ product BELKIN F5D7050		0x7050	F5D7050 5
 product BELKIN F5D7051		0x7051	F5D7051 54g USB Network Adapter
 product BELKIN F5D7050A		0x705a	F5D705A 54g USB Network Adapter
 product BELKIN F5D7050C		0x705c	F5D705C 54g USB Network Adapter
-product BELKIN F5D7050E		0x705c	F5D705E 54g USB Network Adapter
+product BELKIN F5D7050E		0x705e	F5D705E 54g USB Network Adapter
 product BELKIN RT2870_1		0x8053	RT2870
 product BELKIN RT2870_2		0x805c	RT2870
 product BELKIN F5D8053V3	0x815c	F5D8053 v3



CVS commit: src/usr.bin/xlint

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:42:22 UTC 2021

Modified Files:
src/usr.bin/xlint/common: tyname.c
src/usr.bin/xlint/lint1: decl.c err.c externs1.h lex.c lint1.h

Log Message:
lint: rename LERROR to INTERNAL_ERROR

The '#ifndef' in tyname.c is meant to distinguish between lint1 and
lint2, it is not meant to be defined from anywhere outside the lint code
itself.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.89 -r1.90 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/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.35 src/usr.bin/xlint/common/tyname.c:1.36
--- src/usr.bin/xlint/common/tyname.c:1.35	Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/common/tyname.c	Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $");
 #endif
 
 #include 
@@ -45,8 +45,8 @@ __RCSID("$NetBSD: tyname.c,v 1.35 2021/0
 
 #include PASS
 
-#ifndef LERROR
-#define LERROR(fmt, args...) \
+#ifndef INTERNAL_ERROR
+#define INTERNAL_ERROR(fmt, args...) \
 	do { \
 		(void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \
 		abort(); \
@@ -180,7 +180,7 @@ tspec_name(tspec_t t)
 	case DCOMPLEX:	return "double _Complex";
 	case LCOMPLEX:	return "long double _Complex";
 	default:
-		LERROR("tspec_name(%d)", t);
+		INTERNAL_ERROR("tspec_name(%d)", t);
 		return NULL;
 	}
 }
@@ -244,7 +244,7 @@ sametype(const type_t *t1, const type_t 
 		return true;
 #endif
 	default:
-		LERROR("tyname(%d)", t);
+		INTERNAL_ERROR("tyname(%d)", t);
 		return false;
 	}
 }
@@ -402,7 +402,7 @@ type_name(const type_t *tp)
 		type_name_of_function(, tp);
 		break;
 	default:
-		LERROR("type_name(%d)", t);
+		INTERNAL_ERROR("type_name(%d)", t);
 	}
 
 	name = intern(buf.data);

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.163 src/usr.bin/xlint/lint1/decl.c:1.164
--- src/usr.bin/xlint/lint1/decl.c:1.163	Sat Mar 27 11:08:00 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $");
 #endif
 
 #include 
@@ -823,7 +823,7 @@ deftyp(void)
 		case LCOMPLEX:
 			break;
 		default:
-			LERROR("deftyp(%s)", tspec_name(t));
+			INTERNAL_ERROR("deftyp(%s)", tspec_name(t));
 		}
 		if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
 			dcs->d_terr = true;
@@ -909,7 +909,7 @@ length(const type_t *tp, const char *nam
 	switch (tp->t_tspec) {
 	case FUNC:
 		/* compiler takes size of function */
-		LERROR("%s", msgs[12]);
+		INTERNAL_ERROR("%s", msgs[12]);
 		/* NOTREACHED */
 	case STRUCT:
 	case UNION:
@@ -928,7 +928,7 @@ length(const type_t *tp, const char *nam
 	default:
 		elsz = size_in_bits(tp->t_tspec);
 		if (elsz <= 0)
-			LERROR("length(%d)", elsz);
+			INTERNAL_ERROR("length(%d)", elsz);
 		break;
 	}
 	return elem * elsz;

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.95 src/usr.bin/xlint/lint1/err.c:1.96
--- src/usr.bin/xlint/lint1/err.c:1.95	Fri Mar 26 23:17:33 2021
+++ src/usr.bin/xlint/lint1/err.c	Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.95 2021/03/26 23:17:33 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.96 2021/03/27 12:42:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.95 2021/03/26 23:17:33 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.96 2021/03/27 12:42:22 rillig Exp $");
 #endif
 
 #include 
@@ -480,7 +480,7 @@ void
 }
 
 void
-lerror(const char *file, int line, const char *msg, ...)
+internal_error(const char *file, int line, const char *msg, ...)
 {
 	va_list	ap;
 	const	char *fn;

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.90 src/usr.bin/xlint/lint1/externs1.h:1.91
--- 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:32:19 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: emit1.c externs1.h lex.c mem1.c

Log Message:
lint: rename filename management functions

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/mem1.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/emit1.c
diff -u src/usr.bin/xlint/lint1/emit1.c:1.42 src/usr.bin/xlint/lint1/emit1.c:1.43
--- src/usr.bin/xlint/lint1/emit1.c:1.42	Fri Feb 19 22:27:49 2021
+++ src/usr.bin/xlint/lint1/emit1.c	Sat Mar 27 12:32:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: emit1.c,v 1.42 2021/02/19 22:27:49 rillig Exp $ */
+/* $NetBSD: emit1.c,v 1.43 2021/03/27 12:32:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit1.c,v 1.42 2021/02/19 22:27:49 rillig Exp $");
+__RCSID("$NetBSD: emit1.c,v 1.43 2021/03/27 12:32:19 rillig Exp $");
 #endif
 
 #include 
@@ -212,7 +212,7 @@ outtt(sym_t *tag, sym_t *tdef)
 		outint(3);
 		outint(tag->s_def_pos.p_line);
 		outchar('.');
-		outint(getfnid(tag->s_def_pos.p_file));
+		outint(get_filename_id(tag->s_def_pos.p_file));
 		outchar('.');
 		outint(tag->s_def_pos.p_uniq);
 	}
@@ -248,7 +248,7 @@ outsym(const sym_t *sym, scl_t sc, def_t
 	 */
 	outint(csrc_pos.p_line);
 	outchar('d');
-	outint(getfnid(sym->s_def_pos.p_file));
+	outint(get_filename_id(sym->s_def_pos.p_file));
 	outchar('.');
 	outint(sym->s_def_pos.p_line);
 
@@ -324,7 +324,7 @@ outfdef(const sym_t *fsym, const pos_t *
 		outint(csrc_pos.p_line);
 	}
 	outchar('d');
-	outint(getfnid(posp->p_file));
+	outint(get_filename_id(posp->p_file));
 	outchar('.');
 	outint(posp->p_line);
 
@@ -423,7 +423,7 @@ outcall(const tnode_t *tn, bool rvused, 
 	 */
 	outint(csrc_pos.p_line);
 	outchar('c');
-	outint(getfnid(curr_pos.p_file));
+	outint(get_filename_id(curr_pos.p_file));
 	outchar('.');
 	outint(curr_pos.p_line);
 
@@ -604,7 +604,7 @@ outusg(const sym_t *sym)
 	 */
 	outint(csrc_pos.p_line);
 	outchar('u');
-	outint(getfnid(curr_pos.p_file));
+	outint(get_filename_id(curr_pos.p_file));
 	outchar('.');
 	outint(curr_pos.p_line);
 

Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.89 src/usr.bin/xlint/lint1/externs1.h:1.90
--- src/usr.bin/xlint/lint1/externs1.h:1.89	Sat Mar 27 11:50:34 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Mar 27 12:32:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.89 2021/03/27 11:50:34 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.90 2021/03/27 12:32:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -93,10 +93,10 @@ extern	int	yylex(void);
 /*
  * mem1.c
  */
-extern	const	char *fnnalloc(const char *, size_t);
-extern	int	getfnid(const char *);
+extern	const	char *record_filename(const char *, size_t);
+extern	int	get_filename_id(const char *);
 extern	void	add_directory_replacement(char *);
-extern	const char *fnxform(const char *, size_t);
+extern	const char *transform_filename(const char *, size_t);
 
 extern	void	initmem(void);
 

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.18 src/usr.bin/xlint/lint1/lex.c:1.19
--- src/usr.bin/xlint/lint1/lex.c:1.18	Sat Mar 27 11:08:00 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sat Mar 27 12:32:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.18 2021/03/27 11:08:00 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.19 2021/03/27 12:32:19 rillig 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.18 2021/03/27 11:08:00 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.19 2021/03/27 12:32:19 rillig Exp $");
 #endif
 
 #include 
@@ -1127,7 +1127,7 @@ lex_directive(const char *yytext)
 			fn = "{standard input}";
 			fnl = 16;			/* strlen (fn) */
 		}
-		curr_pos.p_file = fnnalloc(fn, fnl);
+		curr_pos.p_file = record_filename(fn, fnl);
 		/*
 		 * If this is the first directive, the name is the name
 		 * of the C source file as specified at the command line.
@@ -1135,7 +1135,7 @@ lex_directive(const char *yytext)
 		 */
 		if (first) {
 			csrc_pos.p_file = curr_pos.p_file;
-			outsrc(fnxform(curr_pos.p_file,
+			outsrc(transform_filename(curr_pos.p_file,
 			strlen(curr_pos.p_file)));
 			first = false;
 		}

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.36 src/usr.bin/xlint/lint1/mem1.c:1.37
--- src/usr.bin/xlint/lint1/mem1.c:1.36	Sat Mar 27 12:24:43 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:32:19 2021
@@ -1,4 +1,4 @@

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:24:43 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: clean up code for filename management

In add_directory_replacement, the expression 'r->repl - r->orig' looked
strange, as if two pointers into separate objects were subtracted.

The code was probably optimized to a particular compiler on a particular
platform to generate fast and simple code.  Since compilers have made
considerable progress over the last 25 years, optimize the code for
human legibility instead.  The compilers will somehow cope with that.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.35 src/usr.bin/xlint/lint1/mem1.c:1.36
--- src/usr.bin/xlint/lint1/mem1.c:1.35	Sat Mar 27 12:17:22 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:24:43 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.35 2021/03/27 12:17:22 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.36 2021/03/27 12:24:43 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.35 2021/03/27 12:17:22 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.36 2021/03/27 12:24:43 rillig Exp $");
 #endif
 
 #include 
@@ -87,11 +87,14 @@ add_directory_replacement(char *arg)
 {
 	struct filename_replacement *r = xmalloc(sizeof *r);
 
-	r->orig = arg;
-	if ((r->repl = strchr(arg, '=')) == NULL)
+	char *sep = strchr(arg, '=');
+	if (sep == NULL)
 		err(1, "Bad replacement directory spec `%s'", arg);
-	r->orig_len = r->repl - r->orig;
-	*(r->repl)++ = '\0';
+	*sep = '\0';
+
+	r->orig = arg;
+	r->orig_len = sep - arg;
+	r->repl = sep + 1;
 	r->next = filename_replacements;
 	filename_replacements = r;
 }
@@ -117,7 +120,7 @@ fnxform(const char *name, size_t len)
  * If the filename is new, it is written to the output file.
  */
 const char *
-fnnalloc(const char *s, size_t len)
+fnnalloc(const char *s, size_t slen)
 {
 	const struct filename *existing_fn;
 	struct filename *fn;
@@ -127,15 +130,15 @@ fnnalloc(const char *s, size_t len)
 	if (s == NULL)
 		return NULL;
 
-	if ((existing_fn = search_filename(s, len)) != NULL)
+	if ((existing_fn = search_filename(s, slen)) != NULL)
 		return existing_fn->fn_name;
 
-	fn = xmalloc(sizeof *fn);
+	fn = xmalloc(sizeof(*fn));
 	/* Do not use strdup() because s is not NUL-terminated.*/
-	fn->fn_name = xmalloc(len + 1);
-	(void)memcpy(fn->fn_name, s, len);
-	fn->fn_name[len] = '\0';
-	fn->fn_len = len;
+	fn->fn_name = xmalloc(slen + 1);
+	(void)memcpy(fn->fn_name, s, slen);
+	fn->fn_name[slen] = '\0';
+	fn->fn_len = slen;
 	fn->fn_id = nxt_id++;
 	fn->fn_next = filenames;
 	filenames = fn;



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:17:22 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: rename filename_replacement.len to orig_len

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.34 src/usr.bin/xlint/lint1/mem1.c:1.35
--- src/usr.bin/xlint/lint1/mem1.c:1.34	Sat Mar 27 12:14:49 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:17:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.34 2021/03/27 12:14:49 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.35 2021/03/27 12:17:22 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.34 2021/03/27 12:14:49 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.35 2021/03/27 12:17:22 rillig Exp $");
 #endif
 
 #include 
@@ -75,8 +75,8 @@ search_filename(const char *s, size_t le
 
 struct filename_replacement {
 	char *orig;
+	size_t orig_len;
 	char *repl;
-	size_t len;
 	struct filename_replacement *next;
 };
 
@@ -90,7 +90,7 @@ add_directory_replacement(char *arg)
 	r->orig = arg;
 	if ((r->repl = strchr(arg, '=')) == NULL)
 		err(1, "Bad replacement directory spec `%s'", arg);
-	r->len = r->repl - r->orig;
+	r->orig_len = r->repl - r->orig;
 	*(r->repl)++ = '\0';
 	r->next = filename_replacements;
 	filename_replacements = r;
@@ -103,11 +103,12 @@ fnxform(const char *name, size_t len)
 	const struct filename_replacement *r;
 
 	for (r = filename_replacements; r != NULL; r = r->next)
-		if (r->len < len && memcmp(name, r->orig, r->len) == 0)
+		if (r->orig_len < len &&
+		memcmp(name, r->orig, r->orig_len) == 0)
 			break;
 	if (r == NULL)
 		return name;
-	snprintf(buf, sizeof buf, "%s%s", r->repl, name + r->len);
+	snprintf(buf, sizeof buf, "%s%s", r->repl, name + r->orig_len);
 	return buf;
 }
 



CVS commit: src/sys/arch

2021-03-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Mar 27 12:15:09 UTC 2021

Modified Files:
src/sys/arch/aarch64/include: cpu.h
src/sys/arch/arm/include: cpu.h
src/sys/arch/arm/pic: pic.c pic_splfuncs.c picvar.h

Log Message:
Revert recent pic optimizations until I have more time to work on this.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.116 -r1.117 src/sys/arch/arm/include/cpu.h
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/arm/pic/pic.c
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/pic/pic_splfuncs.c
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/arm/pic/picvar.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/arch/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.33 src/sys/arch/aarch64/include/cpu.h:1.34
--- src/sys/arch/aarch64/include/cpu.h:1.33	Sun Feb 21 17:07:06 2021
+++ src/sys/arch/aarch64/include/cpu.h	Sat Mar 27 12:15:09 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.33 2021/02/21 17:07:06 jmcneill Exp $ */
+/* $NetBSD: cpu.h,v 1.34 2021/03/27 12:15:09 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -104,9 +104,6 @@ struct cpu_info {
 	int ci_hwpl;		/* current hardware priority */
 	volatile u_int ci_softints;
 	volatile u_int ci_intr_depth;
-	volatile uint32_t ci_blocked_pics;
-	volatile uint32_t ci_pending_pics;
-	volatile uint32_t ci_pending_ipls;
 
 	int ci_kfpu_spl;
 

Index: src/sys/arch/arm/include/cpu.h
diff -u src/sys/arch/arm/include/cpu.h:1.116 src/sys/arch/arm/include/cpu.h:1.117
--- src/sys/arch/arm/include/cpu.h:1.116	Sun Feb 21 15:00:04 2021
+++ src/sys/arch/arm/include/cpu.h	Sat Mar 27 12:15:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.116 2021/02/21 15:00:04 jmcneill Exp $	*/
+/*	$NetBSD: cpu.h,v 1.117 2021/03/27 12:15:08 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -190,9 +190,6 @@ struct cpu_info {
 
 	volatile u_int	ci_intr_depth;	/* */
 	volatile u_int	ci_softints;
-	volatile uint32_t ci_blocked_pics;
-	volatile uint32_t ci_pending_pics;
-	volatile uint32_t ci_pending_ipls;
 
 	lwp_t *		ci_lastlwp;	/* last lwp */
 

Index: src/sys/arch/arm/pic/pic.c
diff -u src/sys/arch/arm/pic/pic.c:1.69 src/sys/arch/arm/pic/pic.c:1.70
--- src/sys/arch/arm/pic/pic.c:1.69	Sun Feb 21 17:07:45 2021
+++ src/sys/arch/arm/pic/pic.c	Sat Mar 27 12:15:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic.c,v 1.69 2021/02/21 17:07:45 jmcneill Exp $	*/
+/*	$NetBSD: pic.c,v 1.70 2021/03/27 12:15:09 jmcneill Exp $	*/
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.69 2021/02/21 17:07:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.70 2021/03/27 12:15:09 jmcneill Exp $");
 
 #include 
 #include 
@@ -59,20 +59,43 @@ __KERNEL_RCSID(0, "$NetBSD: pic.c,v 1.69
 #include 
 
 #if defined(__HAVE_PIC_PENDING_INTRS)
-
 /*
  * This implementation of pending interrupts on a MULTIPROCESSOR system makes
  * the assumption that a PIC (pic_softc) shall only have all its interrupts
  * come from the same CPU.  In other words, interrupts from a single PIC will
  * not be distributed among multiple CPUs.
  */
+struct pic_pending {
+	volatile uint32_t blocked_pics;
+	volatile uint32_t pending_pics;
+	volatile uint32_t pending_ipls;
+};
 static uint32_t
 	pic_find_pending_irqs_by_ipl(struct pic_softc *, size_t, uint32_t, int);
 static struct pic_softc *
-	pic_list_find_pic_by_pending_ipl(struct cpu_info *, uint32_t);
+	pic_list_find_pic_by_pending_ipl(struct pic_pending *, uint32_t);
+static void
+	pic_deliver_irqs(struct pic_pending *, struct pic_softc *, int, void *);
 static void
-	pic_deliver_irqs(struct cpu_info *, struct pic_softc *, int, void *);
+	pic_list_deliver_irqs(struct pic_pending *, register_t, int, void *);
 
+#ifdef MULTIPROCESSOR
+percpu_t *pic_pending_percpu;
+static struct pic_pending *
+pic_pending_get(void)
+{
+	return percpu_getref(pic_pending_percpu);
+}
+static void
+pic_pending_put(struct pic_pending *pend)
+{
+	percpu_putref(pic_pending_percpu);
+}
+#else
+struct pic_pending pic_pending;
+#define	pic_pending_get()	(_pending)
+#define	pic_pending_put(pend)	__nothing
+#endif /* MULTIPROCESSOR */
 #endif /* __HAVE_PIC_PENDING_INTRS */
 
 struct pic_softc *pic_list[PIC_MAXPICS];
@@ -95,6 +118,20 @@ EVCNT_ATTACH_STATIC(pic_deferral_ev);
 
 static int pic_init(void);
 
+#ifdef __HAVE_PIC_SET_PRIORITY
+void
+pic_set_priority(struct cpu_info *ci, int newipl)
+{
+	register_t psw = DISABLE_INTERRUPT_SAVE();
+	if (pic_list[0] != NULL)
+		(pic_list[0]->pic_ops->pic_set_priority)(pic_list[0], newipl);
+	ci->ci_cpl = newipl;
+	if ((psw & I32_bit) == 0) {
+		ENABLE_INTERRUPT();
+	}
+}
+#endif
+
 #ifdef MULTIPROCESSOR
 int
 pic_ipi_ast(void *arg)
@@ -138,9 +175,7 @@ pic_ipi_ddb(void *arg)
 int
 

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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:14:49 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: rename global variables in filename management

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.33 src/usr.bin/xlint/lint1/mem1.c:1.34
--- src/usr.bin/xlint/lint1/mem1.c:1.33	Sat Mar 27 12:10:41 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:14:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.33 2021/03/27 12:10:41 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.34 2021/03/27 12:14:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.33 2021/03/27 12:10:41 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.34 2021/03/27 12:14:49 rillig Exp $");
 #endif
 
 #include 
@@ -58,15 +58,15 @@ struct filename {
 	struct	filename *fn_next;
 };
 
-static struct filename *fnames;
+static struct filename *filenames;	/* null-terminated array */
 
 /* Find the given filename, or return NULL. */
 static const struct filename *
 search_filename(const char *s, size_t len)
 {
-	struct filename *fn;
+	const struct filename *fn;
 
-	for (fn = fnames; fn != NULL; fn = fn->fn_next) {
+	for (fn = filenames; fn != NULL; fn = fn->fn_next) {
 		if (fn->fn_len == len && memcmp(fn->fn_name, s, len) == 0)
 			break;
 	}
@@ -80,7 +80,7 @@ struct filename_replacement {
 	struct filename_replacement *next;
 };
 
-static struct filename_replacement *replist;
+static struct filename_replacement *filename_replacements;
 
 void
 add_directory_replacement(char *arg)
@@ -92,20 +92,17 @@ add_directory_replacement(char *arg)
 		err(1, "Bad replacement directory spec `%s'", arg);
 	r->len = r->repl - r->orig;
 	*(r->repl)++ = '\0';
-	if (replist == NULL) {
-		r->next = NULL;
-	} else
-		r->next = replist;
-	replist = r;
+	r->next = filename_replacements;
+	filename_replacements = r;
 }
 
 const char *
 fnxform(const char *name, size_t len)
 {
 	static char buf[MAXPATHLEN];
-	struct filename_replacement *r;
+	const struct filename_replacement *r;
 
-	for (r = replist; r != NULL; r = r->next)
+	for (r = filename_replacements; r != NULL; r = r->next)
 		if (r->len < len && memcmp(name, r->orig, r->len) == 0)
 			break;
 	if (r == NULL)
@@ -139,8 +136,8 @@ fnnalloc(const char *s, size_t len)
 	fn->fn_name[len] = '\0';
 	fn->fn_len = len;
 	fn->fn_id = nxt_id++;
-	fn->fn_next = fnames;
-	fnames = fn;
+	fn->fn_next = filenames;
+	filenames = fn;
 
 	/* Write id of this filename to the output file. */
 	outclr();



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:10:41 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: rename srchfn to search_filename, return const value

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.32 src/usr.bin/xlint/lint1/mem1.c:1.33
--- src/usr.bin/xlint/lint1/mem1.c:1.32	Sat Mar 27 12:01:49 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:10:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.33 2021/03/27 12:10:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.33 2021/03/27 12:10:41 rillig Exp $");
 #endif
 
 #include 
@@ -61,8 +61,8 @@ struct filename {
 static struct filename *fnames;
 
 /* Find the given filename, or return NULL. */
-static struct filename *
-srchfn(const char *s, size_t len)
+static const struct filename *
+search_filename(const char *s, size_t len)
 {
 	struct filename *fn;
 
@@ -121,6 +121,7 @@ fnxform(const char *name, size_t len)
 const char *
 fnnalloc(const char *s, size_t len)
 {
+	const struct filename *existing_fn;
 	struct filename *fn;
 
 	static	int	nxt_id = 0;
@@ -128,8 +129,8 @@ fnnalloc(const char *s, size_t len)
 	if (s == NULL)
 		return NULL;
 
-	if ((fn = srchfn(s, len)) != NULL)
-		return fn->fn_name;
+	if ((existing_fn = search_filename(s, len)) != NULL)
+		return existing_fn->fn_name;
 
 	fn = xmalloc(sizeof *fn);
 	/* Do not use strdup() because s is not NUL-terminated.*/
@@ -154,9 +155,9 @@ fnnalloc(const char *s, size_t len)
 int
 getfnid(const char *s)
 {
-	struct filename *fn;
+	const struct filename *fn;
 
-	if (s == NULL || (fn = srchfn(s, strlen(s))) == NULL)
+	if (s == NULL || (fn = search_filename(s, strlen(s))) == NULL)
 		return -1;
 	return fn->fn_id;
 }



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 12:01:49 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: rename types in filename management

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.31 src/usr.bin/xlint/lint1/mem1.c:1.32
--- src/usr.bin/xlint/lint1/mem1.c:1.31	Sat Mar 27 11:54:35 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 12:01:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.32 2021/03/27 12:01:49 rillig Exp $");
 #endif
 
 #include 
@@ -51,22 +51,20 @@ __RCSID("$NetBSD: mem1.c,v 1.31 2021/03/
 /*
  * Filenames allocated by fnalloc() and fnnalloc() are shared.
  */
-typedef struct fn {
+struct filename {
 	char	*fn_name;
 	size_t	fn_len;
 	int	fn_id;
-	struct	fn *fn_next;
-} fn_t;
-
-static	fn_t	*fnames;
+	struct	filename *fn_next;
+};
 
-static	fn_t	*srchfn(const char *, size_t);
+static struct filename *fnames;
 
 /* Find the given filename, or return NULL. */
-static fn_t *
+static struct filename *
 srchfn(const char *s, size_t len)
 {
-	fn_t	*fn;
+	struct filename *fn;
 
 	for (fn = fnames; fn != NULL; fn = fn->fn_next) {
 		if (fn->fn_len == len && memcmp(fn->fn_name, s, len) == 0)
@@ -75,19 +73,19 @@ srchfn(const char *s, size_t len)
 	return fn;
 }
 
-struct repl {
+struct filename_replacement {
 	char *orig;
 	char *repl;
 	size_t len;
-	struct repl *next;
+	struct filename_replacement *next;
 };
 
-struct repl *replist;
+static struct filename_replacement *replist;
 
 void
 add_directory_replacement(char *arg)
 {
-	struct repl *r = xmalloc(sizeof *r);
+	struct filename_replacement *r = xmalloc(sizeof *r);
 
 	r->orig = arg;
 	if ((r->repl = strchr(arg, '=')) == NULL)
@@ -105,7 +103,7 @@ const char *
 fnxform(const char *name, size_t len)
 {
 	static char buf[MAXPATHLEN];
-	struct repl *r;
+	struct filename_replacement *r;
 
 	for (r = replist; r != NULL; r = r->next)
 		if (r->len < len && memcmp(name, r->orig, r->len) == 0)
@@ -123,7 +121,7 @@ fnxform(const char *name, size_t len)
 const char *
 fnnalloc(const char *s, size_t len)
 {
-	fn_t	*fn;
+	struct filename *fn;
 
 	static	int	nxt_id = 0;
 
@@ -156,7 +154,7 @@ fnnalloc(const char *s, size_t len)
 int
 getfnid(const char *s)
 {
-	fn_t	*fn;
+	struct filename *fn;
 
 	if (s == NULL || (fn = srchfn(s, strlen(s))) == NULL)
 		return -1;



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 11:54:35 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: mem1.c

Log Message:
lint: reduce indentation in fnnalloc

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/xlint/lint1/mem1.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/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.30 src/usr.bin/xlint/lint1/mem1.c:1.31
--- src/usr.bin/xlint/lint1/mem1.c:1.30	Sat Mar 27 11:50:34 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 11:54:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.30 2021/03/27 11:50:34 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.30 2021/03/27 11:50:34 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.31 2021/03/27 11:54:35 rillig Exp $");
 #endif
 
 #include 
@@ -130,22 +130,25 @@ fnnalloc(const char *s, size_t len)
 	if (s == NULL)
 		return NULL;
 
-	if ((fn = srchfn(s, len)) == NULL) {
-		fn = xmalloc(sizeof *fn);
-		/* Do not use strdup() because s is not NUL-terminated.*/
-		fn->fn_name = xmalloc(len + 1);
-		(void)memcpy(fn->fn_name, s, len);
-		fn->fn_name[len] = '\0';
-		fn->fn_len = len;
-		fn->fn_id = nxt_id++;
-		fn->fn_next = fnames;
-		fnames = fn;
-		/* Write id of this filename to the output file. */
-		outclr();
-		outint(fn->fn_id);
-		outchar('s');
-		outstrg(fnxform(fn->fn_name, fn->fn_len));
-	}
+	if ((fn = srchfn(s, len)) != NULL)
+		return fn->fn_name;
+
+	fn = xmalloc(sizeof *fn);
+	/* Do not use strdup() because s is not NUL-terminated.*/
+	fn->fn_name = xmalloc(len + 1);
+	(void)memcpy(fn->fn_name, s, len);
+	fn->fn_name[len] = '\0';
+	fn->fn_len = len;
+	fn->fn_id = nxt_id++;
+	fn->fn_next = fnames;
+	fnames = fn;
+
+	/* Write id of this filename to the output file. */
+	outclr();
+	outint(fn->fn_id);
+	outchar('s');
+	outstrg(fnxform(fn->fn_name, fn->fn_len));
+
 	return fn->fn_name;
 }
 



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 11:50:34 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: externs1.h main1.c mem1.c

Log Message:
lint: rename fnaddreplsrcdir to something less cryptic

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.39 -r1.40 src/usr.bin/xlint/lint1/main1.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/lint1/mem1.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/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.88 src/usr.bin/xlint/lint1/externs1.h:1.89
--- src/usr.bin/xlint/lint1/externs1.h:1.88	Sat Mar 27 11:47:59 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Mar 27 11:50:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.88 2021/03/27 11:47:59 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.89 2021/03/27 11:50:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -95,7 +95,7 @@ extern	int	yylex(void);
  */
 extern	const	char *fnnalloc(const char *, size_t);
 extern	int	getfnid(const char *);
-extern	void	fnaddreplsrcdir(char *);
+extern	void	add_directory_replacement(char *);
 extern	const char *fnxform(const char *, size_t);
 
 extern	void	initmem(void);

Index: src/usr.bin/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.39 src/usr.bin/xlint/lint1/main1.c:1.40
--- src/usr.bin/xlint/lint1/main1.c:1.39	Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/lint1/main1.c	Sat Mar 27 11:50:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.39 2021/03/26 20:31:07 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.40 2021/03/27 11:50:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.39 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.40 2021/03/27 11:50:34 rillig Exp $");
 #endif
 
 #include 
@@ -206,7 +206,7 @@ main(int argc, char *argv[])
 			return 0;
 
 		case 'R':
-			fnaddreplsrcdir(optarg);
+			add_directory_replacement(optarg);
 			break;
 
 		case 'X':

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.29 src/usr.bin/xlint/lint1/mem1.c:1.30
--- src/usr.bin/xlint/lint1/mem1.c:1.29	Sat Mar 27 11:47:59 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 11:50:34 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.29 2021/03/27 11:47:59 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.30 2021/03/27 11:50:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.29 2021/03/27 11:47:59 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.30 2021/03/27 11:50:34 rillig Exp $");
 #endif
 
 #include 
@@ -85,7 +85,7 @@ struct repl {
 struct repl *replist;
 
 void
-fnaddreplsrcdir(char *arg)
+add_directory_replacement(char *arg)
 {
 	struct repl *r = xmalloc(sizeof *r);
 



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

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 11:47:59 UTC 2021

Modified Files:
src/usr.bin/xlint/lint1: externs1.h mem1.c

Log Message:
lint: remove unused fnalloc


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/xlint/lint1/mem1.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/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.87 src/usr.bin/xlint/lint1/externs1.h:1.88
--- src/usr.bin/xlint/lint1/externs1.h:1.87	Fri Mar 26 18:54:39 2021
+++ src/usr.bin/xlint/lint1/externs1.h	Sat Mar 27 11:47:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs1.h,v 1.87 2021/03/26 18:54:39 rillig Exp $	*/
+/*	$NetBSD: externs1.h,v 1.88 2021/03/27 11:47:59 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -93,7 +93,6 @@ extern	int	yylex(void);
 /*
  * mem1.c
  */
-extern	const	char *fnalloc(const char *);
 extern	const	char *fnnalloc(const char *, size_t);
 extern	int	getfnid(const char *);
 extern	void	fnaddreplsrcdir(char *);

Index: src/usr.bin/xlint/lint1/mem1.c
diff -u src/usr.bin/xlint/lint1/mem1.c:1.28 src/usr.bin/xlint/lint1/mem1.c:1.29
--- src/usr.bin/xlint/lint1/mem1.c:1.28	Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/lint1/mem1.c	Sat Mar 27 11:47:59 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: mem1.c,v 1.28 2021/03/26 20:31:07 rillig Exp $	*/
+/*	$NetBSD: mem1.c,v 1.29 2021/03/27 11:47:59 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: mem1.c,v 1.28 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: mem1.c,v 1.29 2021/03/27 11:47:59 rillig Exp $");
 #endif
 
 #include 
@@ -75,14 +75,6 @@ srchfn(const char *s, size_t len)
 	return fn;
 }
 
-/* Return a copy of the filename s with unlimited lifetime. */
-const char *
-fnalloc(const char *s)
-{
-
-	return s != NULL ? fnnalloc(s, strlen(s)) : NULL;
-}
-
 struct repl {
 	char *orig;
 	char *repl;
@@ -124,6 +116,10 @@ fnxform(const char *name, size_t len)
 	return buf;
 }
 
+/*
+ * Return a copy of the filename s with unlimited lifetime.
+ * If the filename is new, it is written to the output file.
+ */
 const char *
 fnnalloc(const char *s, size_t len)
 {



CVS commit: src/usr.bin/xlint

2021-03-27 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat Mar 27 11:08:00 UTC 2021

Modified Files:
src/usr.bin/xlint/common: emit.c inittyp.c
src/usr.bin/xlint/lint1: decl.c lex.c tree.c
src/usr.bin/xlint/lint2: msg.c

Log Message:
lint: remove space between 'sizeof ('

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/xlint/common/emit.c
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.162 -r1.163 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.251 -r1.252 src/usr.bin/xlint/lint1/tree.c
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/xlint/lint2/msg.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/common/emit.c
diff -u src/usr.bin/xlint/common/emit.c:1.10 src/usr.bin/xlint/common/emit.c:1.11
--- src/usr.bin/xlint/common/emit.c:1.10	Sat Jan 16 02:40:02 2021
+++ src/usr.bin/xlint/common/emit.c	Sat Mar 27 11:08:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: emit.c,v 1.10 2021/01/16 02:40:02 rillig Exp $	*/
+/*	$NetBSD: emit.c,v 1.11 2021/03/27 11:08:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit.c,v 1.10 2021/01/16 02:40:02 rillig Exp $");
+__RCSID("$NetBSD: emit.c,v 1.11 2021/03/27 11:08:00 rillig Exp $");
 #endif
 
 #include 
@@ -206,7 +206,7 @@ void
 outint(int i)
 {
 
-	if ((size_t)(ob.o_end - ob.o_next) < 3 * sizeof (int))
+	if ((size_t)(ob.o_end - ob.o_next) < 3 * sizeof(int))
 		outxbuf();
 	ob.o_next += sprintf(ob.o_next, "%d", i);
 }

Index: src/usr.bin/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.21 src/usr.bin/xlint/common/inittyp.c:1.22
--- src/usr.bin/xlint/common/inittyp.c:1.21	Sat Mar 20 18:59:00 2021
+++ src/usr.bin/xlint/common/inittyp.c	Sat Mar 27 11:08:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.21 2021/03/20 18:59:00 rillig Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.22 2021/03/27 11:08:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: inittyp.c,v 1.21 2021/03/20 18:59:00 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.22 2021/03/27 11:08:00 rillig Exp $");
 #endif
 
 #include 
@@ -139,7 +139,7 @@ inittyp(void)
 #undef typeinfo
 	};
 
-	for (i = 0; i < sizeof (ittab) / sizeof (ittab[0]); i++)
+	for (i = 0; i < sizeof(ittab) / sizeof(ittab[0]); i++)
 		ttab[ittab[i].it_tspec] = ittab[i].it_ttab;
 	if (!pflag) {
 		for (i = 0; i < NTSPEC; i++)

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.162 src/usr.bin/xlint/lint1/decl.c:1.163
--- src/usr.bin/xlint/lint1/decl.c:1.162	Fri Mar 26 20:51:34 2021
+++ src/usr.bin/xlint/lint1/decl.c	Sat Mar 27 11:08:00 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.162 2021/03/26 20:51:34 christos Exp $ */
+/* $NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.162 2021/03/26 20:51:34 christos Exp $");
+__RCSID("$NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $");
 #endif
 
 #include 
@@ -148,7 +148,7 @@ duptyp(const type_t *tp)
 {
 	type_t	*ntp;
 
-	ntp = getblk(sizeof (type_t));
+	ntp = getblk(sizeof(*ntp));
 	*ntp = *tp;
 	return ntp;
 }

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.17 src/usr.bin/xlint/lint1/lex.c:1.18
--- src/usr.bin/xlint/lint1/lex.c:1.17	Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/lint1/lex.c	Sat Mar 27 11:08:00 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.17 2021/03/26 20:31:07 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.18 2021/03/27 11:08:00 rillig 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.17 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.18 2021/03/27 11:08:00 rillig Exp $");
 #endif
 
 #include 
@@ -841,7 +841,7 @@ lex_character_constant(void)
 		error(253);
 	} else {
 		/* XXX: should rather be sizeof(TARG_INT) */
-		if (n > sizeof (int) || (n > 1 && (pflag || hflag))) {
+		if (n > sizeof(int) || (n > 1 && (pflag || hflag))) {
 			/* too many characters in character constant */
 			error(71);
 		} else if (n > 1) {

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.251 src/usr.bin/xlint/lint1/tree.c:1.252
--- src/usr.bin/xlint/lint1/tree.c:1.251	Fri Mar 26 23:17:33 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Mar 27 11:08:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.251 2021/03/26 23:17:33 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.252 2021/03/27 11:08:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 

CVS commit: src/share/man/man4

2021-03-27 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sat Mar 27 08:01:21 UTC 2021

Modified Files:
src/share/man/man4: usb.4

Log Message:
Add uxrcom(4)


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/share/man/man4/usb.4

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

Modified files:

Index: src/share/man/man4/usb.4
diff -u src/share/man/man4/usb.4:1.116 src/share/man/man4/usb.4:1.117
--- src/share/man/man4/usb.4:1.116	Fri Feb 26 09:59:19 2021
+++ src/share/man/man4/usb.4	Sat Mar 27 08:01:21 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: usb.4,v 1.116 2021/02/26 09:59:19 nia Exp $
+.\" $NetBSD: usb.4,v 1.117 2021/03/27 08:01:21 nia Exp $
 .\"
 .\" Copyright (c) 1999-2014 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 February 26, 2021
+.Dd March 27, 2021
 .Dt USB 4
 .Os
 .Sh NAME
@@ -169,6 +169,8 @@ Silicon Laboratories CP2101/CP2102 based
 USB Handspring Visor
 .It Xr uvscom 4
 SUNTAC Slipper U VS-10U USB serial adapter
+.It Xr uxrcom 4
+Exar XR21V141x USB serial adapter
 .El
 .Ss Audio devices
 .Bl -tag -width 12n -offset ind -compact