Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Greg Troxel
Emmanuel Dreyfus  writes:

> On Thu, Jun 29, 2023 at 08:43:36PM -0400, Greg Troxel wrote:
>> > Primary bootstrap is now able to read a GPT inside RAIDframe.
>> did you also update documentation?
>
> We do not have any documentation specific to primary bootstrap. 
> x86/boot(8) domuent the behavior with no detail about primary
> and secondary bootstrap distinct roles.
>
> The change makes primary bootstrap behavior in line with secondary
> bootstrap and with what is already documented in x86/boot(8). Hence
> there is no documentation update, we could consider it as a bug fix, 
> since the previosu behavior did not match x86/boot(8) documentation.

Thank you for explaining.  That sounds fine then.


CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 02:03:59 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c

Log Message:
PosixDaemon.c: restore NetBSD logging additions lost in merges

Restore part of local modifications r. 1.2 & 1.4 from tsarna@. One
aspect could not be carried forward, as Apple dropped the bug detection
query functionality that was formerly represented by the teststate
member of the DNSServer struct. Otherwise, reapplied almost verbatim,
except for minor consistency and style changes.

This was added again in part as an example should there be a need to
add further logging content for NetBSD's purposes. (DumpStateLog() has
changed further as of Apple's 1790.80.10 release, but should we roll
forward, our means here should still be viable.)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.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/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.17 src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.18
--- src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.17	Fri Jun 30 01:59:45 2023
+++ src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c	Fri Jun 30 02:03:58 2023
@@ -125,11 +125,38 @@ mDNSlocal void ParseCmdLinArgs(int argc,
 }
 }
 
-mDNSlocal void DumpStateLog()
+mDNSlocal void DumpStateLog(mDNS *const m)
 // Dump a little log of what we've been up to.
 {
+DNSServer *s;
+PosixNetworkInterface *i;
+
 LogMsg(" BEGIN STATE LOG ");
 udsserver_info();
+
+LogMsgNoIdent("- Network Interfaces ---");
+for (i = (PosixNetworkInterface*)(m->HostInterfaces);
+ i; i = (PosixNetworkInterface *)(i->coreIntf.next))
+{
+LogMsg("%p %p %d %s%s%s%s%s %-8s %#a", i,
+   (void *)(i->coreIntf.InterfaceID), i->index,
+   i->coreIntf.InterfaceActive ? "-" : "D",
+   i->coreIntf.IPv4Available ? "4" : "-",
+   i->coreIntf.IPv6Available ? "6" : "-",
+   i->coreIntf.Advertise ? "A" : "-",
+   i->coreIntf.McastTxRx ? "M" : "-",
+   i->intfName, &(i->coreIntf.ip));
+}
+
+LogMsgNoIdent("- DNS Servers --");
+if (!m->DNSServers) LogMsgNoIdent("");
+else
+{
+for (s = m->DNSServers; s; s = s->next)
+LogMsgNoIdent("DNS Server %##s %#a:%d",
+  s->domain.c, >addr, mDNSVal16(s->port));
+}
+
 LogMsg("  END STATE LOG  ");
 }
 
@@ -167,7 +194,7 @@ mDNSlocal mStatus MainLoop(mDNS *m) // L
 (void) mDNSPosixRunEventLoopOnce(m, , , );
 
 if (sigismember(, SIGHUP )) Reconfigure(m);
-if (sigismember(, SIGUSR1)) DumpStateLog();
+if (sigismember(, SIGUSR1)) DumpStateLog(m);
 // SIGPIPE happens when we try to write to a dead client; death should be detected soon in request_callback() and cleaned up.
 if (sigismember(, SIGPIPE)) LogMsg("Received SIGPIPE - ignoring");
 if (sigismember(, SIGINT) || sigismember(, SIGTERM)) break;



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 02:03:59 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c

Log Message:
PosixDaemon.c: restore NetBSD logging additions lost in merges

Restore part of local modifications r. 1.2 & 1.4 from tsarna@. One
aspect could not be carried forward, as Apple dropped the bug detection
query functionality that was formerly represented by the teststate
member of the DNSServer struct. Otherwise, reapplied almost verbatim,
except for minor consistency and style changes.

This was added again in part as an example should there be a need to
add further logging content for NetBSD's purposes. (DumpStateLog() has
changed further as of Apple's 1790.80.10 release, but should we roll
forward, our means here should still be viable.)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c

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



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 01:59:45 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c

Log Message:
PosixDaemon.c: convert tabs to spaces to match coding style

