CVS commit: src/etc/etc.vax

2024-02-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb  1 22:26:19 UTC 2024

Modified Files:
src/etc/etc.vax: ttys

Log Message:
Use "wsvt25" rather than "sun" for (commented out) wscons tty lines.

Note historically vax port seems to use "ttyw?" rather than common "ttyE?"
for wscons (wsdisplay) tty devices in ttys(5).

No particular comment on port-vax@:
 https://mail-index.netbsd.org/port-vax/2024/01/thread1.html#004828


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/etc/etc.vax/ttys

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

Modified files:

Index: src/etc/etc.vax/ttys
diff -u src/etc/etc.vax/ttys:1.10 src/etc/etc.vax/ttys:1.11
--- src/etc/etc.vax/ttys:1.10	Wed Sep 25 23:09:24 2019
+++ src/etc/etc.vax/ttys	Thu Feb  1 22:26:19 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: ttys,v 1.10 2019/09/25 23:09:24 abs Exp $
+#	$NetBSD: ttys,v 1.11 2024/02/01 22:26:19 tsutsui Exp $
 #
 #	@(#)ttys	5.2 (Berkeley) 6/10/93
 #
@@ -10,14 +10,14 @@ console	"/usr/libexec/getty std.9600"	un
 constty	"/usr/libexec/getty std.9600"	unknown	on secure
 
 # Virtual terminals on VS3100 with "glass tty"
-#ttyw0	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw1	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw2	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw3	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw4	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw5	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw6	"/usr/libexec/getty std.9600"	sun on secure
-#ttyw7	"/usr/libexec/getty std.9600"	sun on secure
+#ttyw0	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw1	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw2	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw3	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw4	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw5	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw6	"/usr/libexec/getty std.9600"	wsvt25 on secure
+#ttyw7	"/usr/libexec/getty std.9600"	wsvt25 on secure
 
 # DZ-11 lines, not frobbed by getty (keyboard/mouse may be sad)
 #tty00	"/usr/libexec/getty std.9600"	unknown	off secure



CVS commit: src/etc/etc.vax

2024-02-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb  1 22:26:19 UTC 2024

Modified Files:
src/etc/etc.vax: ttys

Log Message:
Use "wsvt25" rather than "sun" for (commented out) wscons tty lines.

Note historically vax port seems to use "ttyw?" rather than common "ttyE?"
for wscons (wsdisplay) tty devices in ttys(5).

No particular comment on port-vax@:
 https://mail-index.netbsd.org/port-vax/2024/01/thread1.html#004828


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/etc/etc.vax/ttys

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



CVS commit: src/etc/etc.vax

2024-02-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb  1 22:22:05 UTC 2024

Modified Files:
src/etc/etc.vax: MAKEDEV.conf

Log Message:
Make sure to create wscons devices on the default "MAKEDEV all" target.

Necessary to make the X.org server work on the default installation.
Proposed on port-vax@, and ok'ed by mrg@:
 https://mail-index.netbsd.org/port-vax/2024/01/thread1.html#004828

Worth to pull up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/etc/etc.vax/MAKEDEV.conf

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



CVS commit: src/etc/etc.vax

2024-02-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb  1 22:22:05 UTC 2024

Modified Files:
src/etc/etc.vax: MAKEDEV.conf

Log Message:
Make sure to create wscons devices on the default "MAKEDEV all" target.

Necessary to make the X.org server work on the default installation.
Proposed on port-vax@, and ok'ed by mrg@:
 https://mail-index.netbsd.org/port-vax/2024/01/thread1.html#004828

Worth to pull up to netbsd-10.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/etc/etc.vax/MAKEDEV.conf

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

Modified files:

Index: src/etc/etc.vax/MAKEDEV.conf
diff -u src/etc/etc.vax/MAKEDEV.conf:1.19 src/etc/etc.vax/MAKEDEV.conf:1.20
--- src/etc/etc.vax/MAKEDEV.conf:1.19	Thu Jun 22 17:51:22 2017
+++ src/etc/etc.vax/MAKEDEV.conf	Thu Feb  1 22:22:05 2024
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.19 2017/06/22 17:51:22 flxd Exp $
+# $NetBSD: MAKEDEV.conf,v 1.20 2024/02/01 22:22:05 tsutsui Exp $
 
 all_md)
 	makedev mt0 mt1 ts0 ts1 st0 st1 uk0 ss0 cd0 vt0
