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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 05:47:41 UTC 2023

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

Log Message:
lint: enhance debug output for diagnostics

Only print the debug message if the diagnostic is active, which is
relevant for c99ism, c11ism and gnuism.

Print more details about the diagnostic or query.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/usr.bin/xlint/lint1/lint1.h

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



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 05:47:41 UTC 2023

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

Log Message:
lint: enhance debug output for diagnostics

Only print the debug message if the diagnostic is active, which is
relevant for c99ism, c11ism and gnuism.

Print more details about the diagnostic or query.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/usr.bin/xlint/lint1/lint1.h

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

Modified files:

Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.167 src/usr.bin/xlint/lint1/lint1.h:1.168
--- src/usr.bin/xlint/lint1/lint1.h:1.167	Sat Jun 24 20:50:54 2023
+++ src/usr.bin/xlint/lint1/lint1.h	Thu Jun 29 05:47:41 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.167 2023/06/24 20:50:54 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.168 2023/06/29 05:47:41 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -486,25 +486,30 @@ check_printf(const char *fmt, ...)
 #  define message_at(msgid, pos, args...) \
 	wrap_check_printf_at(message_at, msgid, pos, ##args)
 
-#  define wrap_check_printf(func, msgid, args...)			\
+#  define wrap_check_printf(func, cond, msgid, args...)			\
 	({\
-		debug_step("%s:%d: %s", __FILE__, __LINE__, __func__);	\
+		if (/* CONSTCOND */cond)\
+			debug_step("%s:%d: %s %d '%s' in %s",		\
+			__FILE__, __LINE__,	#func, msgid,		\
+			__CONCAT(MSG_, msgid), __func__);		\
 		check_printf(__CONCAT(MSG_, msgid), ##args);		\
 		(func)(msgid, ##args);	\
 		/* LINTED 129 */	\
 	})
 
-#  define error(msgid, args...) wrap_check_printf(error, msgid, ##args)
-#  define warning(msgid, args...) wrap_check_printf(warning, msgid, ##args)
-#  define gnuism(msgid, args...) wrap_check_printf(gnuism, msgid, ##args)
-#  define c99ism(msgid, args...) wrap_check_printf(c99ism, msgid, ##args)
-#  define c11ism(msgid, args...) wrap_check_printf(c11ism, msgid, ##args)
+#  define error(msgid, args...) wrap_check_printf(error, true, msgid, ##args)
+#  define warning(msgid, args...) wrap_check_printf(warning, true, msgid, ##args)
+#  define gnuism(msgid, args...) wrap_check_printf(gnuism, !allow_gcc || (!allow_trad && !allow_c99), msgid, ##args)
+#  define c99ism(msgid, args...) wrap_check_printf(c99ism, !allow_c99 && (!allow_gcc || !allow_trad), msgid, ##args)
+#  define c11ism(msgid, args...) wrap_check_printf(c11ism, !allow_c11 && !allow_gcc, msgid, ##args)
 #endif
 
 #ifdef DEBUG
 #  define query_message(query_id, args...)\
 	do {\
-		debug_step("%s:%d: %s", __FILE__, __LINE__, __func__);	\
+		debug_step("%s:%d: query %d '%s' in %s",		\
+		__FILE__, __LINE__,	\
+		query_id, __CONCAT(MSG_Q, query_id), __func__);	\
 		check_printf(__CONCAT(MSG_Q, query_id), ##args);	\
 		(query_message)(query_id, ##args);			\
 	} while (false)



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 05:03:03 UTC 2023

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

Log Message:
lint: clean up completion of struct, union and enum declarations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.436 -r1.437 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.178 -r1.179 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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.436 src/usr.bin/xlint/lint1/cgram.y:1.437
--- src/usr.bin/xlint/lint1/cgram.y:1.436	Mon May 22 17:47:27 2023
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Jun 29 05:03:03 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.436 2023/05/22 17:47:27 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.437 2023/06/29 05:03:03 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.436 2023/05/22 17:47:27 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.437 2023/06/29 05:03:03 rillig Exp $");
 #endif
 
 #include 
@@ -888,12 +888,12 @@ struct_or_union_specifier:	/* C99 6.7.2.
 	| struct_or_union identifier_sym {
 		dcs->d_tagtyp = make_tag_type($2, $1, true, false);
 	  } braced_struct_declaration_list {
-		$$ = complete_tag_struct_or_union(dcs->d_tagtyp, $4);
+		$$ = complete_struct_or_union($4);
 	  }
 	| struct_or_union {
 		dcs->d_tagtyp = make_tag_type(NULL, $1, true, false);
 	  } braced_struct_declaration_list {
-		$$ = complete_tag_struct_or_union(dcs->d_tagtyp, $3);
+		$$ = complete_struct_or_union($3);
 	  }
 	| struct_or_union error {
 		symtyp = FVFT;
@@ -1040,12 +1040,12 @@ enum_specifier:			/* C99 6.7.2.2 */
 	| enum gcc_attribute_specifier_list_opt identifier_sym {
 		dcs->d_tagtyp = make_tag_type($3, ENUM, true, false);
 	  } enum_declaration /*gcc_attribute_specifier_list_opt*/ {
-		$$ = complete_tag_enum(dcs->d_tagtyp, $5);
+		$$ = complete_enum($5);
 	  }
 	| enum gcc_attribute_specifier_list_opt {
 		dcs->d_tagtyp = make_tag_type(NULL, ENUM, true, false);
 	  } enum_declaration /*gcc_attribute_specifier_list_opt*/ {
-		$$ = complete_tag_enum(dcs->d_tagtyp, $4);
+		$$ = complete_enum($4);
 	  }
 	| enum error {
 		symtyp = FVFT;

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.318 src/usr.bin/xlint/lint1/decl.c:1.319
--- src/usr.bin/xlint/lint1/decl.c:1.318	Sat Jun 24 06:55:34 2023
+++ src/usr.bin/xlint/lint1/decl.c	Thu Jun 29 05:03:03 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.318 2023/06/24 06:55:34 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.319 2023/06/29 05:03:03 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.318 2023/06/24 06:55:34 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.319 2023/06/29 05:03:03 rillig Exp $");
 #endif
 
 #include 
@@ -1182,7 +1182,7 @@ declarator_1_struct_union(sym_t *dsym)
 }
 
 /*
- * Aligns next structure element as required.
+ * Aligns the next structure element as required.
  *
  * al contains the required alignment, len the length of a bit-field.
  */
@@ -1559,7 +1559,6 @@ declarator_name(sym_t *sym)
 		/* Set parent */
 		sym->u.s_member.sm_sou_type = dcs->d_tagtyp->t_sou;
 		sym->s_def = DEF;
-		/* XXX: Where is sym->u.s_member.sm_offset_in_bits set? */
 		sc = dcs->d_kind == DK_STRUCT_MEMBER
 		? STRUCT_MEMBER
 		: UNION_MEMBER;
@@ -1808,27 +1807,20 @@ storage_class_name(scl_t sc)
 	/* NOTREACHED */
 }
 
-/*
- * tp points to the type of the tag, fmem to the list of members.
- */
 type_t *
-complete_tag_struct_or_union(type_t *tp, sym_t *fmem)
+complete_struct_or_union(sym_t *first_member)
 {
 
+	type_t *tp = dcs->d_tagtyp;
 	if (tp == NULL)		/* in case of syntax errors */
 		return gettyp(INT);
 
-	if (tp->t_tspec == ENUM)
-		tp->t_enum->en_incomplete = false;
-	else
-		tp->t_sou->sou_incomplete = false;
-
-	tspec_t t = tp->t_tspec;
 	dcs_align((u_int)dcs->d_sou_align_in_bits, 0);
 
 	struct_or_union *sp = tp->t_sou;
 	sp->sou_align_in_bits = dcs->d_sou_align_in_bits;
-	sp->sou_first_member = fmem;
+	sp->sou_incomplete = false;
+	sp->sou_first_member = first_member;
 	if (tp->t_packed)
 		set_packed_size(tp);
 	else
@@ -1836,11 +1828,11 @@ complete_tag_struct_or_union(type_t *tp,
 
 	if (sp->sou_size_in_bits == 0) {
 		/* zero sized %s is a C99 feature */
-		c99ism(47, ttab[t].tt_name);
+		c99ism(47, tspec_name(tp->t_tspec));
 	}
 
 	int n = 0;
-	for (sym_t *mem = fmem; mem != NULL; mem = mem->s_next) {
+	for (sym_t *mem = first_member; mem != NULL; mem = mem->s_next) {
 		/* bind anonymous members to the structure */
 		if (mem->u.s_member.sm_sou_type == NULL) {
 			mem->u.s_member.sm_sou_type = sp;
@@ 

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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 05:03:03 UTC 2023

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

Log Message:
lint: clean up completion of struct, union and enum declarations

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.436 -r1.437 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.178 -r1.179 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.



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

2023-06-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Jun 29 01:30:31 UTC 2023

Modified Files:
src/external/bsd/tmux/dist: cmd-display-menu.c

Log Message:
Avoid comparing signed and unsigned values (using signed here seems
safer than the usual unsigned when this happens).   Might fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tmux/dist/cmd-display-menu.c

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



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

2023-06-28 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Jun 29 01:30:31 UTC 2023

Modified Files:
src/external/bsd/tmux/dist: cmd-display-menu.c

Log Message:
Avoid comparing signed and unsigned values (using signed here seems
safer than the usual unsigned when this happens).   Might fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tmux/dist/cmd-display-menu.c

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

Modified files:

Index: src/external/bsd/tmux/dist/cmd-display-menu.c
diff -u src/external/bsd/tmux/dist/cmd-display-menu.c:1.5 src/external/bsd/tmux/dist/cmd-display-menu.c:1.6
--- src/external/bsd/tmux/dist/cmd-display-menu.c:1.5	Wed Jun 28 22:21:26 2023
+++ src/external/bsd/tmux/dist/cmd-display-menu.c	Thu Jun 29 01:30:31 2023
@@ -200,7 +200,7 @@ cmd_display_menu_get_position(struct cli
 		} else
 			format_add(ft, "popup_mouse_centre_y", "%ld", n);
 		n = (long)event->m.y + h;
-		if (n >= tty->sy)
+		if (n >= (long)tty->sy)
 			format_add(ft, "popup_mouse_top", "%u", tty->sy - 1);
 		else
 			format_add(ft, "popup_mouse_top", "%ld", n);



CVS commit: src/external/bsd/tmux/usr.bin/tmux

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:47:39 UTC 2023

Modified Files:
src/external/bsd/tmux/usr.bin/tmux: Makefile

Log Message:
tmux: also set HAVE_REALLOCARRAY


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/tmux/usr.bin/tmux/Makefile

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

Modified files:

Index: src/external/bsd/tmux/usr.bin/tmux/Makefile
diff -u src/external/bsd/tmux/usr.bin/tmux/Makefile:1.30 src/external/bsd/tmux/usr.bin/tmux/Makefile:1.31
--- src/external/bsd/tmux/usr.bin/tmux/Makefile:1.30	Wed Jun 28 22:21:48 2023
+++ src/external/bsd/tmux/usr.bin/tmux/Makefile	Wed Jun 28 22:47:39 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.30 2023/06/28 22:21:48 wiz Exp $
+# $NetBSD: Makefile,v 1.31 2023/06/28 22:47:39 wiz Exp $
 
 .include 
 
@@ -163,7 +163,7 @@ CPPFLAGS+=	-I${SRCDIR} -I${.CURDIR}
 # Would be nicer to stick this in a config.h file, but the upstream code
 # does not use one at this moment.
 
-# HAVE_VIS and HAVE_TREE_H added manually; HAVE_BSD_GETOPT_H necessary due to local patches
+# HAVE_REALLOCARRAY, HAVE_TREE_H, HAVE_VIS added manually; HAVE_BSD_GETOPT_H necessary due to local patches
 CPPFLAGS+=	\
 -DHAVE_ASPRINTF=1 \
 -DHAVE_B64_NTOP=1 \
@@ -193,6 +193,7 @@ CPPFLAGS+=	\
 -DHAVE_PATHS_H=1 \
 -DHAVE_PROC_PID=1 \
 -DHAVE_QUEUE_H=1 \
+-DHAVE_REALLOCARRAY=1 \
 -DHAVE_SETENV=1 \
 -DHAVE_SETPROCTITLE=1 \
 -DHAVE_STDINT_H=1 \



CVS commit: src/external/bsd/tmux/usr.bin/tmux

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:47:39 UTC 2023

Modified Files:
src/external/bsd/tmux/usr.bin/tmux: Makefile

Log Message:
tmux: also set HAVE_REALLOCARRAY


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/external/bsd/tmux/usr.bin/tmux/Makefile

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



CVS commit: src/external/bsd/tmux/usr.bin/tmux

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:21:48 UTC 2023

Modified Files:
src/external/bsd/tmux/usr.bin/tmux: Makefile

Log Message:
update build system for tmux 3.3a


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/tmux/usr.bin/tmux/Makefile

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

Modified files:

Index: src/external/bsd/tmux/usr.bin/tmux/Makefile
diff -u src/external/bsd/tmux/usr.bin/tmux/Makefile:1.29 src/external/bsd/tmux/usr.bin/tmux/Makefile:1.30
--- src/external/bsd/tmux/usr.bin/tmux/Makefile:1.29	Sat Jun  3 09:09:05 2023
+++ src/external/bsd/tmux/usr.bin/tmux/Makefile	Wed Jun 28 22:21:48 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.29 2023/06/03 09:09:05 lukem Exp $
+# $NetBSD: Makefile,v 1.30 2023/06/28 22:21:48 wiz Exp $
 
 .include 
 
@@ -67,12 +67,14 @@ cmd-select-layout.c \
 cmd-select-pane.c \
 cmd-select-window.c \
 cmd-send-keys.c \
+cmd-server-access.c \
 cmd-set-buffer.c \
 cmd-set-environment.c \
 cmd-set-option.c \
 cmd-show-environment.c \
 cmd-show-messages.c \
 cmd-show-options.c \
+cmd-show-prompt-history.c \
 cmd-source-file.c \
 cmd-split-window.c \
 cmd-swap-pane.c \
@@ -115,6 +117,7 @@ resize.c \
 screen-redraw.c \
 screen-write.c \
 screen.c \
+server-acl.c \
 server-client.c \
 server-fn.c \
 server.c \
@@ -160,13 +163,13 @@ CPPFLAGS+=	-I${SRCDIR} -I${.CURDIR}
 # Would be nicer to stick this in a config.h file, but the upstream code
 # does not use one at this moment.
 
+# HAVE_VIS and HAVE_TREE_H added manually; HAVE_BSD_GETOPT_H necessary due to local patches
 CPPFLAGS+=	\
 -DHAVE_ASPRINTF=1 \
 -DHAVE_B64_NTOP=1 \
 -DHAVE_BITSTRING_H=1 \
 -DHAVE_BSD_GETOPT=1 \
 -DHAVE_CFMAKERAW=1 \
--DHAVE_CFMAKERAWEP=1 \
 -DHAVE_CLOCK_GETTIME=1 \
 -DHAVE_CLOSEFROM=1 \
 -DHAVE_CURSES_H=1 \
@@ -178,10 +181,9 @@ CPPFLAGS+=	\
 -DHAVE_FGETLN=1 \
 -DHAVE_FLOCK=1 \
 -DHAVE_FORKPTY=1 \
--DHAVE_FPARSELN=1 \
 -DHAVE_GETDTABLESIZE=1 \
 -DHAVE_GETLINE=1 \
--DHAVE_GETOPT=1 \
+-DHAVE_GETPEEREID=1 \
 -DHAVE_GETPROGNAME=1 \
 -DHAVE_INTTYPES_H=1 \
 -DHAVE_LIBM=1 \
@@ -191,7 +193,6 @@ CPPFLAGS+=	\
 -DHAVE_PATHS_H=1 \
 -DHAVE_PROC_PID=1 \
 -DHAVE_QUEUE_H=1 \
--DHAVE_REALLOCARRAY=1 \
 -DHAVE_SETENV=1 \
 -DHAVE_SETPROCTITLE=1 \
 -DHAVE_STDINT_H=1 \
@@ -212,35 +213,37 @@ CPPFLAGS+=	\
 -DHAVE_SYS_TYPES_H=1 \
 -DHAVE_TREE_H=1 \
 -DHAVE_UNISTD_H=1 \
--DHAVE_UTEMPTER=1 \
 -DHAVE_UTIL_H=1 \
 -DHAVE_VIS=1 \
 -DHAVE___PROGNAME=1 \
 -DPACKAGE=\"tmux\" \
 -DPACKAGE_BUGREPORT=\"\" \
 -DPACKAGE_NAME=\"tmux\" \
--DPACKAGE_STRING=\"tmux\ 3.2a\" \
+-DPACKAGE_STRING=\"tmux\ 3.3a\" \
 -DPACKAGE_TARNAME=\"tmux\" \
 -DPACKAGE_URL=\"\" \
--DPACKAGE_VERSION=\"3.2a\" \
+-DPACKAGE_VERSION=\"3.3a\" \
 -DSTDC_HEADERS=1 \
--DTMUX_CONF="\"/etc/tmux.conf:~/.tmux.conf:~/.config/tmux/tmux.conf\"" \
--DTMUX_VERSION='"3.2a"' \
--DVERSION=\"3.2a\" \
+-DTMUX_CONF='"/etc/tmux.conf:~/.tmux.conf:$XDG_CONFIG_HOME/tmux/tmux.conf:~/.config/tmux/tmux.conf"' \
+-DTMUX_TERM='"tmux-256color"' \
+-DTMUX_VERSION='"3.3a"' \
+-DVERSION=\"3.3a\" \
 -D_ALL_SOURCE=1 \
+-D_FORTIFY_SOURCE=2 \
 -D_GNU_SOURCE=1 \
--D_NETBSD_SOURCE \
 -D_OPENBSD_SOURCE \
 -D_POSIX_PTHREAD_SEMANTICS=1 \
 -D_TANDEM_SOURCE=1 \
--D_XOPEN_SOURCE=500 \
 -D__EXTENSIONS__=1
 
 LDADD+=		-levent -lterminfo -lutil -lm
 DPADD+=		${LIBEVENT} ${LIBTERMINFO} ${LIBUTIL}
 
 COPTS.format.c += -Wno-format-nonliteral
+COPTS.input.c += -Wno-sign-compare -Wno-pointer-sign
+COPTS.notify.c += -Wno-sign-compare
+COPTS.tty.c += -Wno-pointer-sign
 COPTS.utempter.c+=	${CC_WNO_STRINGOP_TRUNCATION}
-COPTS.window-copy.c+=	${CC_WNO_MAYBE_UNINITIALIZED}
+COPTS.window-copy.c+=	${CC_WNO_MAYBE_UNINITIALIZED} -Wno-pointer-sign
 
 .include 



CVS commit: src/doc

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:24:15 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
doc: note import of tmux 3.3a


To generate a diff of this commit:
cvs rdiff -u -r1.1934 -r1.1935 src/doc/3RDPARTY
cvs rdiff -u -r1.2975 -r1.2976 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1934 src/doc/3RDPARTY:1.1935
--- src/doc/3RDPARTY:1.1934	Tue Jun 27 17:10:15 2023
+++ src/doc/3RDPARTY	Wed Jun 28 22:24:15 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1934 2023/06/27 17:10:15 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1935 2023/06/28 22:24:15 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1374,7 +1374,7 @@ perhaps this implementation should be ke
 purposes.
 
 Package:	tmux
-Version:	3.2a
+Version:	3.3a
 Current Vers:	3.3a
 Maintainer:	Nicholas Marriott 
 Archive site:	https://github.com/tmux/tmux

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2975 src/doc/CHANGES:1.2976
--- src/doc/CHANGES:1.2975	Tue Jun 27 17:10:15 2023
+++ src/doc/CHANGES	Wed Jun 28 22:24:15 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2975 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2976 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -135,3 +135,4 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 	kerberos(8): Update to Heimdal-7.8.0 [christos 20230619]
 	bind: Import version 9.16.42. [christos 20230626]
 	openresolv: Import version 3.13.2 [roy 20230627]
+	tmux(1): Import version 3.3a [wiz 20230628]



CVS commit: src/doc

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:24:15 UTC 2023

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
doc: note import of tmux 3.3a


To generate a diff of this commit:
cvs rdiff -u -r1.1934 -r1.1935 src/doc/3RDPARTY
cvs rdiff -u -r1.2975 -r1.2976 src/doc/CHANGES

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



CVS commit: src/external/bsd/tmux/usr.bin/tmux

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:21:48 UTC 2023

Modified Files:
src/external/bsd/tmux/usr.bin/tmux: Makefile

Log Message:
update build system for tmux 3.3a


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/tmux/usr.bin/tmux/Makefile

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



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

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:21:26 UTC 2023

Modified Files:
src/external/bsd/tmux/dist: client.c cmd-attach-session.c
cmd-capture-pane.c cmd-display-menu.c cmd-display-message.c
cmd-if-shell.c cmd-load-buffer.c cmd-new-session.c cmd-new-window.c
cmd-parse.y cmd-paste-buffer.c cmd-queue.c cmd-resize-window.c
cmd-send-keys.c cmd-show-messages.c cmd-show-options.c
cmd-split-window.c cmd-wait-for.c colour.c compat.h control.c
format.c grid.c input-keys.c input.c job.c key-bindings.c log.c
menu.c mode-tree.c notify.c options.c proc.c resize.c
screen-write.c screen.c server-client.c server-fn.c server.c
session.c spawn.c status.c style.c tmux.1 tmux.c tmux.h tty-acs.c
tty-keys.c tty-term.c tty.c utf8.c window-buffer.c window-client.c
window-copy.c window-customize.c window-tree.c window.c xmalloc.h

Log Message:
merge tmux 3.3a


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/tmux/dist/client.c \
src/external/bsd/tmux/dist/cmd-display-message.c \
src/external/bsd/tmux/dist/cmd-if-shell.c \
src/external/bsd/tmux/dist/cmd-send-keys.c \
src/external/bsd/tmux/dist/grid.c \
src/external/bsd/tmux/dist/key-bindings.c
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/tmux/dist/cmd-attach-session.c \
src/external/bsd/tmux/dist/cmd-capture-pane.c \
src/external/bsd/tmux/dist/cmd-new-window.c \
src/external/bsd/tmux/dist/cmd-paste-buffer.c \
src/external/bsd/tmux/dist/tty.c src/external/bsd/tmux/dist/window-tree.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/tmux/dist/cmd-display-menu.c \
src/external/bsd/tmux/dist/cmd-parse.y \
src/external/bsd/tmux/dist/cmd-show-options.c \
src/external/bsd/tmux/dist/resize.c src/external/bsd/tmux/dist/spawn.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/tmux/dist/cmd-load-buffer.c \
src/external/bsd/tmux/dist/cmd-new-session.c \
src/external/bsd/tmux/dist/cmd-split-window.c \
src/external/bsd/tmux/dist/colour.c \
src/external/bsd/tmux/dist/server-client.c \
src/external/bsd/tmux/dist/tty-acs.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/tmux/dist/cmd-queue.c \
src/external/bsd/tmux/dist/notify.c \
src/external/bsd/tmux/dist/window-client.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/tmux/dist/cmd-resize-window.c \
src/external/bsd/tmux/dist/compat.h src/external/bsd/tmux/dist/control.c \
src/external/bsd/tmux/dist/menu.c \
src/external/bsd/tmux/dist/window-customize.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/tmux/dist/cmd-show-messages.c \
src/external/bsd/tmux/dist/cmd-wait-for.c \
src/external/bsd/tmux/dist/mode-tree.c src/external/bsd/tmux/dist/utf8.c \
src/external/bsd/tmux/dist/window-buffer.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/tmux/dist/format.c \
src/external/bsd/tmux/dist/screen-write.c \
src/external/bsd/tmux/dist/screen.c \
src/external/bsd/tmux/dist/server-fn.c \
src/external/bsd/tmux/dist/session.c src/external/bsd/tmux/dist/tmux.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/tmux/dist/input-keys.c \
src/external/bsd/tmux/dist/job.c src/external/bsd/tmux/dist/options.c
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/tmux/dist/input.c \
src/external/bsd/tmux/dist/tty-keys.c
cvs rdiff -u -r1.15 -r1.16 src/external/bsd/tmux/dist/log.c \
src/external/bsd/tmux/dist/tmux.1 src/external/bsd/tmux/dist/tty-term.c \
src/external/bsd/tmux/dist/window.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/tmux/dist/proc.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/tmux/dist/server.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/tmux/dist/status.c \
src/external/bsd/tmux/dist/window-copy.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/tmux/dist/style.c \
src/external/bsd/tmux/dist/xmalloc.h
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/tmux/dist/tmux.h

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



CVS import: src/external/bsd/tmux/dist

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:10:26 UTC 2023

Update of /cvsroot/src/external/bsd/tmux/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13392

Log Message:
Import original sources for tmux 3.3a.

Status:

Vendor Tag: TMUX
Release Tags:   tmux-3-3a

U src/external/bsd/tmux/dist/Makefile.am
U src/external/bsd/tmux/dist/configure
U src/external/bsd/tmux/dist/configure.ac
U src/external/bsd/tmux/dist/aclocal.m4
U src/external/bsd/tmux/dist/Makefile.in
U src/external/bsd/tmux/dist/COPYING
U src/external/bsd/tmux/dist/README
C src/external/bsd/tmux/dist/cmd-parse.c
U src/external/bsd/tmux/dist/alerts.c
U src/external/bsd/tmux/dist/arguments.c
U src/external/bsd/tmux/dist/attributes.c
U src/external/bsd/tmux/dist/cfg.c
C src/external/bsd/tmux/dist/client.c
C src/external/bsd/tmux/dist/cmd-attach-session.c
U src/external/bsd/tmux/dist/cmd-bind-key.c
U src/external/bsd/tmux/dist/cmd-break-pane.c
C src/external/bsd/tmux/dist/cmd-capture-pane.c
U src/external/bsd/tmux/dist/cmd-choose-tree.c
U src/external/bsd/tmux/dist/cmd-command-prompt.c
U src/external/bsd/tmux/dist/cmd.c
U src/external/bsd/tmux/dist/cmd-confirm-before.c
U src/external/bsd/tmux/dist/cmd-copy-mode.c
U src/external/bsd/tmux/dist/cmd-detach-client.c
C src/external/bsd/tmux/dist/cmd-display-menu.c
C src/external/bsd/tmux/dist/cmd-display-message.c
U src/external/bsd/tmux/dist/cmd-display-panes.c
U src/external/bsd/tmux/dist/cmd-find-window.c
U src/external/bsd/tmux/dist/cmd-find.c
C src/external/bsd/tmux/dist/cmd-if-shell.c
U src/external/bsd/tmux/dist/cmd-join-pane.c
U src/external/bsd/tmux/dist/cmd-kill-pane.c
U src/external/bsd/tmux/dist/cmd-kill-server.c
U src/external/bsd/tmux/dist/cmd-kill-session.c
U src/external/bsd/tmux/dist/cmd-kill-window.c
U src/external/bsd/tmux/dist/cmd-list-buffers.c
U src/external/bsd/tmux/dist/cmd-list-clients.c
U src/external/bsd/tmux/dist/cmd-list-keys.c
U src/external/bsd/tmux/dist/cmd-list-panes.c
U src/external/bsd/tmux/dist/cmd-list-sessions.c
U src/external/bsd/tmux/dist/cmd-list-windows.c
C src/external/bsd/tmux/dist/cmd-load-buffer.c
U src/external/bsd/tmux/dist/cmd-lock-server.c
U src/external/bsd/tmux/dist/cmd-move-window.c
C src/external/bsd/tmux/dist/cmd-new-session.c
C src/external/bsd/tmux/dist/cmd-new-window.c
C src/external/bsd/tmux/dist/cmd-parse.y
C src/external/bsd/tmux/dist/cmd-paste-buffer.c
U src/external/bsd/tmux/dist/cmd-pipe-pane.c
C src/external/bsd/tmux/dist/cmd-queue.c
U src/external/bsd/tmux/dist/cmd-refresh-client.c
U src/external/bsd/tmux/dist/cmd-rename-session.c
U src/external/bsd/tmux/dist/cmd-rename-window.c
U src/external/bsd/tmux/dist/cmd-resize-pane.c
C src/external/bsd/tmux/dist/cmd-resize-window.c
U src/external/bsd/tmux/dist/cmd-respawn-pane.c
U src/external/bsd/tmux/dist/cmd-respawn-window.c
U src/external/bsd/tmux/dist/cmd-rotate-window.c
U src/external/bsd/tmux/dist/file.c
U src/external/bsd/tmux/dist/cmd-run-shell.c
U src/external/bsd/tmux/dist/cmd-save-buffer.c
U src/external/bsd/tmux/dist/cmd-select-layout.c
U src/external/bsd/tmux/dist/cmd-select-pane.c
U src/external/bsd/tmux/dist/cmd-select-window.c
C src/external/bsd/tmux/dist/cmd-send-keys.c
N src/external/bsd/tmux/dist/cmd-server-access.c
U src/external/bsd/tmux/dist/cmd-set-buffer.c
U src/external/bsd/tmux/dist/cmd-set-environment.c
U src/external/bsd/tmux/dist/cmd-set-option.c
U src/external/bsd/tmux/dist/cmd-show-environment.c
C src/external/bsd/tmux/dist/cmd-show-messages.c
C src/external/bsd/tmux/dist/cmd-show-options.c
N src/external/bsd/tmux/dist/cmd-show-prompt-history.c
U src/external/bsd/tmux/dist/cmd-source-file.c
C src/external/bsd/tmux/dist/cmd-split-window.c
U src/external/bsd/tmux/dist/cmd-swap-pane.c
U src/external/bsd/tmux/dist/cmd-swap-window.c
U src/external/bsd/tmux/dist/cmd-switch-client.c
U src/external/bsd/tmux/dist/cmd-unbind-key.c
C src/external/bsd/tmux/dist/cmd-wait-for.c
C src/external/bsd/tmux/dist/colour.c
C src/external/bsd/tmux/dist/compat.h
U src/external/bsd/tmux/dist/control-notify.c
C src/external/bsd/tmux/dist/control.c
U src/external/bsd/tmux/dist/environ.c
C src/external/bsd/tmux/dist/format.c
U src/external/bsd/tmux/dist/format-draw.c
U src/external/bsd/tmux/dist/grid-reader.c
U src/external/bsd/tmux/dist/grid-view.c
C src/external/bsd/tmux/dist/grid.c
C src/external/bsd/tmux/dist/input-keys.c
C src/external/bsd/tmux/dist/input.c
C src/external/bsd/tmux/dist/job.c
C src/external/bsd/tmux/dist/key-bindings.c
U src/external/bsd/tmux/dist/key-string.c
U src/external/bsd/tmux/dist/layout-custom.c
U src/external/bsd/tmux/dist/layout-set.c
U src/external/bsd/tmux/dist/layout.c
C src/external/bsd/tmux/dist/log.c
C src/external/bsd/tmux/dist/menu.c
U src/external/bsd/tmux/dist/names.c
C src/external/bsd/tmux/dist/mode-tree.c
C src/external/bsd/tmux/dist/notify.c
U src/external/bsd/tmux/dist/options-table.c
C src/external/bsd/tmux/dist/options.c
U src/external/bsd/tmux/dist/paste.c
U src/external/bsd/tmux/dist/popup.c
C 

CVS import: src/external/bsd/tmux/dist

2023-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun 28 22:10:26 UTC 2023

Update of /cvsroot/src/external/bsd/tmux/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13392

Log Message:
Import original sources for tmux 3.3a.

Status:

Vendor Tag: TMUX
Release Tags:   tmux-3-3a

U src/external/bsd/tmux/dist/Makefile.am
U src/external/bsd/tmux/dist/configure
U src/external/bsd/tmux/dist/configure.ac
U src/external/bsd/tmux/dist/aclocal.m4
U src/external/bsd/tmux/dist/Makefile.in
U src/external/bsd/tmux/dist/COPYING
U src/external/bsd/tmux/dist/README
C src/external/bsd/tmux/dist/cmd-parse.c
U src/external/bsd/tmux/dist/alerts.c
U src/external/bsd/tmux/dist/arguments.c
U src/external/bsd/tmux/dist/attributes.c
U src/external/bsd/tmux/dist/cfg.c
C src/external/bsd/tmux/dist/client.c
C src/external/bsd/tmux/dist/cmd-attach-session.c
U src/external/bsd/tmux/dist/cmd-bind-key.c
U src/external/bsd/tmux/dist/cmd-break-pane.c
C src/external/bsd/tmux/dist/cmd-capture-pane.c
U src/external/bsd/tmux/dist/cmd-choose-tree.c
U src/external/bsd/tmux/dist/cmd-command-prompt.c
U src/external/bsd/tmux/dist/cmd.c
U src/external/bsd/tmux/dist/cmd-confirm-before.c
U src/external/bsd/tmux/dist/cmd-copy-mode.c
U src/external/bsd/tmux/dist/cmd-detach-client.c
C src/external/bsd/tmux/dist/cmd-display-menu.c
C src/external/bsd/tmux/dist/cmd-display-message.c
U src/external/bsd/tmux/dist/cmd-display-panes.c
U src/external/bsd/tmux/dist/cmd-find-window.c
U src/external/bsd/tmux/dist/cmd-find.c
C src/external/bsd/tmux/dist/cmd-if-shell.c
U src/external/bsd/tmux/dist/cmd-join-pane.c
U src/external/bsd/tmux/dist/cmd-kill-pane.c
U src/external/bsd/tmux/dist/cmd-kill-server.c
U src/external/bsd/tmux/dist/cmd-kill-session.c
U src/external/bsd/tmux/dist/cmd-kill-window.c
U src/external/bsd/tmux/dist/cmd-list-buffers.c
U src/external/bsd/tmux/dist/cmd-list-clients.c
U src/external/bsd/tmux/dist/cmd-list-keys.c
U src/external/bsd/tmux/dist/cmd-list-panes.c
U src/external/bsd/tmux/dist/cmd-list-sessions.c
U src/external/bsd/tmux/dist/cmd-list-windows.c
C src/external/bsd/tmux/dist/cmd-load-buffer.c
U src/external/bsd/tmux/dist/cmd-lock-server.c
U src/external/bsd/tmux/dist/cmd-move-window.c
C src/external/bsd/tmux/dist/cmd-new-session.c
C src/external/bsd/tmux/dist/cmd-new-window.c
C src/external/bsd/tmux/dist/cmd-parse.y
C src/external/bsd/tmux/dist/cmd-paste-buffer.c
U src/external/bsd/tmux/dist/cmd-pipe-pane.c
C src/external/bsd/tmux/dist/cmd-queue.c
U src/external/bsd/tmux/dist/cmd-refresh-client.c
U src/external/bsd/tmux/dist/cmd-rename-session.c
U src/external/bsd/tmux/dist/cmd-rename-window.c
U src/external/bsd/tmux/dist/cmd-resize-pane.c
C src/external/bsd/tmux/dist/cmd-resize-window.c
U src/external/bsd/tmux/dist/cmd-respawn-pane.c
U src/external/bsd/tmux/dist/cmd-respawn-window.c
U src/external/bsd/tmux/dist/cmd-rotate-window.c
U src/external/bsd/tmux/dist/file.c
U src/external/bsd/tmux/dist/cmd-run-shell.c
U src/external/bsd/tmux/dist/cmd-save-buffer.c
U src/external/bsd/tmux/dist/cmd-select-layout.c
U src/external/bsd/tmux/dist/cmd-select-pane.c
U src/external/bsd/tmux/dist/cmd-select-window.c
C src/external/bsd/tmux/dist/cmd-send-keys.c
N src/external/bsd/tmux/dist/cmd-server-access.c
U src/external/bsd/tmux/dist/cmd-set-buffer.c
U src/external/bsd/tmux/dist/cmd-set-environment.c
U src/external/bsd/tmux/dist/cmd-set-option.c
U src/external/bsd/tmux/dist/cmd-show-environment.c
C src/external/bsd/tmux/dist/cmd-show-messages.c
C src/external/bsd/tmux/dist/cmd-show-options.c
N src/external/bsd/tmux/dist/cmd-show-prompt-history.c
U src/external/bsd/tmux/dist/cmd-source-file.c
C src/external/bsd/tmux/dist/cmd-split-window.c
U src/external/bsd/tmux/dist/cmd-swap-pane.c
U src/external/bsd/tmux/dist/cmd-swap-window.c
U src/external/bsd/tmux/dist/cmd-switch-client.c
U src/external/bsd/tmux/dist/cmd-unbind-key.c
C src/external/bsd/tmux/dist/cmd-wait-for.c
C src/external/bsd/tmux/dist/colour.c
C src/external/bsd/tmux/dist/compat.h
U src/external/bsd/tmux/dist/control-notify.c
C src/external/bsd/tmux/dist/control.c
U src/external/bsd/tmux/dist/environ.c
C src/external/bsd/tmux/dist/format.c
U src/external/bsd/tmux/dist/format-draw.c
U src/external/bsd/tmux/dist/grid-reader.c
U src/external/bsd/tmux/dist/grid-view.c
C src/external/bsd/tmux/dist/grid.c
C src/external/bsd/tmux/dist/input-keys.c
C src/external/bsd/tmux/dist/input.c
C src/external/bsd/tmux/dist/job.c
C src/external/bsd/tmux/dist/key-bindings.c
U src/external/bsd/tmux/dist/key-string.c
U src/external/bsd/tmux/dist/layout-custom.c
U src/external/bsd/tmux/dist/layout-set.c
U src/external/bsd/tmux/dist/layout.c
C src/external/bsd/tmux/dist/log.c
C src/external/bsd/tmux/dist/menu.c
U src/external/bsd/tmux/dist/names.c
C src/external/bsd/tmux/dist/mode-tree.c
C src/external/bsd/tmux/dist/notify.c
U src/external/bsd/tmux/dist/options-table.c
C src/external/bsd/tmux/dist/options.c
U src/external/bsd/tmux/dist/paste.c
U src/external/bsd/tmux/dist/popup.c
C 

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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 21:41:27 UTC 2023

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

Log Message:
tests/lint: demonstrate wrong size calculation in anonymous union


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/expr_sizeof.c

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



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 21:41:27 UTC 2023

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

Log Message:
tests/lint: demonstrate wrong size calculation in anonymous union


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/expr_sizeof.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/expr_sizeof.c
diff -u src/tests/usr.bin/xlint/lint1/expr_sizeof.c:1.5 src/tests/usr.bin/xlint/lint1/expr_sizeof.c:1.6
--- src/tests/usr.bin/xlint/lint1/expr_sizeof.c:1.5	Tue Mar 28 14:44:34 2023
+++ src/tests/usr.bin/xlint/lint1/expr_sizeof.c	Wed Jun 28 21:41:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: expr_sizeof.c,v 1.5 2023/03/28 14:44:34 rillig Exp $	*/
+/*	$NetBSD: expr_sizeof.c,v 1.6 2023/06/28 21:41:27 rillig Exp $	*/
 # 3 "expr_sizeof.c"
 
 /*
@@ -73,3 +73,30 @@ variable_length_array(int n)
 	/* expect+1: error: negative array dimension (-4) [20] */
 	typedef int sizeof_local_arr[-(int)sizeof(local_arr)];
 }
+
+/*
+ * Ensure that anonymous structs and unions are handled correctly.  They were
+ * added in C11, and lint did not properly support them until 2023.
+ */
+void
+anonymous_struct_and_union(void)
+{
+	struct {
+		union {
+			unsigned char uc16[16];
+			unsigned char uc32[32];
+		};
+	} su_16_32;
+	/* FIXME: Must be 32, not 48. */
+	/* expect+1: error: negative array dimension (-48) [20] */
+	typedef int sizeof_su_16_32[-(int)sizeof(su_16_32)];
+
+	union {
+		struct {
+			unsigned char uc16[16];
+			unsigned char uc32[32];
+		};
+	} us_16_32;
+	/* expect+1: error: negative array dimension (-48) [20] */
+	typedef int sizeof_us_16_32[-(int)sizeof(us_16_32)];
+}



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 20:51:31 UTC 2023

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

Log Message:
tests/lint: do not overwrite expected files that only differ in spaces


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/accept.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/accept.sh
diff -u src/tests/usr.bin/xlint/lint1/accept.sh:1.11 src/tests/usr.bin/xlint/lint1/accept.sh:1.12
--- src/tests/usr.bin/xlint/lint1/accept.sh:1.11	Sun Jun 19 11:50:42 2022
+++ src/tests/usr.bin/xlint/lint1/accept.sh	Wed Jun 28 20:51:31 2023
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: accept.sh,v 1.11 2022/06/19 11:50:42 rillig Exp $
+# $NetBSD: accept.sh,v 1.12 2023/06/28 20:51:31 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -43,6 +43,7 @@ for pattern in "$@"; do
 	for cfile in *$pattern*.c; do
 		base=${cfile%.*}
 		expfile="$base.exp"
+		ln_tmp_file="$base.exp-ln.tmp"
 		ln_file="$base.exp-ln"
 
 		configure_test_case "$cfile"
@@ -57,7 +58,7 @@ for pattern in "$@"; do
 
 		# shellcheck disable=SC2154
 		# shellcheck disable=SC2086
-		if "$lint1" $flags "$base.c" "$ln_file" > "$expfile"; then
+		if "$lint1" $flags "$base.c" "$ln_tmp_file" > "$expfile"; then
 			if [ -s "$expfile" ]; then
 echo "$base produces output but exits successfully"
 sed 's,^,| ,' "$expfile"
@@ -67,6 +68,22 @@ for pattern in "$@"; do
 			continue
 		fi
 
+		if [ ! -f "$ln_tmp_file" ]; then
+			: 'No cleanup necessary.'
+		elif [ "$ln_file" = '/dev/null' ]; then
+			rm "$ln_tmp_file"
+		else
+			if tr -d ' \t' < "$ln_file" > "$ln_file.trimmed.tmp" &&
+			tr -d ' \t' < "$ln_tmp_file" > "$ln_tmp_file.trimmed.tmp" &&
+			cmp -s "$ln_file.trimmed.tmp" "$ln_tmp_file.trimmed.tmp"; then
+rm "$ln_tmp_file"
+			else
+echo "Replacing $ln_file"
+mv "$ln_tmp_file" "$ln_file"
+			fi
+			rm -f "$ln_file.trimmed.tmp" "$ln_tmp_file.trimmed.tmp"
+		fi
+
 		case "$base" in (msg_*)
 			if grep 'This message is not used\.' "$cfile" >/dev/null; then
 : 'Skip further checks.'



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 20:51:31 UTC 2023

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

Log Message:
tests/lint: do not overwrite expected files that only differ in spaces


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/accept.sh

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



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 17:53:21 UTC 2023

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

Log Message:
tests/lint: fix preprocessor line number validation

When running the tests via ATF, the filename was an absolute filename,
while the preprocessing line in the test file uses a relative filename.
These two didn't match.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_351.c

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



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 17:53:21 UTC 2023

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

Log Message:
tests/lint: fix preprocessor line number validation

When running the tests via ATF, the filename was an absolute filename,
while the preprocessing line in the test file uses a relative filename.
These two didn't match.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_351.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/check-expect.lua
diff -u src/tests/usr.bin/xlint/lint1/check-expect.lua:1.2 src/tests/usr.bin/xlint/lint1/check-expect.lua:1.3
--- src/tests/usr.bin/xlint/lint1/check-expect.lua:1.2	Sun Jun 19 11:50:42 2022
+++ src/tests/usr.bin/xlint/lint1/check-expect.lua	Wed Jun 28 17:53:21 2023
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.2 2022/06/19 11:50:42 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.3 2023/06/28 17:53:21 rillig Exp $
 
 --[[
 
@@ -58,7 +58,7 @@ end
 --   },
 --   { "file.c(18)", "file.c(23)" }
 local function load_c(fname)
-
+  local basename = fname:match("([^/]+)$") or fname
   local lines = load_lines(fname)
   if lines == nil then return nil, nil end
 
@@ -87,7 +87,7 @@ local function load_c(fname)
 
 local ppl_lineno, ppl_fname = line:match("^#%s*(%d+)%s+\"([^\"]+)\"")
 if ppl_lineno ~= nil then
-  if ppl_fname == fname and tonumber(ppl_lineno) ~= phys_lineno + 1 then
+  if ppl_fname == basename and tonumber(ppl_lineno) ~= phys_lineno + 1 then
 print_error("error: %s:%d: preprocessor line number must be %d",
   fname, phys_lineno, phys_lineno + 1)
   end

Index: src/tests/usr.bin/xlint/lint1/msg_351.c
diff -u src/tests/usr.bin/xlint/lint1/msg_351.c:1.4 src/tests/usr.bin/xlint/lint1/msg_351.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_351.c:1.4	Tue Apr 25 19:00:57 2023
+++ src/tests/usr.bin/xlint/lint1/msg_351.c	Wed Jun 28 17:53:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_351.c,v 1.4 2023/04/25 19:00:57 rillig Exp $	*/
+/*	$NetBSD: msg_351.c,v 1.5 2023/06/28 17:53:21 rillig Exp $	*/
 # 3 "msg_351.c"
 
 // Test for message 351: missing%s header declaration for '%s' [351]
@@ -39,7 +39,7 @@ static int static_func_def(void);
 int extern_func_decl(void);
 extern int extern_func_decl_verbose(void);
 
-# 29 "msg_351.c" 2
+# 43 "msg_351.c" 2
 /* expect+1: warning: static variable 'static_def' unused [226] */
 static int static_def;
 int external_def;



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 15:04:07 UTC 2023

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

Log Message:
tests/lint: demonstrate wrong handling of nested initializer

Seen in external/bsd/jemalloc/dist/src/jemalloc.c, init_lock.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/init_braces.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/init_braces.c
diff -u src/tests/usr.bin/xlint/lint1/init_braces.c:1.2 src/tests/usr.bin/xlint/lint1/init_braces.c:1.3
--- src/tests/usr.bin/xlint/lint1/init_braces.c:1.2	Wed Jun 22 19:23:18 2022
+++ src/tests/usr.bin/xlint/lint1/init_braces.c	Wed Jun 28 15:04:07 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_braces.c,v 1.2 2022/06/22 19:23:18 rillig Exp $	*/
+/*	$NetBSD: init_braces.c,v 1.3 2023/06/28 15:04:07 rillig Exp $	*/
 # 3 "init_braces.c"
 
 /*
@@ -12,8 +12,8 @@
 void
 init_int(void)
 {
-	/* gcc-expect+2: error: invalid initializer */
-	/* clang-expect+1: error: array initializer must be an initializer list */
+	/* gcc-expect+4: error: invalid initializer */
+	/* clang-expect+3: error: array initializer must be an initializer list */
 	/* expect+2: error: {}-enclosed initializer required [181] */
 	/* expect+1: error: empty array declaration for 'num0' [190] */
 	int num0[] = 0;
@@ -61,3 +61,39 @@ init_string(void)
 	/* expect+1: warning: illegal combination of integer 'char' and pointer 'pointer to char' [183] */
 	char name4[] =  "" ;
 }
+
+unsigned long
+init_nested_struct_and_union(void)
+{
+	struct time {
+		unsigned long ns;
+	};
+
+	struct times {
+		struct time t0;
+		struct time t1;
+	};
+
+	struct outer {
+		union {
+			struct {
+struct times times;
+			};
+		};
+	};
+
+	struct outer var = {	/* struct outer */
+		{		/* unnamed union */
+			{	/* unnamed struct */
+/* FIXME: GCC and Clang both compile this initializer. */
+/* expect+1: error: type 'struct time' does not have member 'times' [101] */
+.times = {
+	.t0 = { .ns = 0, },
+	.t1 = { .ns = 0, },
+},
+			},
+		},
+	};
+
+	return var.times.t0.ns;
+}



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 15:04:07 UTC 2023

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

Log Message:
tests/lint: demonstrate wrong handling of nested initializer

Seen in external/bsd/jemalloc/dist/src/jemalloc.c, init_lock.


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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 13:50:47 UTC 2023

Modified Files:
src/usr.bin/xlint/xlint: lint.1 xlint.c

Log Message:
lint: allow to keep the preprocessor output on success as well


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/xlint/lint.1
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/xlint/xlint/xlint.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/xlint

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 13:50:47 UTC 2023

Modified Files:
src/usr.bin/xlint/xlint: lint.1 xlint.c

Log Message:
lint: allow to keep the preprocessor output on success as well


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/xlint/xlint/lint.1
cvs rdiff -u -r1.111 -r1.112 src/usr.bin/xlint/xlint/xlint.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/xlint/lint.1
diff -u src/usr.bin/xlint/xlint/lint.1:1.58 src/usr.bin/xlint/xlint/lint.1:1.59
--- src/usr.bin/xlint/xlint/lint.1:1.58	Mon May 22 19:36:13 2023
+++ src/usr.bin/xlint/xlint/lint.1	Wed Jun 28 13:50:47 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: lint.1,v 1.58 2023/05/22 19:36:13 rillig Exp $
+.\" $NetBSD: lint.1,v 1.59 2023/06/28 13:50:47 rillig Exp $
 .\"
 .\" Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
 .\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -30,7 +30,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 22, 2023
+.Dd June 28, 2023
 .Dt LINT 1
 .Os
 .Sh NAME
@@ -594,8 +594,12 @@ option must exist.
 If this environment variable is undefined, then the default path
 .Pa /usr/libdata/lint
 will be used to search for the libraries.
-.It Ev LINT_KEEP_CPPOUT_ON_ERROR
-If
+.It Ev LINT_KEEP_CPPOUT
+If set to
+.Sq Li yes ,
+or if set to
+.Sq Li on-error
+and
 .Nm
 exits unsuccessfully, do no delete the output from the C preprocessor,
 allowing for manual inspection.

Index: src/usr.bin/xlint/xlint/xlint.c
diff -u src/usr.bin/xlint/xlint/xlint.c:1.111 src/usr.bin/xlint/xlint/xlint.c:1.112
--- src/usr.bin/xlint/xlint/xlint.c:1.111	Fri Jun  9 13:31:11 2023
+++ src/usr.bin/xlint/xlint/xlint.c	Wed Jun 28 13:50:47 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: xlint.c,v 1.111 2023/06/09 13:31:11 rillig Exp $ */
+/* $NetBSD: xlint.c,v 1.112 2023/06/28 13:50:47 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: xlint.c,v 1.111 2023/06/09 13:31:11 rillig Exp $");
+__RCSID("$NetBSD: xlint.c,v 1.112 2023/06/28 13:50:47 rillig Exp $");
 #endif
 
 #include 
@@ -211,7 +211,10 @@ terminate(int signo)
 	if (cpp.outfd != -1)
 		(void)close(cpp.outfd);
 	if (cpp.outfile != NULL) {
-		if (signo != 0 && getenv("LINT_KEEP_CPPOUT_ON_ERROR") != NULL)
+		const char *keep_env = getenv("LINT_KEEP_CPPOUT");
+		bool keep = keep_env != NULL && (strcmp(keep_env, "yes") == 0
+		|| (strcmp(keep_env, "on-error") == 0 && signo != 0));
+		if (keep)
 			(void)printf("lint: preprocessor output kept in %s\n",
 			cpp.outfile);
 		else



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 11:08:47 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
following a hunch...
- cache DEC and FG registers, only write them if the value actually changes
- wait for the engine to go idle before writing DEC
- wait for FIFO slots on everything else
with this we avoid waiting if possible and still avoid overlapping blit and
fill commands


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sbus/mgx.c

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

Modified files:

Index: src/sys/dev/sbus/mgx.c
diff -u src/sys/dev/sbus/mgx.c:1.22 src/sys/dev/sbus/mgx.c:1.23
--- src/sys/dev/sbus/mgx.c:1.22	Wed Jun 28 08:53:43 2023
+++ src/sys/dev/sbus/mgx.c	Wed Jun 28 11:08:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mgx.c,v 1.22 2023/06/28 08:53:43 macallan Exp $ */
+/*	$NetBSD: mgx.c,v 1.23 2023/06/28 11:08:47 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -29,7 +29,7 @@
 /* a console driver for the SSB 4096V-MGX graphics card */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.22 2023/06/28 08:53:43 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.23 2023/06/28 11:08:47 macallan Exp $");
 
 #include 
 #include 
@@ -80,7 +80,7 @@ struct mgx_softc {
 	int		sc_fbsize;
 	int		sc_mode;
 	char		sc_name[8];
-	uint32_t	sc_dec;
+	uint32_t	sc_dec, sc_r_dec, sc_r_fg;
 	u_char		sc_cmap_red[256];
 	u_char		sc_cmap_green[256];
 	u_char		sc_cmap_blue[256];
@@ -216,6 +216,24 @@ mgx_write_4(struct mgx_softc *sc, uint32
 	bus_space_write_4(sc->sc_tag, sc->sc_blith, reg, val);
 }
 
+static inline void
+mgx_set_dec(struct mgx_softc *sc, uint32_t dec)
+{
+	if (dec == sc->sc_r_dec) return;
+	sc->sc_r_dec = dec;
+	mgx_wait_engine(sc);
+	mgx_write_4(sc, ATR_DEC, dec);
+}
+
+static inline void
+mgx_set_fg(struct mgx_softc *sc, uint32_t fg)
+{
+	if (fg == sc->sc_r_fg) return;
+	sc->sc_r_fg = fg;
+	mgx_wait_fifo(sc, 1);	
+	mgx_write_4(sc, ATR_FG, fg);
+}
+
 static int
 mgx_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -531,6 +549,8 @@ mgx_setup(struct mgx_softc *sc, int dept
 	int i;
 	uint8_t reg;
 
+	sc->sc_r_dec = 0x;
+	sc->sc_r_fg = 0x12345678;
 	/* wait for everything to go idle */
 	if (mgx_wait_engine(sc) == 0)
 		return;
@@ -643,9 +663,9 @@ mgx_bitblt(void *cookie, int xs, int ys,
 		yd += he - 1;
 		dec |= DEC_DIR_Y_REVERSE;
 	}
-	mgx_wait_fifo(sc, 5);
+	mgx_set_dec(sc, dec);
+	mgx_wait_fifo(sc, 4);
 	mgx_write_1(sc, ATR_ROP, rop);
-	mgx_write_4(sc, ATR_DEC, dec);
 	mgx_write_4(sc, ATR_SRC_XY, (ys << 16) | xs);
 	mgx_write_4(sc, ATR_DST_XY, (yd << 16) | xd);
 	mgx_write_4(sc, ATR_WH, (he << 16) | wi);
@@ -666,11 +686,10 @@ mgx_rectfill(void *cookie, int x, int y,
 	dec = sc->sc_dec;
 	dec |= (DEC_COMMAND_RECT << DEC_COMMAND_SHIFT) |
 	   (DEC_START_DIMX << DEC_START_SHIFT);
-	//mgx_wait_fifo(sc, 5);
-	mgx_wait_engine(sc);
+	mgx_set_dec(sc, dec);
+	mgx_set_fg(sc, col);
+	mgx_wait_fifo(sc, 3);
 	mgx_write_1(sc, ATR_ROP, ROP_SRC);
-	mgx_write_4(sc, ATR_FG, col);
-	mgx_write_4(sc, ATR_DEC, dec);
 	mgx_write_4(sc, ATR_DST_XY, (y << 16) | x);
 	mgx_write_4(sc, ATR_WH, (he << 16) | wi);
 }
@@ -754,8 +773,8 @@ mgx_putchar_mono(void *cookie, int row, 
 		return;
 	}
 
-	mgx_wait_fifo(sc, 3);
-	mgx_write_4(sc, ATR_FG, ri->ri_devcmap[fg]);
+	mgx_set_fg(sc, ri->ri_devcmap[fg]);
+	mgx_wait_fifo(sc, 2);
 	mgx_write_4(sc, ATR_BG, ri->ri_devcmap[bg]);
 	mgx_write_1(sc, ATR_ROP, ROP_SRC);
 
@@ -790,10 +809,10 @@ mgx_putchar_mono(void *cookie, int row, 
 		for (i = 0; i < ri->ri_fontscale; i++)
 			d[i] = s[i];
 	}
-	mgx_wait_fifo(sc, 5);
-	mgx_write_4(sc, ATR_DEC, sc->sc_dec | (DEC_COMMAND_BLT << DEC_COMMAND_SHIFT) |
+	mgx_set_dec(sc, sc->sc_dec | (DEC_COMMAND_BLT << DEC_COMMAND_SHIFT) |
 	   (DEC_START_DIMX << DEC_START_SHIFT) |
 	   DEC_SRC_LINEAR | DEC_SRC_CONTIGUOUS | DEC_MONOCHROME);
+	mgx_wait_fifo(sc, 3);
 	mgx_write_4(sc, ATR_SRC_XY, ((scratch & 0xfff000) << 4) | (scratch & 0xfff));
 	mgx_write_4(sc, ATR_DST_XY, (y << 16) | x);
 	mgx_write_4(sc, ATR_WH, (he << 16) | wi);



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 11:08:47 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
following a hunch...
- cache DEC and FG registers, only write them if the value actually changes
- wait for the engine to go idle before writing DEC
- wait for FIFO slots on everything else
with this we avoid waiting if possible and still avoid overlapping blit and
fill commands


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/sbus/mgx.c

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



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 09:35:43 UTC 2023

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

Log Message:
tests/lint: use standard form of ATF tests, test removing output file


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/t_usage.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/xlint/t_xlint.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_usage.sh
diff -u src/tests/usr.bin/xlint/lint1/t_usage.sh:1.7 src/tests/usr.bin/xlint/lint1/t_usage.sh:1.8
--- src/tests/usr.bin/xlint/lint1/t_usage.sh:1.7	Sat Jun 24 08:11:12 2023
+++ src/tests/usr.bin/xlint/lint1/t_usage.sh	Wed Jun 28 09:35:42 2023
@@ -1,4 +1,4 @@
-# $NetBSD: t_usage.sh,v 1.7 2023/06/24 08:11:12 rillig Exp $
+# $NetBSD: t_usage.sh,v 1.8 2023/06/28 09:35:42 rillig Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,11 +28,7 @@
 : "${lint1:=/usr/libexec/lint1}"
 
 
-suppress_messages_head()
-{
-	:
-}
-
+atf_test_case 'suppress_messages'
 suppress_messages_body()
 {
 	printf 'typedef int dummy;\n' > code.c
@@ -80,11 +76,7 @@ suppress_messages_body()
 	"$lint1" -X '1,,,' code.c /dev/null
 }
 
-enable_queries_head()
-{
-	:
-}
-
+atf_test_case 'enable_queries'
 enable_queries_body()
 {
 	printf 'typedef int dummy;\n' > code.c

Index: src/tests/usr.bin/xlint/xlint/t_xlint.sh
diff -u src/tests/usr.bin/xlint/xlint/t_xlint.sh:1.1 src/tests/usr.bin/xlint/xlint/t_xlint.sh:1.2
--- src/tests/usr.bin/xlint/xlint/t_xlint.sh:1.1	Sun Jan 15 23:18:05 2023
+++ src/tests/usr.bin/xlint/xlint/t_xlint.sh	Wed Jun 28 09:35:43 2023
@@ -1,4 +1,4 @@
-# $NetBSD: t_xlint.sh,v 1.1 2023/01/15 23:18:05 rillig Exp $
+# $NetBSD: t_xlint.sh,v 1.2 2023/06/28 09:35:43 rillig Exp $
 #
 # Copyright (c) 2023 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -25,13 +25,9 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-: ${lint:='/usr/bin/lint'}
-
-run_lint1_error_head()
-{
-	:
-}
+: "${lint:=/usr/bin/lint}"
 
+atf_test_case 'run_lint1_error'
 run_lint1_error_body()
 {
 	cat <<-EOF >input.c || atf_fail 'prepare input.c'
@@ -43,24 +39,22 @@ run_lint1_error_body()
 			return 1;
 		}
 	EOF
+	echo 'previous content' > input.ln
 
 	atf_check \
 	-s 'exit:1' \
 	-o "inline:input.c(6): error: function has return type '_Bool' but returns 'int' [211]\n" \
 	"$lint" -aabceghiprSTxz input.c
 
-	# In case of an error, no output file is written.
+	# In case of an error, any previous output file is overwritten, and the
+	# (possibly unfinished) output file is removed.
 	atf_check \
 	-s 'exit:1' \
 	test -f input.ln
 }
 
 
-run_lint1_warning_head()
-{
-	:
-}
-
+atf_test_case 'run_lint1_warning'
 run_lint1_warning_body()
 {
 	cat <<-EOF >input.c || atf_fail 'prepare input.c'
@@ -88,11 +82,8 @@ run_lint1_warning_body()
 	cat input.ln
 }
 
-run_lint2_head()
-{
-	:
-}
 
+atf_test_case 'run_lint2'
 run_lint2_body()
 {
 	cat <<-EOF >input.ln || atf_fail 'prepare input.ln'



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

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 09:35:43 UTC 2023

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

Log Message:
tests/lint: use standard form of ATF tests, test removing output file


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/t_usage.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/xlint/t_xlint.sh

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



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 08:53:43 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
wait for the engine to go idle before issuing rectfill commands
we get occasional overlap with blit commands if we just wait for fifo slots
needs further investigation, it is possible that not all writes to drawing
engine registers are pipelined and of course we don't have docs


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/sbus/mgx.c

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

Modified files:

Index: src/sys/dev/sbus/mgx.c
diff -u src/sys/dev/sbus/mgx.c:1.21 src/sys/dev/sbus/mgx.c:1.22
--- src/sys/dev/sbus/mgx.c:1.21	Wed Jun 28 08:11:52 2023
+++ src/sys/dev/sbus/mgx.c	Wed Jun 28 08:53:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mgx.c,v 1.21 2023/06/28 08:11:52 macallan Exp $ */
+/*	$NetBSD: mgx.c,v 1.22 2023/06/28 08:53:43 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -29,7 +29,7 @@
 /* a console driver for the SSB 4096V-MGX graphics card */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.21 2023/06/28 08:11:52 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.22 2023/06/28 08:53:43 macallan Exp $");
 
 #include 
 #include 
@@ -666,7 +666,8 @@ mgx_rectfill(void *cookie, int x, int y,
 	dec = sc->sc_dec;
 	dec |= (DEC_COMMAND_RECT << DEC_COMMAND_SHIFT) |
 	   (DEC_START_DIMX << DEC_START_SHIFT);
-	mgx_wait_fifo(sc, 5);
+	//mgx_wait_fifo(sc, 5);
+	mgx_wait_engine(sc);
 	mgx_write_1(sc, ATR_ROP, ROP_SRC);
 	mgx_write_4(sc, ATR_FG, col);
 	mgx_write_4(sc, ATR_DEC, dec);



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 08:53:43 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
wait for the engine to go idle before issuing rectfill commands
we get occasional overlap with blit commands if we just wait for fifo slots
needs further investigation, it is possible that not all writes to drawing
engine registers are pipelined and of course we don't have docs


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/sbus/mgx.c

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



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 08:11:52 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
fix tpyo - now the glyph cache can actually work...


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sbus/mgx.c

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

Modified files:

Index: src/sys/dev/sbus/mgx.c
diff -u src/sys/dev/sbus/mgx.c:1.20 src/sys/dev/sbus/mgx.c:1.21
--- src/sys/dev/sbus/mgx.c:1.20	Thu Nov 11 19:37:30 2021
+++ src/sys/dev/sbus/mgx.c	Wed Jun 28 08:11:52 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: mgx.c,v 1.20 2021/11/11 19:37:30 macallan Exp $ */
+/*	$NetBSD: mgx.c,v 1.21 2023/06/28 08:11:52 macallan Exp $ */
 
 /*-
  * Copyright (c) 2014 Michael Lorenz
@@ -29,7 +29,7 @@
 /* a console driver for the SSB 4096V-MGX graphics card */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.20 2021/11/11 19:37:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mgx.c,v 1.21 2023/06/28 08:11:52 macallan Exp $");
 
 #include 
 #include 
@@ -342,7 +342,7 @@ mgx_attach(device_t parent, device_t sel
 	 * leave some room between visible screen and glyph cache for upload
 	 * buffers used by putchar_mono()
 	 */
-	bsize = (32 * 1024 * sc->sc_stride - 1) / sc->sc_stride;
+	bsize = (32 * 1024 + sc->sc_stride - 1) / sc->sc_stride;
 	glyphcache_init(>sc_gc,
 	sc->sc_height + bsize,
 	(0x40 / sc->sc_stride) - (sc->sc_height + bsize),



CVS commit: src/sys/dev/sbus

2023-06-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Jun 28 08:11:52 UTC 2023

Modified Files:
src/sys/dev/sbus: mgx.c

Log Message:
fix tpyo - now the glyph cache can actually work...


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/sbus/mgx.c

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



CVS commit: src/usr.bin/make/unit-tests

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 06:15:42 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.exp cond-func-empty.mk

Log Message:
tests/make: extend test for the 'empty' function in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/cond-func-empty.exp
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/make/unit-tests/cond-func-empty.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/cond-func-empty.exp
diff -u src/usr.bin/make/unit-tests/cond-func-empty.exp:1.6 src/usr.bin/make/unit-tests/cond-func-empty.exp:1.7
--- src/usr.bin/make/unit-tests/cond-func-empty.exp:1.6	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/cond-func-empty.exp	Wed Jun 28 06:15:42 2023
@@ -1,5 +1,5 @@
-make: "cond-func-empty.mk" line 154: Unclosed variable "WORD"
-make: "cond-func-empty.mk" line 154: Malformed conditional (empty(WORD)
+make: "cond-func-empty.mk" line 168: Unclosed variable "WORD"
+make: "cond-func-empty.mk" line 168: Malformed conditional (empty(WORD)
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-func-empty.mk
diff -u src/usr.bin/make/unit-tests/cond-func-empty.mk:1.20 src/usr.bin/make/unit-tests/cond-func-empty.mk:1.21
--- src/usr.bin/make/unit-tests/cond-func-empty.mk:1.20	Thu Jun  1 20:56:35 2023
+++ src/usr.bin/make/unit-tests/cond-func-empty.mk	Wed Jun 28 06:15:42 2023
@@ -1,18 +1,19 @@
-# $NetBSD: cond-func-empty.mk,v 1.20 2023/06/01 20:56:35 rillig Exp $
+# $NetBSD: cond-func-empty.mk,v 1.21 2023/06/28 06:15:42 rillig Exp $
 #
 # Tests for the empty() function in .if conditions, which tests a variable
 # expression for emptiness.
 #
 # Note that the argument in the parentheses is a variable name, not a variable
-# expression, optionally followed by variable modifiers.
+# expression.  That name may be followed by ':...' modifiers.
 #
 
 .undef UNDEF
 EMPTY=	# empty
 SPACE=	${:U }
+ZERO=	0
 WORD=	word
 
-# An undefined variable is empty.
+# An undefined variable counts as empty.
 .if !empty(UNDEF)
 .  error
 .endif
@@ -78,6 +79,17 @@ WORD=	word
 .  error
 .endif
 
+# The variable ZERO has the numeric value 0, but is not empty.  This is a
+# subtle difference between using either 'empty(ZERO)' or the expression
+# '${ZERO}' in a condition.
+.if empty(ZERO)
+.  error
+.elif ${ZERO}
+.  error
+.elif ${ZERO} == ""
+.  error
+.endif
+
 # The following example constructs an expression with the variable name ""
 # and the value " ".  This expression counts as empty since the value contains
 # only whitespace.
@@ -101,7 +113,9 @@ ${:U }=	space
 .  error
 .endif
 
-# The value of the following expression is " word", which is not empty.
+# The value of the following expression is " word", which is not empty.  To be
+# empty, _all_ characters in the expression value have to be whitespace, not
+# only the first.
 .if empty(:U word)
 .  error
 .endif
@@ -128,15 +142,15 @@ ${:U }=	space
 # argument are properly parsed.  Typical use cases for this are .for loops,
 # which are expanded to exactly these ${:U} expressions.
 #
-# If everything goes well, the argument expands to "WORD", and that variable
-# is defined at the beginning of this file.  The surrounding 'W' and 'D'
-# ensure that CondParser_FuncCallEmpty keeps track of the parsing position,
-# both before and after the call to Var_Parse.
+# The argument expands to "WORD", and that variable is defined at the
+# beginning of this file.  The surrounding 'W' and 'D' ensure that
+# CondParser_FuncCallEmpty keeps track of the parsing position, both before
+# and after the call to Var_Parse.
 .if empty(W${:UOR}D)
 .  error
 .endif
 
-# There may be spaces at the outside of the parentheses.
+# There may be spaces at the outside the parentheses.
 # Spaces inside the parentheses are interpreted as part of the variable name.
 .if ! empty ( WORD )
 .  error
@@ -181,8 +195,8 @@ ${:U WORD }=	variable name with spaces
 # prevent it from doing any harm.
 #
 # The variable expression was expanded though, and this was wrong.  The
-# expansion was done without VARE_WANTRES (called VARF_WANTRES back
-# then) though.  This had the effect that the ${:U1} from the value of VARNAME
+# expansion was done without VARE_WANTRES (called VARF_WANTRES back then)
+# though.  This had the effect that the ${:U1} from the value of VARNAME
 # expanded to an empty string.  This in turn created the seemingly recursive
 # definition VARNAME=${VARNAME}, and that definition was never meant to be
 # expanded.



CVS commit: src/usr.bin/make/unit-tests

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 06:15:42 UTC 2023

Modified Files:
src/usr.bin/make/unit-tests: cond-func-empty.exp cond-func-empty.mk

Log Message:
tests/make: extend test for the 'empty' function in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/cond-func-empty.exp
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/make/unit-tests/cond-func-empty.mk

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



CVS commit: src/usr.bin/make

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 06:15:07 UTC 2023

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

Log Message:
make.1: clean up wording, clarify scope of '!' in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.366 src/usr.bin/make/make.1:1.367
--- src/usr.bin/make/make.1:1.366	Wed May 10 18:22:33 2023
+++ src/usr.bin/make/make.1	Wed Jun 28 06:15:07 2023
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.366 2023/05/10 18:22:33 sjg Exp $
+.\"	$NetBSD: make.1,v 1.367 2023/06/28 06:15:07 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	from: @(#)make.1	8.4 (Berkeley) 3/19/94
 .\"
-.Dd May 10, 2023
+.Dd June 28, 2023
 .Dt MAKE 1
 .Os
 .Sh NAME
@@ -2068,7 +2068,7 @@ only evaluates a conditional as far as i
 Parentheses can be used to override the operator precedence.
 The boolean operator
 .Sq Ic \&!
-may be used to logically negate an entire conditional.
+may be used to logically negate an expression, typically a function call.
 It is of higher precedence than
 .Sq Ic \&&& .
 .Pp
@@ -2118,9 +2118,9 @@ may also be an arithmetic or string comp
 Variable expansion is performed on both sides of the comparison.
 If both sides are numeric and neither is enclosed in quotes,
 the comparison is done numerically, otherwise lexicographically.
-A string is interpreted as hexadecimal integer if it is preceded by
+A string is interpreted as a hexadecimal integer if it is preceded by
 .Li 0x ,
-otherwise it is a decimal floating-point number;
+otherwise it is interpreted as a decimal floating-point number;
 octal numbers are not supported.
 .Pp
 All comparisons may use the operators
@@ -2141,7 +2141,7 @@ and its numeric value (if any) is not ze
 When
 .Nm
 is evaluating one of these conditional expressions, and it encounters
-a (whitespace separated) word it doesn't recognize, either the
+a (whitespace-separated) word it doesn't recognize, either the
 .Dq make
 or
 .Dq defined
@@ -2164,12 +2164,13 @@ function is applied.
 .Pp
 If the conditional evaluates to true,
 parsing of the makefile continues as before.
-If it evaluates to false, the following lines are skipped.
-In both cases, this continues until the corresponding
+If it evaluates to false, the following lines until the corresponding
+.Sq Ic .elif
+variant,
 .Sq Ic .else
 or
 .Sq Ic .endif
-is found.
+are skipped.
 .Ss For loops
 For loops are typically used to apply a set of rules to a list of files.
 The syntax of a for loop is:



CVS commit: src/usr.bin/make

2023-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Wed Jun 28 06:15:07 UTC 2023

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

Log Message:
make.1: clean up wording, clarify scope of '!' in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/usr.bin/make/make.1

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