Match Apple's coding style for this project. (In part for those of us
who have tabs visually representing four spaces!)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.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/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c
diff -u src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.16 src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.17
--- src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c:1.16	Mon May 29 21:16:58 2023
+++ src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c	Fri Jun 30 01:59:45 2023
@@ -128,7 +128,7 @@ mDNSlocal void ParseCmdLinArgs(int argc,
 mDNSlocal void DumpStateLog()
 // Dump a little log of what we've been up to.
 {
-	LogMsg(" BEGIN STATE LOG ");
+LogMsg(" BEGIN STATE LOG ");
 udsserver_info();
 LogMsg("  END STATE LOG  ");
 }
@@ -196,10 +196,10 @@ int main(int argc, char **argv)
 {
 const struct passwd *pw = getpwnam(MDNSD_USER);
 if (pw != NULL)
-	{
+{
 setgid(pw->pw_gid);
 setuid(pw->pw_uid);
-	}
+}
 else
 #ifdef MDNSD_NOROOT
 {



CVS commit: src/external/apache2/mDNSResponder/dist/mDNSPosix

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 01:59:45 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder/dist/mDNSPosix: PosixDaemon.c

Log Message:
PosixDaemon.c: convert tabs to spaces to match coding style

Match Apple's coding style for this project. (In part for those of us
who have tabs visually representing four spaces!)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/apache2/mDNSResponder/dist/mDNSPosix/PosixDaemon.c

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



Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
On Thu, Jun 29, 2023 at 08:43:36PM -0400, Greg Troxel wrote:
> > Primary bootstrap is now able to read a GPT inside RAIDframe.
> did you also update documentation?

We do not have any documentation specific to primary bootstrap. 
x86/boot(8) domuent the behavior with no detail about primary
and secondary bootstrap distinct roles.

The change makes primary bootstrap behavior in line with secondary
bootstrap and with what is already documented in x86/boot(8). Hence
there is no documentation update, we could consider it as a bug fix, 
since the previosu behavior did not match x86/boot(8) documentation.

-- 
Emmanuel Dreyfus
m...@netbsd.org


CVS commit: src

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 00:48:03 UTC 2023

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile

Log Message:
Add npflog.4 to sets


To generate a diff of this commit:
cvs rdiff -u -r1.1761 -r1.1762 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.731 -r1.732 src/share/man/man4/Makefile

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

Modified files:

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1761 src/distrib/sets/lists/man/mi:1.1762
--- src/distrib/sets/lists/man/mi:1.1761	Wed May 31 19:44:42 2023
+++ src/distrib/sets/lists/man/mi	Fri Jun 30 00:48:03 2023
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1761 2023/05/31 19:44:42 christos Exp $
+# $NetBSD: mi,v 1.1762 2023/06/30 00:48:03 gutteridge Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1554,6 +1554,7 @@
 ./usr/share/man/cat4/nfsmbc.0			man-sys-catman		.cat
 ./usr/share/man/cat4/njata.0			man-sys-catman		.cat
 ./usr/share/man/cat4/njs.0			man-sys-catman		.cat
+./usr/share/man/cat4/npflog.0			man-sys-catman		.cat
 ./usr/share/man/cat4/ns.0			man-obsolete		obsolete
 ./usr/share/man/cat4/nsclpcsio.0		man-sys-catman		.cat
 ./usr/share/man/cat4/nside.0			man-sys-catman		.cat
@@ -4903,6 +4904,7 @@
 ./usr/share/man/html4/nfsmbc.html		man-sys-htmlman		html
 ./usr/share/man/html4/njata.html		man-sys-htmlman		html
 ./usr/share/man/html4/njs.html			man-sys-htmlman		html
+./usr/share/man/html4/npflog.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsclpcsio.html		man-sys-htmlman		html
 ./usr/share/man/html4/nside.html		man-sys-htmlman		html
 ./usr/share/man/html4/nsmb.html			man-obsolete		obsolete
@@ -8106,6 +8108,7 @@
 ./usr/share/man/man4/nfsmbc.4			man-sys-man		.man
 ./usr/share/man/man4/njata.4			man-sys-man		.man
 ./usr/share/man/man4/njs.4			man-sys-man		.man
+./usr/share/man/man4/npflog.4			man-sys-man		.man
 ./usr/share/man/man4/ns.4			man-obsolete		obsolete
 ./usr/share/man/man4/nsclpcsio.4		man-sys-man		.man
 ./usr/share/man/man4/nside.4			man-sys-man		.man

Index: src/share/man/man4/Makefile
diff -u src/share/man/man4/Makefile:1.731 src/share/man/man4/Makefile:1.732
--- src/share/man/man4/Makefile:1.731	Thu Dec 22 11:05:54 2022
+++ src/share/man/man4/Makefile	Fri Jun 30 00:48:03 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.731 2022/12/22 11:05:54 nat Exp $
+#	$NetBSD: Makefile,v 1.732 2023/06/30 00:48:03 gutteridge Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -43,7 +43,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	mcx.4 md.4 mfb.4 mfi.4 mfii.4 mhzc.4 \
 	micphy.4 midi.4 mii.4 mk48txx.4 mlx.4 mly.4 mpls.4 mpii.4 mpt.4 \
 	mpu.4 mtd.4 mtio.4 msm6242b.4 multicast.4 mvsata.4 \
-	nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 \
+	nadb.4 ne.4 neo.4 netintro.4 nfe.4 nfsmb.4 njata.4 njs.4 npflog.4 \
 	nsclpcsio.4 nside.4 nsphy.4 nsphyter.4 ntwoc.4 null.4 \
 	nvme.4 nvmm.4 \
 	oak.4 oosiop.4 opl.4 options.4 optiide.4 osiop.4 otus.4 \



CVS commit: src

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Fri Jun 30 00:48:03 UTC 2023

Modified Files:
src/distrib/sets/lists/man: mi
src/share/man/man4: Makefile

Log Message:
Add npflog.4 to sets


To generate a diff of this commit:
cvs rdiff -u -r1.1761 -r1.1762 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.731 -r1.732 src/share/man/man4/Makefile

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



Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Greg Troxel
"Emmanuel Dreyfus"  writes:

> Log Message:
> Primary bootstrap is now able to read a GPT inside RAIDframe.

did you also update documentation?


CVS commit: src/external/apache2/mDNSResponder

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:59:43 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder: prepare-import.sh

Log Message:
prepare-import.sh: fix grammar in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/apache2/mDNSResponder/prepare-import.sh

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

Modified files:

Index: src/external/apache2/mDNSResponder/prepare-import.sh
diff -u src/external/apache2/mDNSResponder/prepare-import.sh:1.5 src/external/apache2/mDNSResponder/prepare-import.sh:1.6
--- src/external/apache2/mDNSResponder/prepare-import.sh:1.5	Sun Feb 25 20:04:55 2018
+++ src/external/apache2/mDNSResponder/prepare-import.sh	Thu Jun 29 23:59:43 2023
@@ -1,12 +1,12 @@
 #!/bin/sh
-# $NetBSD: prepare-import.sh,v 1.5 2018/02/25 20:04:55 christos Exp $
+# $NetBSD: prepare-import.sh,v 1.6 2023/06/29 23:59:43 gutteridge Exp $
 #
 # Extract the new tarball and run this script with the first argument
 # the mDNSResponder-X.Y directory that was created. cd to that directory
 # and import:
 # cvs -d cvs.netbsd.org:/cvsroot import \
 #	 src/external/apache2/mDNSResponder/dist APPLE mdnsresponder-x-y-z
-# This scripts deletes extra content.
+# This script deletes extra content.
 
 set -e
 cd "$1"



CVS commit: src/external/apache2/mDNSResponder

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:59:43 UTC 2023

Modified Files:
src/external/apache2/mDNSResponder: prepare-import.sh

Log Message:
prepare-import.sh: fix grammar in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/apache2/mDNSResponder/prepare-import.sh

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



CVS commit: src/doc

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:52:50 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
3RDPARTY: note latest version of mDNSResponder


To generate a diff of this commit:
cvs rdiff -u -r1.1935 -r1.1936 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.1935 src/doc/3RDPARTY:1.1936
--- src/doc/3RDPARTY:1.1935	Wed Jun 28 22:24:15 2023
+++ src/doc/3RDPARTY	Thu Jun 29 23:52:50 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1935 2023/06/28 22:24:15 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1936 2023/06/29 23:52:50 gutteridge Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -878,11 +878,11 @@ Uses libc's ohash
 
 Package:	mDNSResponder
 Version:	878.30.4
-Current Vers:	1096.0.2
+Current Vers:	1790.80.10
 Maintainer:	Apple
 Archive Site:	https://www.opensource.apple.com/tarballs/mDNSResponder/
 Home Page:	https://developer.apple.com/bonjour/
-Date:		2020-06-13
+Date:		2023-06-29
 Mailing List:	bonjour-...@lists.apple.com
 License:	Apache2 (mdnsd), BSD 3-clause (libdns_sd),
 		BSD 3-clause like (dns-sd)



CVS commit: src/doc

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:52:50 UTC 2023

Modified Files:
src/doc: 3RDPARTY

Log Message:
3RDPARTY: note latest version of mDNSResponder


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

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



CVS commit: src/share/man/man4

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:20:02 UTC 2023

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

Log Message:
npflog.4: add and adjust some details

Add details about the header structure (though the if_npflog.h file is
not presently installed and has a _KERNEL guard). Also adjust some
sentences (requested by riastradh@), and include the original OpenBSD
RCS ID, since much of this content shares that origin.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/npflog.4

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

Modified files:

Index: src/share/man/man4/npflog.4
diff -u src/share/man/man4/npflog.4:1.1 src/share/man/man4/npflog.4:1.2
--- src/share/man/man4/npflog.4:1.1	Tue Jun 20 01:02:46 2023
+++ src/share/man/man4/npflog.4	Thu Jun 29 23:20:02 2023
@@ -1,4 +1,5 @@
-.\" $NetBSD: npflog.4,v 1.1 2023/06/20 01:02:46 gutteridge Exp $
+.\" $NetBSD: npflog.4,v 1.2 2023/06/29 23:20:02 gutteridge Exp $
+.\" $OpenBSD: pflog.4,v 1.10 2007/05/31 19:19:51 jmc Exp $
 .\"
 .\" Copyright (c) 2001 Tobias Weingartner
 .\" All rights reserved.
@@ -29,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 June 19, 2023
+.Dd June 29, 2023
 .Dt NPFLOG 4
 .Os
 .Sh NAME
@@ -44,8 +45,7 @@ interface is a pseudo-device which makes
 the
 .Xr npf 7
 packet filter.
-Logged packets can easily be monitored in real
-time by invoking
+Logged packets can be monitored in real time by invoking
 .Xr tcpdump 8
 on the
 .Nm
@@ -61,8 +61,27 @@ further instances can be created using
 Each packet retrieved on this interface has a header associated
 that presently matches the format used by
 .Xr pf 4 .
-However, this is intentionally not exposed to userland, and is also
-possibly subject to change in future.
+This header documents the address family, interface name, rule
+number, reason, action, and direction of the packet that was logged.
+This structure looks like:
+.Bd -literal -offset indent
+struct npfloghdr {
+	uint8_t		length;
+	sa_family_t	af;
+	uint8_t		action;
+	uint8_t		reason;
+	char		ifname[IFNAMSIZ];
+	char		ruleset[NPFLOG_RULESET_NAME_SIZE];
+	uint32_t	rulenr;
+	uint32_t	subrulenr;
+	uint32_t	uid;
+	uint32_t	pid;
+	uint32_t	rule_uid;
+	uint32_t	rule_pid;
+	uint8_t		dir;
+	uint8_t		pad[3];
+};
+.Ed
 .Sh EXAMPLES
 Monitor all packets logged on the default interface:
 .Bd -literal -offset indent



CVS commit: src/share/man/man4

2023-06-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Thu Jun 29 23:20:02 UTC 2023

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

Log Message:
npflog.4: add and adjust some details

Add details about the header structure (though the if_npflog.h file is
not presently installed and has a _KERNEL guard). Also adjust some
sentences (requested by riastradh@), and include the original OpenBSD
RCS ID, since much of this content shares that origin.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/npflog.4

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-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 22:52:44 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c func.c lex.c lint1.h

Log Message:
lint: clean up member names of declaration levels

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.158 -r1.159 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.169 -r1.170 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-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 22:52:44 UTC 2023

Modified Files:
src/usr.bin/xlint/lint1: cgram.y debug.c decl.c func.c lex.c lint1.h

Log Message:
lint: clean up member names of declaration levels

No functional change outside debug mode.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.322 -r1.323 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.158 -r1.159 src/usr.bin/xlint/lint1/func.c
cvs rdiff -u -r1.161 -r1.162 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.169 -r1.170 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/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.438 src/usr.bin/xlint/lint1/cgram.y:1.439
--- src/usr.bin/xlint/lint1/cgram.y:1.438	Thu Jun 29 09:58:36 2023
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Jun 29 22:52:44 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.438 2023/06/29 09:58:36 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.439 2023/06/29 22:52:44 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.438 2023/06/29 09:58:36 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.439 2023/06/29 22:52:44 rillig Exp $");
 #endif
 
 #include 
@@ -886,12 +886,12 @@ struct_or_union_specifier:	/* C99 6.7.2.
 		$$ = make_tag_type($2, $1, false, yychar == T_SEMI);
 	  }
 	| struct_or_union identifier_sym {
-		dcs->d_tagtyp = make_tag_type($2, $1, true, false);
+		dcs->d_tag_type = make_tag_type($2, $1, true, false);
 	  } braced_struct_declaration_list {
 		$$ = complete_struct_or_union($4);
 	  }
 	| struct_or_union {
-		dcs->d_tagtyp = make_tag_type(NULL, $1, true, false);
+		dcs->d_tag_type = make_tag_type(NULL, $1, true, false);
 	  } braced_struct_declaration_list {
 		$$ = complete_struct_or_union($3);
 	  }
@@ -1038,12 +1038,12 @@ enum_specifier:			/* C99 6.7.2.2 */
 		$$ = make_tag_type($3, ENUM, false, false);
 	  }
 	| enum gcc_attribute_specifier_list_opt identifier_sym {
-		dcs->d_tagtyp = make_tag_type($3, ENUM, true, false);
+		dcs->d_tag_type = make_tag_type($3, ENUM, true, false);
 	  } enum_declaration /*gcc_attribute_specifier_list_opt*/ {
 		$$ = complete_enum($5);
 	  }
 	| enum gcc_attribute_specifier_list_opt {
-		dcs->d_tagtyp = make_tag_type(NULL, ENUM, true, false);
+		dcs->d_tag_type = make_tag_type(NULL, ENUM, true, false);
 	  } enum_declaration /*gcc_attribute_specifier_list_opt*/ {
 		$$ = complete_enum($4);
 	  }
@@ -1450,7 +1450,7 @@ abstract_decl_param_list:	/* specific to
 	  }
 	| abstract_decl_lparen vararg_parameter_type_list T_RPAREN
 	type_attribute_opt {
-		dcs->d_proto = true;
+		dcs->d_prototype = true;
 		$$ = $2;
 	  }
 	| abstract_decl_lparen error T_RPAREN type_attribute_opt {

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.36 src/usr.bin/xlint/lint1/debug.c:1.37
--- src/usr.bin/xlint/lint1/debug.c:1.36	Sat Jun 24 20:50:54 2023
+++ src/usr.bin/xlint/lint1/debug.c	Thu Jun 29 22:52:44 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.36 2023/06/24 20:50:54 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.37 2023/06/29 22:52:44 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.36 2023/06/24 20:50:54 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.37 2023/06/29 22:52:44 rillig Exp $");
 #endif
 
 #include 
@@ -422,14 +422,14 @@ debug_dinfo(const dinfo_t *d) // NOLINT(
 	debug_word(d->d_invalid_type_combination, "invalid_type_combination");
 	debug_word(d->d_nonempty_decl, "nonempty_decl");
 	debug_word(d->d_vararg, "vararg");
-	debug_word(d->d_proto, "prototype");
-	debug_word(d->d_notyp, "no_type_specifier");
+	debug_word(d->d_prototype, "prototype");
+	debug_word(d->d_no_type_specifier, "no_type_specifier");
 	debug_word(d->d_asm, "asm");
 	debug_word(d->d_packed, "packed");
 	debug_word(d->d_used, "used");
 
-	if (d->d_tagtyp != NULL)
-		debug_printf(" tagtyp='%s'", type_name(d->d_tagtyp));
+	if (d->d_tag_type != NULL)
+		debug_printf(" tag_type='%s'", type_name(d->d_tag_type));
 	for (const sym_t *arg = d->d_func_args;
 	 arg != NULL; arg = arg->s_next)
 		debug_sym(" arg(", arg, ")");

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.322 src/usr.bin/xlint/lint1/decl.c:1.323
--- src/usr.bin/xlint/lint1/decl.c:1.322	Thu Jun 29 12:52:06 2023
+++ src/usr.bin/xlint/lint1/decl.c	Thu Jun 29 22:52:44 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.322 2023/06/29 12:52:06 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.323 2023/06/29 22:52:44 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include 
 #if 

Re: CVS commit: src/doc

2023-06-29 Thread Steffen Nurpmeso
Nia Alarie wrote in
 <20230629214647.db217f...@cvs.netbsd.org>:
 |Module Name:  src
 |Committed By: nia
 |Date: Thu Jun 29 21:46:47 UTC 2023
 |
 |Modified Files:
 | src/doc: CHANGES
 |
 |Log Message:
 |ch-ch-changes

station to station

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


CVS commit: src/doc

2023-06-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 29 21:46:47 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
ch-ch-changes


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

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2976 src/doc/CHANGES:1.2977
--- src/doc/CHANGES:1.2976	Wed Jun 28 22:24:15 2023
+++ src/doc/CHANGES	Thu Jun 29 21:46:47 2023
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2976 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2977 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -133,6 +133,29 @@ Changes from NetBSD 10.0 to NetBSD 11.0:
 		Bumped shlib minor because of API/ABI changes.
 		[nikita 20230608]
 	kerberos(8): Update to Heimdal-7.8.0 [christos 20230619]
+	patch(1): Add --backup-if-mismatch and --no-backup-if-mismatch for
+		GNU patch compatibility. These options only make sense in
+		POSIX mode, patch(1) has --backup enabled by default and
+		GNU patch doesn't. [wiz 20230616]
+	indent(1): Remove support for handling ASCII backspace characters
+		in C code. [rillig 20230618]
+	make(1): Recognize include guards. [rilling 20230619]
+	pam(8): Disable pam_krb5, pam_ksu by default. [riastradh 20230620]
+	editline(3): Install pkg-config files, same as the portable version.
+		[wiz 20230620]
+	make(1): Speed up pattern matching in the ':M' and ':N' modifiers.
+		[reinoud 20230622]
+	paxctl(8): Introduce -0 option to clear all PaX flag bits in ELF note.
+		[rin 20230623]
+	crunchgen(1): Clear PaX flags instead of removing its ELF note section.
+		[rin 20230623]
+	make(1): Warn about malformed patterns in ':M', ':N' and
+		'.if make(...)'  [rillig 20230623]
 	bind: Import version 9.16.42. [christos 20230626]
 	openresolv: Import version 3.13.2 [roy 20230627]
 	tmux(1): Import version 3.3a [wiz 20230628]
+	x86: Primary bootstrap is now enable to read a GPT
+		partition table inside a software raid(4).
+		[manu 20230629]
+	aiomixer(1): Support for the NO_COLOR environment variable.
+		[nia 20230629]



CVS commit: src/doc

2023-06-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 29 21:46:47 UTC 2023

Modified Files:
src/doc: CHANGES

Log Message:
ch-ch-changes


To generate a diff of this commit:
cvs rdiff -u -r1.2976 -r1.2977 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/sys/arch/shark/shark

2023-06-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Jun 29 21:01:21 UTC 2023

Modified Files:
src/sys/arch/shark/shark: scr.c

Log Message:
s/determin /determine / in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/shark/shark/scr.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/shark/shark/scr.c
diff -u src/sys/arch/shark/shark/scr.c:1.35 src/sys/arch/shark/shark/scr.c:1.36
--- src/sys/arch/shark/shark/scr.c:1.35	Fri Apr  8 10:17:54 2022
+++ src/sys/arch/shark/shark/scr.c	Thu Jun 29 21:01:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: scr.c,v 1.35 2022/04/08 10:17:54 andvar Exp $	*/
+/*	$NetBSD: scr.c,v 1.36 2023/06/29 21:01:21 andvar Exp $	*/
 
 /*
  * Copyright 1997
@@ -102,7 +102,7 @@
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scr.c,v 1.35 2022/04/08 10:17:54 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scr.c,v 1.36 2023/06/29 21:01:21 andvar Exp $");
 
 #include "opt_ddb.h"
 
@@ -2298,7 +2298,7 @@ static void   coldResetSM(struct scr_sof
 **  checked to see if it is 1/2 speed, and if so, the clock is changed
 **  and the state adjustes
 **
-**  At the end of the first byte we have to determin the logic being
+**  At the end of the first byte we have to determine the logic being
 **  used by the card, ie is it active high/low and msb/lsb.  
 **
 **



CVS commit: src/sys/arch/shark/shark

2023-06-29 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Thu Jun 29 21:01:21 UTC 2023

Modified Files:
src/sys/arch/shark/shark: scr.c

Log Message:
s/determin /determine / in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/shark/shark/scr.c

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



CVS commit: src/usr.bin/aiomixer

2023-06-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 29 19:06:54 UTC 2023

Modified Files:
src/usr.bin/aiomixer: aiomixer.1 app.h draw.c main.c

Log Message:
aiomixer(1): Support the informal NO_COLOR standard.

When the NO_COLOR environment variable is set, no ANSI colours will
be displayed.

https://no-color.org/


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/aiomixer/aiomixer.1 \
src/usr.bin/aiomixer/app.h
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/aiomixer/draw.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/aiomixer/main.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/aiomixer/aiomixer.1
diff -u src/usr.bin/aiomixer/aiomixer.1:1.1 src/usr.bin/aiomixer/aiomixer.1:1.2
--- src/usr.bin/aiomixer/aiomixer.1:1.1	Fri May  7 16:29:24 2021
+++ src/usr.bin/aiomixer/aiomixer.1	Thu Jun 29 19:06:54 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: aiomixer.1,v 1.1 2021/05/07 16:29:24 nia Exp $
+.\" $NetBSD: aiomixer.1,v 1.2 2023/06/29 19:06:54 nia Exp $
 .\"
 .\" Copyright (c) 2021 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 4, 2019
+.Dd July 29, 2023
 .Dt AIOMIXER 1
 .Os
 .Sh NAME
@@ -67,6 +67,11 @@ Used to specify an alternative mixer dev
 .It Fl u
 Used to unlock channels on start up.
 .El
+.Pp
+.Nm
+honours the informal standard
+.Dv NO_COLOR .
+When it is set in the environment, no colour will be used.
 .Sh FILES
 .Bl -tag -width /dev/mixer[0-3] -compact
 .It Pa /dev/mixer
@@ -81,7 +86,7 @@ The first version (only available in pkg
 properly, among other bugs.
 .Sh AUTHORS
 .Nm
-was written by 
+was written by
 .An Nia Alarie
 .Aq n...@netbsd.org .
 .Sh BUGS
Index: src/usr.bin/aiomixer/app.h
diff -u src/usr.bin/aiomixer/app.h:1.1 src/usr.bin/aiomixer/app.h:1.2
--- src/usr.bin/aiomixer/app.h:1.1	Fri May  7 16:29:24 2021
+++ src/usr.bin/aiomixer/app.h	Thu Jun 29 19:06:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: app.h,v 1.1 2021/05/07 16:29:24 nia Exp $ */
+/* $NetBSD: app.h,v 1.2 2023/06/29 19:06:54 nia Exp $ */
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -70,6 +70,7 @@ struct aiomixer {
 	bool widgets_resized;
 	WINDOW *header;
 	WINDOW *classbar;
+	bool use_colour;
 };
 
 #define COLOR_CONTROL_SELECTED	1

Index: src/usr.bin/aiomixer/draw.c
diff -u src/usr.bin/aiomixer/draw.c:1.9 src/usr.bin/aiomixer/draw.c:1.10
--- src/usr.bin/aiomixer/draw.c:1.9	Thu Jul 15 07:03:14 2021
+++ src/usr.bin/aiomixer/draw.c	Thu Jun 29 19:06:54 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: draw.c,v 1.9 2021/07/15 07:03:14 nia Exp $ */
+/* $NetBSD: draw.c,v 1.10 2023/06/29 19:06:54 nia Exp $ */
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -37,10 +37,10 @@
 #include "draw.h"
 
 static int get_enum_color(const char *);
-static void draw_enum(struct aiomixer_control *, int, bool);
-static void draw_set(struct aiomixer_control *, int);
+static void draw_enum(struct aiomixer_control *, int, bool, bool);
+static void draw_set(struct aiomixer_control *, int, bool);
 static void draw_levels(struct aiomixer_control *,
-const struct mixer_level *, bool, bool);
+const struct mixer_level *, bool, bool, bool);
 
 void
 draw_mixer_select(unsigned int num_mixers, unsigned int selected_mixer)