@@ -9,6 +9,7 @@ all_md)
 	makedev audio speaker
 	makedev usbs
 	makedev std_vax
+	makedev wscons
 	;;
 
 ramdisk)



CVS commit: src/lib/libutil

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 22:18:34 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: fix examples, clean up wording

In the examples using hex escape sequences, there must be a delimiter
between the escape sequence and the following description if the
description starts with [A-Fa-f], as hex escape sequences are not
limited in length.

Distinguish between a 'directive' (bit + length + description) and a
'description' (only the text).

The fmt parameter is not a string, as strings only reach to the first
'\0' byte, but the new-style format may include additional '\0' as bit
numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libutil/snprintb.3

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

Modified files:

Index: src/lib/libutil/snprintb.3
diff -u src/lib/libutil/snprintb.3:1.29 src/lib/libutil/snprintb.3:1.30
--- src/lib/libutil/snprintb.3:1.29	Mon Jan 22 00:11:21 2024
+++ src/lib/libutil/snprintb.3	Thu Feb  1 22:18:34 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: snprintb.3,v 1.29 2024/01/22 00:11:21 uwe Exp $
+.\" $NetBSD: snprintb.3,v 1.30 2024/02/01 22:18:34 rillig Exp $
 .\"
 .\" Copyright (c) 1998 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 January 21, 2024
+.Dd February 1, 2024
 .Dt SNPRINTB 3
 .Os
 .Sh NAME
@@ -56,7 +56,7 @@ into the buffer
 of size
 .Fa buflen ,
 using a specified radix and an interpretation of
-the bits within that integer as though they were flags.
+the bits within that integer as though they were flags or groups of bits.
 The buffer is always
 .Tn NUL Ns -terminated.
 If the buffer
@@ -98,7 +98,7 @@ additional
 character
 .Pq or, if you prefer, a zero-length string .
 .Pp
-The decoding directive string
+The decoding directive in
 .Fa fmt
 describes how the bitfield is to be interpreted and displayed.
 It follows two possible syntaxes, referred to as
@@ -113,7 +113,9 @@ The first character of
 .Fa fmt
 may be
 .Ql \e177 ,
-indicating that the remainder of the format string follows the
+indicating that the remainder of the
+.Fa fmt
+argument follows the
 .Dq new
 syntax.
 The second character
@@ -131,18 +133,17 @@ and
 .Ql \e20
 .Pq hexadecimal .
 .Pp
-The remaining characters in
+The remaining characters in the
 .Fa fmt