@@ -103,14 +103,14 @@ draw_control(struct aiomixer *aio,
 
 	switch (value.type) {
 	case AUDIO_MIXER_ENUM:
-		draw_enum(control, value.un.ord, selected);
+		draw_enum(control, value.un.ord, selected, aio->use_colour);
 		break;
 	case AUDIO_MIXER_SET:
-		draw_set(control, value.un.mask);
+		draw_set(control, value.un.mask, aio->use_colour);
 		break;
 	case AUDIO_MIXER_VALUE:
 		draw_levels(control, ,
-		aio->channels_unlocked, selected);
+		aio->channels_unlocked, selected, aio->use_colour);
 		break;
 	}
 
@@ -159,7 +159,8 @@ get_enum_color(const char *name)
 }
 
 static void
-draw_enum(struct aiomixer_control *control, int ord, bool selected)
+draw_enum(struct aiomixer_control *control, int ord,
+bool selected, bool colour)
 {
 	struct audio_mixer_enum *e;
 	int color = COLOR_ENUM_MISC;
@@ -175,7 +176,7 @@ draw_enum(struct aiomixer_control *contr
 		}
 		waddch(control->widgetpad, '[');
 		if (ord == e->member[i].ord) {
-			if (has_colors()) {
+			if (colour) {
 color = get_enum_color(e->member[i].label.name);
 wattron(control->widgetpad,
 	COLOR_PAIR(color));
@@ -185,7 +186,7 @@ draw_enum(struct aiomixer_control *contr
 		}
 		wprintw(control->widgetpad, "%s", e->member[i].label.name);
 		if (ord == control->info.un.e.member[i].ord) {
-			if (has_colors()) {
+			if (colour) {
 wattroff(control->widgetpad,
 	COLOR_PAIR(color));
 			}
@@ -204,19 +205,19 @@ draw_enum(struct aiomixer_control *contr
 }
 
 static void
-draw_set(struct aiomixer_control *control, int mask)

CVS commit: src/usr.bin/aiomixer

2023-06-29 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Thu Jun 29 19:06:54 UTC 2023

Modified Files:
src/usr.bin/aiomixer: aiomixer.1 app.h draw.c main.c

Log Message:
aiomixer(1): Support the informal NO_COLOR standard.

When the NO_COLOR environment variable is set, no ANSI colours will
be displayed.

https://no-color.org/


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/aiomixer/aiomixer.1 \
src/usr.bin/aiomixer/app.h
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/aiomixer/draw.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/aiomixer/main.c

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



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

2023-06-29 Thread Taylor R Campbell
> Date: Thu, 29 Jun 2023 16:51:05 - (UTC)
> From: chris...@astron.com (Christos Zoulas)
> 
> In article <20230628222148.710dbf...@cvs.netbsd.org>,
> Thomas Klausner  wrote:
> >-=-=-=-=-=-
> >
> [...]
> >+-DTMUX_CONF='"/etc/tmux.conf:~/.tmux.conf:$XDG_CONFIG_HOME/tmux/tmux.conf:~/.config/tmux/tmux.conf"'
> > \
> 
> What is XDG_CONFIG_HOME?

Typically ~/.config.  Described here:

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Many modern desktop applications dribble goo into this directory; you
probably already have one!  A large fraction of those applications can
be redirected to leak the goo elsewhere by changing XDG_CONFIG_HOME
without changing HOME.  See also XDG_DATA_HOME, XDG_CACHE_HOME, 


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

2023-06-29 Thread Christos Zoulas
In article <20230628222148.710dbf...@cvs.netbsd.org>,
Thomas Klausner  wrote:
>-=-=-=-=-=-
>
[...]
>+-DTMUX_CONF='"/etc/tmux.conf:~/.tmux.conf:$XDG_CONFIG_HOME/tmux/tmux.conf:~/.config/tmux/tmux.conf"'
> \

What is XDG_CONFIG_HOME?

christos



CVS commit: src/lib/libc/gen

2023-06-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jun 29 16:11:31 UTC 2023

Modified Files:
src/lib/libc/gen: vis.c

Log Message:
vis(3): Avoid nonportable MIN in portable code.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/lib/libc/gen/vis.c

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

Modified files:

Index: src/lib/libc/gen/vis.c
diff -u src/lib/libc/gen/vis.c:1.75 src/lib/libc/gen/vis.c:1.76
--- src/lib/libc/gen/vis.c:1.75	Fri Jun 18 10:57:14 2021
+++ src/lib/libc/gen/vis.c	Thu Jun 29 16:11:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vis.c,v 1.75 2021/06/18 10:57:14 christos Exp $	*/
+/*	$NetBSD: vis.c,v 1.76 2023/06/29 16:11:31 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -57,7 +57,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: vis.c,v 1.75 2021/06/18 10:57:14 christos Exp $");
+__RCSID("$NetBSD: vis.c,v 1.76 2023/06/29 16:11:31 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 #ifdef __FBSDID
 __FBSDID("$FreeBSD$");
@@ -466,7 +466,10 @@ istrsenvisx(char **mbdstp, size_t *dlen,
 	while (mbslength > 0) {
 		/* Convert one multibyte character to wchar_t. */
 		if (!cerr)
-			clen = mbrtowc(src, mbsrc, MIN(mbslength, MB_LEN_MAX),
+			clen = mbrtowc(src, mbsrc,
+			(mbslength < MB_LEN_MAX
+? mbslength
+: MB_LEN_MAX),
 			);
 		if (cerr || clen < 0) {
 			/* Conversion error, process as a byte instead. */



CVS commit: src/lib/libc/gen

2023-06-29 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu Jun 29 16:11:31 UTC 2023

Modified Files:
src/lib/libc/gen: vis.c

Log Message:
vis(3): Avoid nonportable MIN in portable code.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/lib/libc/gen/vis.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/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Jun 29 14:18:58 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: boot1.c

Log Message:
Primary bootstrap is now able to read a GPT inside RAIDframe.

Previously, primary bootstrap was able to boot on RAID-1 RAIDframe set
with the limitation that the FFS filesystem had to start at bloc 0 in the
RAID. That allowed inner RAID partitionning with a disklabel, but not with
a GPT.

When booting on a RAID-1 RAIDframe, primary bootstrap now first try a
filesystem at bloc 0 of the RAID as before. On failure, it tries to
read a GPT and load secondary bootstrap from, by priority;
1) the first partition with the bootme attribute set
2) the first partition of type FFS, LFS, CCD or CGD
3) the first partition present in the GPT


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/bootxx/boot1.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/i386/stand/bootxx/boot1.c
diff -u src/sys/arch/i386/stand/bootxx/boot1.c:1.21 src/sys/arch/i386/stand/bootxx/boot1.c:1.22
--- src/sys/arch/i386/stand/bootxx/boot1.c:1.21	Thu Jun 24 01:23:16 2021
+++ src/sys/arch/i386/stand/bootxx/boot1.c	Thu Jun 29 14:18:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $	*/
+/*	$NetBSD: boot1.c,v 1.22 2023/06/29 14:18:58 manu Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,15 +30,17 @@
  */
 
 #include 
-__RCSID("$NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $");
+__RCSID("$NetBSD: boot1.c,v 1.22 2023/06/29 14:18:58 manu Exp $");
 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 	/* For RF_PROTECTED_SECTORS */
 
 #define XSTR(x) #x
@@ -49,6 +51,9 @@ static daddr_t bios_sector;
 static struct biosdisk_ll d;
 
 const char *boot1(uint32_t, uint64_t *);
+#ifndef NO_GPT
+static daddr_t gpt_lookup(daddr_t);
+#endif
 extern void putstr(const char *);
 
 extern struct disklabel ptn_disklabel;
@@ -90,6 +95,17 @@ boot1(uint32_t biosdev, uint64_t *sector
 	fd = ob();
 	if (fd != -1)
 		goto done;
+
+#ifndef NO_GPT
+	/*
+	 * Test for a GPT inside the RAID
+	 */
+	bios_sector += gpt_lookup(bios_sector);
+	fd = ob();
+	if (fd != -1)
+		goto done;
+#endif
+
 	/*
 	 * Nothing at the start of the MBR partition, fallback on
 	 * partition 'a' from the disklabel in this MBR partition.
@@ -144,3 +160,146 @@ blkdevstrategy(void *devdata, int flag, 
 
 	return 0;
 }
+
+#ifndef NO_GPT
+static int
+is_unused(struct gpt_ent *ent)
+{
+	const struct uuid unused = GPT_ENT_TYPE_UNUSED;
+
+	return (memcmp(ent->ent_type, , sizeof(unused)) == 0);
+}
+
+static int
+is_bootable(struct gpt_ent *ent)
+{
+	/* GPT_ENT_TYPE_NETBSD_RAID omitted as we are already in a RAID */
+	const struct uuid bootable[] = {
+		GPT_ENT_TYPE_NETBSD_FFS,
+		GPT_ENT_TYPE_NETBSD_LFS,
+		GPT_ENT_TYPE_NETBSD_CCD,
+		GPT_ENT_TYPE_NETBSD_CGD,
+	};
+	int i;
+
+	for (i = 0; i < sizeof(bootable) / sizeof(*bootable); i++) {
+		if (memcmp(ent->ent_type, [i],
+		sizeof(struct uuid)) == 0)
+			return 1;
+	}
+
+	return 0;
+}
+
+static daddr_t
+gpt_lookup(daddr_t sector)
+{
+	char buf[BIOSDISK_DEFAULT_SECSIZE];
+	struct mbr_sector *pmbr;	
+	const char gpt_hdr_sig[] = GPT_HDR_SIG;
+	struct gpt_hdr *hdr;
+	struct gpt_ent *ent;
+	uint32_t nents;
+	uint32_t entsz;
+	uint32_t entries_per_sector;
+	uint32_t sectors_per_entry;
+	uint64_t firstpart_lba = 0;
+	uint64_t bootable_lba = 0;
+	uint64_t bootme_lba = 0;
+	int i, j;
+
+	/*
+	 * Look for a PMBR
+	 */
+	if (readsects(, sector, 1, buf, 1) != 0)
+		return 0;
+
+	pmbr = (struct mbr_sector *)buf;
+
+	if (pmbr->mbr_magic != htole16(MBR_MAGIC))
+		return 0;
+
+	if (pmbr->mbr_parts[0].mbrp_type != MBR_PTYPE_PMBR)
+		return 0;
+
+	sector++; /* skip PMBR */
+
+	/*
+	 * Look for a GPT header
+	 * Space is scarce, we do not check CRC.
+	 */
+	if (readsects(, sector, 1, buf, 1) != 0)
+		return 0;
+
+	hdr = (struct gpt_hdr *)buf;
+
+	if (memcmp(gpt_hdr_sig, hdr->hdr_sig, sizeof(hdr->hdr_sig)) != 0)
+		return 0;
+
+	if (hdr->hdr_revision != htole32(GPT_HDR_REVISION))
+		return 0;
+
+	if (le32toh(hdr->hdr_size) > BIOSDISK_DEFAULT_SECSIZE)
+		return 0;
+
+	nents = le32toh(hdr->hdr_entries);
+	entsz = le32toh(hdr->hdr_entsz);
+
+	sector++; /* skip GPT header */
+
+	/*
+	 * Read partition table
+	 *
+	 * According to UEFI specification section 5.3.2, entries
+	 * are 128 * (2^n) bytes long. The most common scenario is
+	 * 128 bytes (n = 0) where there are 4 entries per sector.
+	 * If n > 2, then entries spans multiple sectors, but they
+	 * remain sector-aligned.
+	 */
+	entries_per_sector = BIOSDISK_DEFAULT_SECSIZE / entsz;
+	if (entries_per_sector == 0)
+		entries_per_sector = 1;
+
+	sectors_per_entry = entsz / BIOSDISK_DEFAULT_SECSIZE;
+	if (sectors_per_entry == 0)
+		sectors_per_entry = 1;
+
+	for (i = 0; i < nents; i += entries_per_sector) {
+	

CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Jun 29 14:18:58 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: boot1.c

Log Message:
Primary bootstrap is now able to read a GPT inside RAIDframe.

Previously, primary bootstrap was able to boot on RAID-1 RAIDframe set
with the limitation that the FFS filesystem had to start at bloc 0 in the
RAID. That allowed inner RAID partitionning with a disklabel, but not with
a GPT.

When booting on a RAID-1 RAIDframe, primary bootstrap now first try a
filesystem at bloc 0 of the RAID as before. On failure, it tries to
read a GPT and load secondary bootstrap from, by priority;
1) the first partition with the bootme attribute set
2) the first partition of type FFS, LFS, CCD or CGD
3) the first partition present in the GPT


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/bootxx/boot1.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

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 12:52:07 UTC 2023

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

Log Message:
lint: use standard terminology for bit-field width

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.168 -r1.169 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.531 -r1.532 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/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.55 src/usr.bin/xlint/common/tyname.c:1.56
--- src/usr.bin/xlint/common/tyname.c:1.55	Sat Apr 22 17:49:14 2023
+++ src/usr.bin/xlint/common/tyname.c	Thu Jun 29 12:52:06 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tyname.c,v 1.55 2023/04/22 17:49:14 rillig Exp $	*/
+/*	$NetBSD: tyname.c,v 1.56 2023/06/29 12:52:06 rillig Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: tyname.c,v 1.55 2023/04/22 17:49:14 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.56 2023/06/29 12:52:06 rillig Exp $");
 #endif
 
 #include 
@@ -263,7 +263,7 @@ type_name(const type_t *tp)
 #ifdef IS_LINT1
 	if (tp->t_bitfield) {
 		buf_add(, ":");
-		buf_add_int(, (int)tp->t_flen);
+		buf_add_int(, (int)tp->t_bit_field_width);
 	}
 #endif
 

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.321 src/usr.bin/xlint/lint1/decl.c:1.322
--- src/usr.bin/xlint/lint1/decl.c:1.321	Thu Jun 29 10:31:33 2023
+++ src/usr.bin/xlint/lint1/decl.c	Thu Jun 29 12:52:06 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.321 2023/06/29 10:31:33 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.322 2023/06/29 12:52:06 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.321 2023/06/29 10:31:33 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.322 2023/06/29 12:52:06 rillig Exp $");
 #endif
 
 #include 
@@ -456,14 +456,16 @@ set_first_typedef(type_t *tp, sym_t *sym
 }
 
 static unsigned int
-bit_field_size(sym_t **mem)
+bit_field_width(sym_t **mem)
 {
-	unsigned int len = (*mem)->s_type->t_flen;
+	unsigned int width = (*mem)->s_type->t_bit_field_width;
 	while (*mem != NULL && (*mem)->s_type->t_bitfield) {
-		len += (*mem)->s_type->t_flen;
+		width += (*mem)->s_type->t_bit_field_width;
 		*mem = (*mem)->s_next;
 	}
-	return len - len % INT_SIZE;
+	// XXX: Why INT_SIZE? C99 6.7.2.1p4 allows bit-fields to have type
+	// XXX: _Bool or another implementation-defined type.
+	return width - width % INT_SIZE;
 }
 
 static void
@@ -482,7 +484,7 @@ set_packed_size(type_t *tp)
 			unsigned int x;
 
 			if (mem->s_type->t_bitfield) {
-sp->sou_size_in_bits += bit_field_size();
+sp->sou_size_in_bits += bit_field_width();
 if (mem == NULL)
 	break;
 			}
@@ -1047,10 +1049,11 @@ check_bit_field_type(sym_t *dsym, type_t
 		/* illegal bit-field type '%s' */
 		warning(35, type_name(btp));
 
-		unsigned int sz = tp->t_flen;
+		// XXX: What about _Bool bit-fields since C99 6.7.2.1?
+		unsigned int width = tp->t_bit_field_width;
 		dsym->s_type = tp = block_dup_type(gettyp(t = INT));
-		if ((tp->t_flen = sz) > size_in_bits(t))
-			tp->t_flen = size_in_bits(t);
+		if ((tp->t_bit_field_width = width) > size_in_bits(t))
+			tp->t_bit_field_width = size_in_bits(t);
 		*inout_t = t;
 		*inout_tp = tp;
 	}
@@ -1059,21 +1062,20 @@ check_bit_field_type(sym_t *dsym, type_t
 static void
 declare_bit_field(sym_t *dsym, tspec_t *inout_t, type_t **const inout_tp)
 {
-	type_t *tp;
-	tspec_t t;
 
 	check_bit_field_type(dsym, inout_tp, inout_t);
 
-	tp = *inout_tp;
-	t = *inout_t;
-	if (tp->t_flen > size_in_bits(t)) {
+	type_t *tp = *inout_tp;
+	tspec_t t = *inout_t;
+	unsigned int t_width = size_in_bits(t);
+	if (tp->t_bit_field_width > t_width) {
 		/* illegal bit-field size: %d */
-		error(36, tp->t_flen);
-		tp->t_flen = size_in_bits(t);
-	} else if (tp->t_flen == 0 && dsym->s_name != unnamed) {
+		error(36, (int)tp->t_bit_field_width);
+		tp->t_bit_field_width = t_width;
+	} else if (tp->t_bit_field_width == 0 && dsym->s_name != unnamed) {
 		/* zero size bit-field */
 		error(37);
-		tp->t_flen = size_in_bits(t);
+		tp->t_bit_field_width = t_width;
 	}
 	if (dsym->s_scl == UNION_MEMBER) {
 		/* bit-field in union is very unusual */
@@ -1133,12 +1135,12 @@ declare_member(sym_t *dsym)
 		dcs->d_offset_in_bits = 0;
 	}
 	if (dsym->s_bitfield) {
-		dcs_align(alignment_in_bits(tp), tp->t_flen);
+		dcs_align(alignment_in_bits(tp), tp->t_bit_field_width);
 		dsym->u.s_member.sm_offset_in_bits = dcs->d_offset_in_bits -
 		dcs->d_offset_in_bits % size_in_bits(t);
-		tp->t_foffs = dcs->d_offset_in_bits -

CVS commit: src/usr.bin/xlint

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 12:52:07 UTC 2023

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

Log Message:
lint: use standard terminology for bit-field width

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.321 -r1.322 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.168 -r1.169 src/usr.bin/xlint/lint1/lint1.h
cvs rdiff -u -r1.531 -r1.532 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

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 10:31:33 UTC 2023

Modified Files:
src/usr.bin/xlint/common: externs.h inittyp.c lint.h
src/usr.bin/xlint/lint1: decl.c emit1.c
src/usr.bin/xlint/lint2: emit2.c

Log Message:
lint: clean up initialization of type properties

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/lint2/emit2.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.26 src/usr.bin/xlint/common/externs.h:1.27
--- src/usr.bin/xlint/common/externs.h:1.26	Sat Jun 24 07:15:08 2023
+++ src/usr.bin/xlint/common/externs.h	Thu Jun 29 10:31:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: externs.h,v 1.26 2023/06/24 07:15:08 rillig Exp $	*/
+/*	$NetBSD: externs.h,v 1.27 2023/06/29 10:31:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -32,11 +32,6 @@
  */
 
 /*
- * inittyp.c
- */
-void	inittyp(void);
-
-/*
  * tyname.c
  */
 const char *type_name(const type_t *);

Index: src/usr.bin/xlint/common/inittyp.c
diff -u src/usr.bin/xlint/common/inittyp.c:1.35 src/usr.bin/xlint/common/inittyp.c:1.36
--- src/usr.bin/xlint/common/inittyp.c:1.35	Fri Jun  9 13:03:49 2023
+++ src/usr.bin/xlint/common/inittyp.c	Thu Jun 29 10:31:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: inittyp.c,v 1.35 2023/06/09 13:03:49 rillig Exp $	*/
+/*	$NetBSD: inittyp.c,v 1.36 2023/06/29 10:31:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID)
-__RCSID("$NetBSD: inittyp.c,v 1.35 2023/06/09 13:03:49 rillig Exp $");
+__RCSID("$NetBSD: inittyp.c,v 1.36 2023/06/29 10:31:32 rillig Exp $");
 #endif
 
 #if defined(IS_LINT1)
@@ -103,13 +103,6 @@ ttab_t	ttab[NTSPEC] = {
 	typeinfo("float", FLOAT, FLOAT, FLOAT_SIZE, 32, 'f'),
 	typeinfo("double", DOUBLE, DOUBLE, DOUBLE_SIZE, 64, 'f'),
 	typeinfo("long double", LDOUBLE, LDOUBLE, LDOUBLE_SIZE, 80, 'f'),
-	typeinfo("void", VOID, VOID, 0, 0, ' '),
-	typeinfo("struct", STRUCT, STRUCT, 0, 0, ' '),
-	typeinfo("union", UNION, UNION, 0, 0, ' '),
-	typeinfo("enum", ENUM, ENUM, ENUM_SIZE, 24, 's'),
-	typeinfo("pointer", PTR, PTR, PTR_SIZE, 32, 'p'),
-	typeinfo("array", ARRAY, ARRAY, 0, 0, ' '),
-	typeinfo("function", FUNC, FUNC, 0, 0, ' '),
 #ifdef DEBUG
 	typeinfo("_Complex", NO_TSPEC, NO_TSPEC, 0, 0, ' '),
 #else
@@ -121,25 +114,12 @@ ttab_t	ttab[NTSPEC] = {
 	DOUBLE_SIZE * 2, 64 * 2, 'c'),
 	typeinfo("long double _Complex", LCOMPLEX, LCOMPLEX,
 	LDOUBLE_SIZE * 2, 80 * 2, 'c'),
+	typeinfo("void", VOID, VOID, 0, 0, ' '),
+	typeinfo("struct", STRUCT, STRUCT, 0, 0, ' '),
+	typeinfo("union", UNION, UNION, 0, 0, ' '),
+	typeinfo("enum", ENUM, ENUM, ENUM_SIZE, 24, 's'),
+	typeinfo("pointer", PTR, PTR, PTR_SIZE, 32, 'p'),
+	typeinfo("array", ARRAY, ARRAY, 0, 0, ' '),
+	typeinfo("function", FUNC, FUNC, 0, 0, ' '),
 };
 #undef typeinfo
-
-#ifdef IS_LINT1
-void
-inittyp(void)
-{
-	size_t i;
-
-	if (!pflag) {
-		for (i = 0; i < NTSPEC; i++)
-			ttab[i].tt_portable_size_in_bits =
-			ttab[i].tt_size_in_bits;
-	}
-
-	if (Tflag) {
-		ttab[BOOL].tt_is_integer = false;
-		ttab[BOOL].tt_is_uinteger = false;
-		ttab[BOOL].tt_is_arithmetic = false;
-	}
-}
-#endif

Index: src/usr.bin/xlint/common/lint.h
diff -u src/usr.bin/xlint/common/lint.h:1.36 src/usr.bin/xlint/common/lint.h:1.37
--- src/usr.bin/xlint/common/lint.h:1.36	Mon May 22 12:55:04 2023
+++ src/usr.bin/xlint/common/lint.h	Thu Jun 29 10:31:32 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: lint.h,v 1.36 2023/05/22 12:55:04 rillig Exp $	*/
+/*	$NetBSD: lint.h,v 1.37 2023/06/29 10:31:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -73,6 +73,10 @@ typedef enum {
 	FLOAT,		/* float */
 	DOUBLE,		/* double or, with tflag, long float */
 	LDOUBLE,	/* long double */
+	COMPLEX,	/* keyword "_Complex", only used in the parser */
+	FCOMPLEX,	/* float _Complex */
+	DCOMPLEX,	/* double _Complex */
+	LCOMPLEX,	/* long double _Complex */
 	VOID,		/* void */
 	STRUCT,		/* structure tag */
 	UNION,		/* union tag */
@@ -80,11 +84,7 @@ typedef enum {
 	PTR,		/* pointer */
 	ARRAY,		/* array */
 	FUNC,		/* function */
-	COMPLEX,	/* keyword "_Complex", only used in the parser */
-	FCOMPLEX,	/* float _Complex */
-	DCOMPLEX,	/* double _Complex */
-	LCOMPLEX	/* long double _Complex */
-#define NTSPEC (LCOMPLEX + 1)
+#define NTSPEC ((int)FUNC + 1)
 } tspec_t;
 
 

Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.320 src/usr.bin/xlint/lint1/decl.c:1.321
--- src/usr.bin/xlint/lint1/decl.c:1.320	Thu Jun 29 09:58:36 

CVS commit: src/usr.bin/xlint

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 10:31:33 UTC 2023

Modified Files:
src/usr.bin/xlint/common: externs.h inittyp.c lint.h
src/usr.bin/xlint/lint1: decl.c emit1.c
src/usr.bin/xlint/lint2: emit2.c

Log Message:
lint: clean up initialization of type properties

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/xlint/common/externs.h
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/common/inittyp.c
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/xlint/common/lint.h
cvs rdiff -u -r1.320 -r1.321 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.69 -r1.70 src/usr.bin/xlint/lint1/emit1.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/xlint/lint2/emit2.c

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



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

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 09:58:36 UTC 2023

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

Log Message:
lint: clean up function names

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.437 -r1.438 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.157 -r1.158 src/usr.bin/xlint/lint1/func.c

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

Modified files:

Index: src/usr.bin/xlint/lint1/cgram.y
diff -u src/usr.bin/xlint/lint1/cgram.y:1.437 src/usr.bin/xlint/lint1/cgram.y:1.438
--- src/usr.bin/xlint/lint1/cgram.y:1.437	Thu Jun 29 05:03:03 2023
+++ src/usr.bin/xlint/lint1/cgram.y	Thu Jun 29 09:58:36 2023
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: cgram.y,v 1.437 2023/06/29 05:03:03 rillig Exp $ */
+/* $NetBSD: cgram.y,v 1.438 2023/06/29 09:58:36 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.437 2023/06/29 05:03:03 rillig Exp $");
+__RCSID("$NetBSD: cgram.y,v 1.438 2023/06/29 09:58:36 rillig Exp $");
 #endif
 
 #include 
@@ -988,23 +988,23 @@ struct_declaration:		/* C99 6.7.2.1 */
 
 notype_struct_declarators:
 	  notype_struct_declarator {
-		$$ = declarator_1_struct_union($1);
+		$$ = declare_member($1);
 	  }
 	| notype_struct_declarators {
 		symtyp = FMEMBER;
 	  } T_COMMA type_struct_declarator {
-		$$ = concat_lists($1, declarator_1_struct_union($4));
+		$$ = concat_lists($1, declare_member($4));
 	  }
 	;
 
 type_struct_declarators:
 	  type_struct_declarator {
-		$$ = declarator_1_struct_union($1);
+		$$ = declare_member($1);
 	  }
 	| type_struct_declarators {
 		symtyp = FMEMBER;
 	  } T_COMMA type_struct_declarator {
-		$$ = concat_lists($1, declarator_1_struct_union($4));
+		$$ = concat_lists($1, declare_member($4));
 	  }
 	;
 
@@ -1387,16 +1387,16 @@ type_name:			/* C99 6.7.6 */
 
 abstract_declaration:		/* specific to lint */
 	  begin_type_qualifier_list end_type {
-		$$ = declare_1_abstract(abstract_name());
+		$$ = declare_abstract_type(abstract_name());
 	  }
 	| begin_type_specifier_qualifier_list end_type {
-		$$ = declare_1_abstract(abstract_name());
+		$$ = declare_abstract_type(abstract_name());
 	  }
 	| begin_type_qualifier_list end_type abstract_declarator {
-		$$ = declare_1_abstract($3);
+		$$ = declare_abstract_type($3);
 	  }
 	| begin_type_specifier_qualifier_list end_type abstract_declarator {
-		$$ = declare_1_abstract($3);
+		$$ = declare_abstract_type($3);
 	  }
 	;
 
@@ -1726,27 +1726,27 @@ expression_statement:		/* C99 6.8.3 */
 selection_statement:		/* C99 6.8.4 */
 	  if_without_else %prec T_THEN {
 		save_warning_flags();
-		if2();
-		if3(false);
+		stmt_if_then_stmt();
+		stmt_if_else_stmt(false);
 	  }
 	| if_without_else T_ELSE {
 		save_warning_flags();
-		if2();
+		stmt_if_then_stmt();
 	  } statement {
 		clear_warning_flags();
-		if3(true);
+		stmt_if_else_stmt(true);
 	  }
 	| if_without_else T_ELSE error {
 		clear_warning_flags();
-		if3(false);
+		stmt_if_else_stmt(false);
 	  }
 	| switch_expr statement {
 		clear_warning_flags();
-		switch2();
+		stmt_switch_expr_stmt();
 	  }
 	| switch_expr error {
 		clear_warning_flags();
-		switch2();
+		stmt_switch_expr_stmt();
 	  }
 	;
 
@@ -1757,14 +1757,14 @@ if_without_else:		/* see C99 6.8.4 */
 
 if_expr:			/* see C99 6.8.4 */
 	  T_IF T_LPAREN expression T_RPAREN {
-		if1($3);
+		stmt_if_expr($3);
 		clear_warning_flags();
 	  }
 	;
 
 switch_expr:			/* see C99 6.8.4 */
 	  T_SWITCH T_LPAREN expression T_RPAREN {
-		switch1($3);
+		stmt_switch_expr($3);
 		clear_warning_flags();
 	  }
 	;
@@ -1772,29 +1772,29 @@ switch_expr:			/* see C99 6.8.4 */
 iteration_statement:		/* C99 6.8.5 */
 	  while_expr statement {
 		clear_warning_flags();
-		while2();
+		stmt_while_expr_stmt();
 	  }
 	| while_expr error {
 		clear_warning_flags();
-		while2();
+		stmt_while_expr_stmt();
 	  }
 	| do_statement do_while_expr {
-		do2($2);
+		stmt_do_while_expr($2);
 		seen_fallthrough = false;
 	  }
 	| do error {
 		clear_warning_flags();
-		do2(NULL);
+		stmt_do_while_expr(NULL);
 	  }
 	| for_exprs statement {
 		clear_warning_flags();
-		for2();
+		stmt_for_exprs_stmt();
 		end_declaration_level();
 		block_level--;
 	  }
 	| for_exprs error {
 		clear_warning_flags();
-		for2();
+		stmt_for_exprs_stmt();
 		end_declaration_level();
 		block_level--;
 	  }
@@ -1802,7 +1802,7 @@ iteration_statement:		/* C99 6.8.5 */
 
 while_expr:			/* see C99 6.8.5 */
 	  T_WHILE T_LPAREN expression T_RPAREN {
-		while1($3);
+		stmt_while_expr($3);
 		clear_warning_flags();
 	  }
 	;
@@ -1815,7 +1815,7 @@ do_statement:			/* see C99 6.8.5 */
 
 do:/* see C99 6.8.5 */
 	  T_DO {
-		do1();
+		stmt_do();
 	  }
 	;
 
@@ -1840,36 

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

2023-06-29 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Jun 29 09:58:36 UTC 2023

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

Log Message:
lint: clean up function names

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.437 -r1.438 src/usr.bin/xlint/lint1/cgram.y
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.179 -r1.180 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.157 -r1.158 src/usr.bin/xlint/lint1/func.c

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