-are interpreted as a list of bit-position\(endescription pairs.
-From here the syntaxes diverge.
+argument are interpreted as a list of formatting directives.
 .
 .Ss Old Syntax
 .Pp
 The
 .Dq old
-format syntax is series of bit-position\(endescription pairs.
+format syntax is a series of bit-position\(endescription pairs.
 .Pp
-Each description begins with a binary character value that represents
+Each directive begins with a binary character value that represents
 the position of the bit being described.
 .Pp
 .Sy NB :
@@ -164,17 +165,19 @@ The old syntax is limited to 32-bit valu
 The remaining characters are the description to print should the bit
 being described be set.
 .Pp
-Description strings are delimited by the next bit position value character
+Descriptions are delimited by the next bit position value character
 encountered
 .Pq distinguishable by its value being \*[Le] 32 ,
-or the end of the decoding directive string itself.
+or by the end of the format string itself.
 .
 .Ss New Syntax
 .Pp
 For the
 .Dq new
-format syntax, a field description begins with a field type followed
-by a binary field position and possibly a field length.
+format syntax,
+a formatting directive begins with a field type
+followed by a binary field position and possibly a field length,
+followed by a description.
 The bit positions are 0-based,
 the least significant bit is bit-position zero.
 Each description is terminated by a
@@ -188,7 +191,7 @@ Describes a single bit at bit-position
 .Ar B .
 The remaining characters are the description to print should the bit
 being described be set.
-This field description is similar in function to the old format.
+This field directive is similar in function to the old format.
 When converting old formats to the new syntax don't forget that the
 new syntax uses zero-based bit positions.
 .
@@ -202,8 +205,9 @@ followed by
 .Ql \&=
 and the value of the field.
 The value of the field is printed in the base specified as the second
-character of the decoding directive string
-.Ar fmt .
+character of the
+.Ar fmt
+argument.
 .
 .It Cm F\e Ns Ar B Ns Cm \e Ns Ar L
 Describes a multi-bit field like
@@ -224,7 +228,7 @@ directive is compared to the byte value
 .Pq for values 0 through 255 .
 If they are equal,
 .Ql \&=
-followed by the string following
+followed by the description string following
 .Ar V
 is printed.
 This and the
@@ -240,7 +244,7 @@ directive, but omits the leading
 .It Cm * Ns Ar FMT
 This provides a
 

CVS commit: src/lib/libutil

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 22:18:34 UTC 2024

Modified Files:
src/lib/libutil: snprintb.3

Log Message:
snprintb.3: fix examples, clean up wording

In the examples using hex escape sequences, there must be a delimiter
between the escape sequence and the following description if the
description starts with [A-Fa-f], as hex escape sequences are not
limited in length.

Distinguish between a 'directive' (bit + length + description) and a
'description' (only the text).

The fmt parameter is not a string, as strings only reach to the first
'\0' byte, but the new-style format may include additional '\0' as bit
numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libutil/snprintb.3

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



CVS commit: src/sys/arch/powerpc/ibm4xx

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:02:18 UTC 2024

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
s/againt/against/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/powerpc/ibm4xx/pmap.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/powerpc/ibm4xx/pmap.c
diff -u src/sys/arch/powerpc/ibm4xx/pmap.c:1.109 src/sys/arch/powerpc/ibm4xx/pmap.c:1.110
--- src/sys/arch/powerpc/ibm4xx/pmap.c:1.109	Wed Oct  5 09:03:06 2022
+++ src/sys/arch/powerpc/ibm4xx/pmap.c	Thu Feb  1 22:02:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.109 2022/10/05 09:03:06 rin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.110 2024/02/01 22:02:18 andvar Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2022/10/05 09:03:06 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2024/02/01 22:02:18 andvar Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1207,7 +1207,7 @@ pmap_procwr(struct proc *p, vaddr_t va, 
 
 		/*
 		 * For p != curproc, we cannot rely upon TLB miss handler in
-		 * user context. Therefore, extract pa and operate againt it.
+		 * user context. Therefore, extract pa and operate against it.
 		 *
 		 * Note that va below VM_MIN_KERNEL_ADDRESS is reserved for
 		 * direct mapping.



CVS commit: src/sys/arch/powerpc/ibm4xx

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:02:18 UTC 2024

Modified Files:
src/sys/arch/powerpc/ibm4xx: pmap.c

Log Message:
s/againt/against/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/powerpc/ibm4xx/pmap.c

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



CVS commit: src/sys/arch/m68k/include

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:00:29 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
s/Prototol/Protocol/ and s/Umimplemented/Unimplemented/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/vectors.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/m68k/include/vectors.h
diff -u src/sys/arch/m68k/include/vectors.h:1.5 src/sys/arch/m68k/include/vectors.h:1.6
--- src/sys/arch/m68k/include/vectors.h:1.5	Fri Jan 19 05:45:28 2024
+++ src/sys/arch/m68k/include/vectors.h	Thu Feb  1 22:00:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: vectors.h,v 1.5 2024/01/19 05:45:28 thorpej Exp $	*/
+/*	$NetBSD: vectors.h,v 1.6 2024/02/01 22:00:29 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
 #define	VECI_LINE1010		10	/* Line 1010 Emulator */
 #define	VECI_LINE		11	/* Line  Emulator */
 #define	VECI_rsvd12		12	/* unassigned, reserved */
-#define	VECI_CPV		13	/* Coprocessor Prototol Violation */
+#define	VECI_CPV		13	/* Coprocessor Protocol Violation */
 #define	VECI_FORMATERR		14	/* Format Error */
 #define	VECI_UNINT_INTR		15	/* Uninitialized Interrupt */
 #define	VECI_rsvd16		16	/* unassigned, reserved */
@@ -109,7 +109,7 @@
 #define	VECI_PMMU_ACCESS	58	/* PMMU Access Level Violation */
 #define	VECI_rsvd59		59	/* unassigned, reserved */
 #define	VECI_UNIMP_EA		60	/* Unimplemented Effective Address */
-#define	VECI_UNIMP_II		61	/* Umimplemented Integer Instruction */
+#define	VECI_UNIMP_II		61	/* Unimplemented Integer Instruction */
 #define	VECI_rsvd62		62	/* unassigned, reserved */
 #define	VECI_rsvd63		63	/* unassigned, reserved */
 #define	VECI_USRVEC_START	64	/* User defined vectors (192) */



CVS commit: src/sys/arch/m68k/include

2024-02-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Feb  1 22:00:29 UTC 2024

Modified Files:
src/sys/arch/m68k/include: vectors.h

Log Message:
s/Prototol/Protocol/ and s/Umimplemented/Unimplemented/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/m68k/include/vectors.h

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



CVS commit: src/usr.bin/xlint

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 21:19:13 UTC 2024

Modified Files:
src/usr.bin/xlint/common: externs.h tyname.c
src/usr.bin/xlint/lint1: lex.c tree.c

Log Message:
lint: reuse buffer editing code across lint1

Fix cat_strings to update the capacity of the buffer, to prevent
quadratic runtime when concatenating string literals.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.205 -r1.206 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.600 -r1.601 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/common/externs.h
diff -u src/usr.bin/xlint/common/externs.h:1.34 src/usr.bin/xlint/common/externs.h:1.35
--- src/usr.bin/xlint/common/externs.h:1.34	Sat Jan 20 12:02:09 2024
+++ src/usr.bin/xlint/common/externs.h	Thu Feb  1 21:19:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.34 2024/01/20 12:02:09 rillig Exp $	*/
+/*	$NetBSD: externs.h,v 1.35 2024/02/01 21:19:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,6 +37,8 @@
 #if IS_LINT1 || IS_LINT2
 const char *type_name(const type_t *);
 const char *tspec_name(tspec_t);
+void buf_init(buffer *);
+void buf_add_char(buffer *, char);
 #endif
 
 /*

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.59 src/usr.bin/xlint/common/tyname.c:1.60
--- src/usr.bin/xlint/common/tyname.c:1.59	Thu Feb  1 18:37:06 2024
+++ src/usr.bin/xlint/common/tyname.c	Thu Feb  1 21:19:13 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.59 2024/02/01 18:37:06 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.60 2024/02/01 21:19:13 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tyname.c,v 1.59 2024/02/01 18:37:06 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.60 2024/02/01 21:19:13 rillig Exp $");
 #endif
 
 #include 
@@ -94,7 +94,7 @@ intern(const char *name)
 	return n->ntn_name;
 }
 
-static void
+void
 buf_init(buffer *buf)
 {
 	buf->len = 0;
@@ -110,17 +110,28 @@ buf_done(buffer *buf)
 }
 
 static void
-buf_add(buffer *buf, const char *s)
+buf_add_mem(buffer *buf, const char *s, size_t n)
 {
-	size_t len = strlen(s);
-
-	while (buf->len + len + 1 >= buf->cap) {
-		buf->data = xrealloc(buf->data, 2 * buf->cap);
-		buf->cap = 2 * buf->cap;
+	while (buf->len + n + 1 >= buf->cap) {
+		buf->cap *= 2;
+		buf->data = xrealloc(buf->data, buf->cap);
 	}
 
-	memcpy(buf->data + buf->len, s, len + 1);
-	buf->len += len;
+	memcpy(buf->data + buf->len, s, n);
+	buf->len += n;
+	buf->data[buf->len] = '\0';
+}
+
+void
+buf_add_char(buffer *buf, char c)
+{
+	buf_add_mem(buf, , 1);
+}
+
+static void
+buf_add(buffer *buf, const char *s)
+{
+	buf_add_mem(buf, s, strlen(s));
 }
 
 static void

Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.205 src/usr.bin/xlint/lint1/lex.c:1.206
--- src/usr.bin/xlint/lint1/lex.c:1.205	Thu Feb  1 18:37:06 2024
+++ src/usr.bin/xlint/lint1/lex.c	Thu Feb  1 21:19:13 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.205 2024/02/01 18:37:06 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.206 2024/02/01 21:19:13 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: lex.c,v 1.205 2024/02/01 18:37:06 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.206 2024/02/01 21:19:13 rillig Exp $");
 #endif
 
 #include 
@@ -1259,27 +1259,18 @@ clear_warn_flags(void)
 int
 lex_string(void)
 {
-	size_t s_len = 0;
-	size_t s_cap = 64;
-	char *s = xmalloc(s_cap);
+	buffer *buf = xcalloc(1, sizeof(*buf));
+	buf_init(buf);
 
 	int c;
-	while ((c = get_escaped_char('"')) >= 0) {
-		/* +1 to reserve space for a trailing NUL character */
-		if (s_len + 1 == s_cap)
-			s = xrealloc(s, s_cap *= 2);
-		s[s_len++] = (char)c;
-	}
-	s[s_len] = '\0';
+	while ((c = get_escaped_char('"')) >= 0)
+		buf_add_char(buf, (char)c);
 	if (c == -2)
 		/* unterminated string constant */
 		error(258);
 
-	buffer *str = xcalloc(1, sizeof(*str));
-	str->len = s_len;
-	str->data = s;
 
-	yylval.y_string = str;
+	yylval.y_string = buf;
 	return T_STRING;
 }
 
@@ -1288,15 +1279,10 @@ lex_wide_string(void)
 {
 	int c, n;
 
-	size_t len = 0, max = 64;
-	char *s = xmalloc(max);
-	while ((c = get_escaped_char('"')) >= 0) {
-		/* +1 to save space for a trailing NUL character */
-		if (len + 1 >= max)
-			s = xrealloc(s, max *= 2);
-		s[len++] = (char)c;
-	}
-	s[len] = '\0';
+	buffer buf;
+	buf_init();
+	while ((c = get_escaped_char('"')) >= 0)
+		buf_add_char(, (char)c);
 	if (c == -2)
 		/* unterminated string constant */
 		error(258);
@@ -1304,8 +1290,8 @@ lex_wide_string(void)
 	/* get length of wide-character string */
 	(void)mblen(NULL, 0);
 	size_t 

CVS commit: src/usr.bin/xlint

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 21:19:13 UTC 2024

Modified Files:
src/usr.bin/xlint/common: externs.h tyname.c
src/usr.bin/xlint/lint1: lex.c tree.c

Log Message:
lint: reuse buffer editing code across lint1

Fix cat_strings to update the capacity of the buffer, to prevent
quadratic runtime when concatenating string literals.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.205 -r1.206 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.600 -r1.601 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/usr.bin/xlint

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 18:37:07 UTC 2024

Modified Files:
src/usr.bin/xlint/common: lint.h tyname.c
src/usr.bin/xlint/lint1: cgram.y ckgetopt.c debug.c emit1.c externs1.h
init.c lex.c lint1.h tree.c

Log Message:
lint: use standard buffer for storing string values

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.484 -r1.485 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/ckgetopt.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.212 -r1.213 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.256 -r1.257 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.210 -r1.211 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.599 -r1.600 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.47 src/usr.bin/xlint/common/lint.h:1.48
--- src/usr.bin/xlint/common/lint.h:1.47	Sat Jan 20 10:25:57 2024
+++ src/usr.bin/xlint/common/lint.h	Thu Feb  1 18:37:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.47 2024/01/20 10:25:57 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.48 2024/02/01 18:37:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -48,6 +48,14 @@
 #include "param.h"
 
 #if IS_LINT1 || IS_LINT2
+
+// Null-terminated character buffer, may contain null characters.
+typedef struct {
+	size_t	len;		/* excluding the terminating '\0' */
+	size_t	cap;
+	char	*data;
+} buffer;
+
 /*
  * Type specifiers, used in type structures (type_t) and elsewhere.
  */

Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.58 src/usr.bin/xlint/common/tyname.c:1.59
--- src/usr.bin/xlint/common/tyname.c:1.58	Sat Jan 20 10:25:57 2024
+++ src/usr.bin/xlint/common/tyname.c	Thu Feb  1 18:37:06 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.58 2024/01/20 10:25:57 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.59 2024/02/01 18:37:06 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tyname.c,v 1.58 2024/01/20 10:25:57 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.59 2024/02/01 18:37:06 rillig Exp $");
 #endif
 
 #include 
@@ -56,13 +56,6 @@ typedef struct name_tree_node {
 	struct name_tree_node *ntn_greater;
 } name_tree_node;
 
-/* A growable string buffer. */
-typedef struct buffer {
-	size_t	len;
-	size_t	cap;
-	char *	data;
-} buffer;
-
 static name_tree_node *type_names;
 
 static name_tree_node *

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.484 src/usr.bin/xlint/lint1/cgram.y:1.485
--- src/usr.bin/xlint/lint1/cgram.y:1.484	Tue Jan 23 19:44:28 2024
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Feb  1 18:37:06 2024
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.484 2024/01/23 19:44:28 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.485 2024/02/01 18:37:06 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: cgram.y,v 1.484 2024/01/23 19:44:28 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.485 2024/02/01 18:37:06 rillig Exp $");
 #endif
 
 #include 
@@ -148,7 +148,7 @@ is_either(const char *s, const char *a, 
 	type_t	*y_type;
 	tnode_t	*y_tnode;
 	range_t	y_range;
-	strg_t	*y_string;
+	buffer	*y_string;
 	qual_ptr *y_qual_ptr;
 	bool	y_seen_statement;
 	struct generic_association *y_generic;

Index: src/usr.bin/xlint/lint1/ckgetopt.c
diff -u src/usr.bin/xlint/lint1/ckgetopt.c:1.19 src/usr.bin/xlint/lint1/ckgetopt.c:1.20
--- src/usr.bin/xlint/lint1/ckgetopt.c:1.19	Mon Jan 29 21:30:24 2024
+++ src/usr.bin/xlint/lint1/ckgetopt.c	Thu Feb  1 18:37:06 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ckgetopt.c,v 1.19 2024/01/29 21:30:24 rillig Exp $ */
+/* $NetBSD: ckgetopt.c,v 1.20 2024/02/01 18:37:06 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: ckgetopt.c,v 1.19 2024/01/29 21:30:24 rillig Exp $");
+__RCSID("$NetBSD: ckgetopt.c,v 1.20 2024/02/01 18:37:06 rillig Exp $");
 #endif
 
 #include 
@@ -80,7 +80,7 @@ static bool
 is_getopt_condition(const tnode_t *tn, char **out_options)
 {
 	const tnode_t *call, *last_arg;
-	const strg_t *str;
+	const buffer *str;
 
 	if (tn != NULL
 	&& tn->tn_op == NE
@@ -99,8 +99,8 @@ is_getopt_condition(const tnode_t *tn, c
 	&& (last_arg = call->tn_right->tn_left)->tn_op == CVT
 	&& last_arg->tn_left->tn_op == ADDR
 	&& last_arg->tn_left->tn_left->tn_op == STRING
-	&& (str 

CVS commit: src/usr.bin/xlint

2024-02-01 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Feb  1 18:37:07 UTC 2024

Modified Files:
src/usr.bin/xlint/common: lint.h tyname.c
src/usr.bin/xlint/lint1: cgram.y ckgetopt.c debug.c emit1.c externs1.h
init.c lex.c lint1.h tree.c

Log Message:
lint: use standard buffer for storing string values

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.484 -r1.485 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/ckgetopt.c
cvs rdiff -u -r1.67 -r1.68 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.212 -r1.213 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.256 -r1.257 src/usr.bin/xlint/lint1/init.c
cvs rdiff -u -r1.204 -r1.205 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.210 -r1.211 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.599 -r1.600 src/usr.bin/xlint/lint1/tree.c

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



CVS commit: src/doc

2024-02-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Feb  1 10:06:08 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
new mozilla-certdata out


To generate a diff of this commit:
cvs rdiff -u -r1.1981 -r1.1982 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1981 src/doc/3RDPARTY:1.1982
--- src/doc/3RDPARTY:1.1981	Mon Jan 29 23:14:46 2024
+++ src/doc/3RDPARTY	Thu Feb  1 10:06:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1981 2024/01/29 23:14:46 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1982 2024/02/01 10:06:08 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -2327,11 +2327,11 @@ Notes:
 
 Package:	mozilla-certdata
 Version:	2023-07-19 (f479bdba756c78ef9355a48c88744c69fdb4768e)
-Current Vers:	2023-07-19 (f479bdba756c78ef9355a48c88744c69fdb4768e)
+Current Vers:	2024-01-31 (a6efd358880291357a62d58586f9a218d47ad98b)
 Maintainer:	Mozilla
 Archive Site:	https://hg.mozilla.org/projects/nss/log/tip/lib/ckfw/builtins/certdata.txt
 Home Page:	https://wiki.mozilla.org/CA
-Date:		2023-08-16
+Date:		2024-02-01
 Mailing List:	
 License:	MPL
 Responsible:	riastradh, security-team



CVS commit: src/doc

2024-02-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Feb  1 10:06:08 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
new mozilla-certdata out


To generate a diff of this commit:
cvs rdiff -u -r1.1981 -r1.1982 src/doc/3RDPARTY

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