CVS commit: src/lib/libusbhid

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 05:33:46 UTC 2022

Modified Files:
src/lib/libusbhid: usbhid.3

Log Message:
usbhid.3: hid_parse_usage_in_page() actually returns int


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libusbhid/usbhid.3

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

Modified files:

Index: src/lib/libusbhid/usbhid.3
diff -u src/lib/libusbhid/usbhid.3:1.16 src/lib/libusbhid/usbhid.3:1.17
--- src/lib/libusbhid/usbhid.3:1.16	Sun Oct 22 16:49:13 2017
+++ src/lib/libusbhid/usbhid.3	Sun May 22 05:33:46 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbhid.3,v 1.16 2017/10/22 16:49:13 abhinav Exp $
+.\"	$NetBSD: usbhid.3,v 1.17 2022/05/22 05:33:46 charlotte Exp $
 .\"
 .\" Copyright (c) 1999, 2001 Lennart Augustsson 
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 12, 2010
+.Dd May 21, 2022
 .Dt USBHID 3
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@
 .Fn hid_usage_in_page "u_int u"
 .Ft int
 .Fn hid_parse_usage_page "const char *"
-.Ft char *
+.Ft int
 .Fn hid_parse_usage_in_page "const char *"
 .Ft void
 .Fn hid_init "const char *file"



CVS commit: src/lib/libusbhid

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 05:33:46 UTC 2022

Modified Files:
src/lib/libusbhid: usbhid.3

Log Message:
usbhid.3: hid_parse_usage_in_page() actually returns int


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/lib/libusbhid/usbhid.3

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



CVS commit: src/sys/dev/usb

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 00:54:08 UTC 2022

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.795 -r1.796 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.h

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

Modified files:

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.795 src/sys/dev/usb/usbdevs.h:1.796
--- src/sys/dev/usb/usbdevs.h:1.795	Thu May 19 03:58:13 2022
+++ src/sys/dev/usb/usbdevs.h	Sun May 22 00:54:07 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.795 2022/05/19 03:58:13 charlotte Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.796 2022/05/22 00:54:07 charlotte Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.803 2022/05/19 03:42:12 charlotte Exp
+ *	NetBSD: usbdevs,v 1.804 2022/05/22 00:47:00 charlotte Exp
  */
 
 /*-
@@ -3557,6 +3557,7 @@
 #define	USB_PRODUCT_WACOM_INTUOSA5	0x0021		/* Intuos A5 */
 #define	USB_PRODUCT_WACOM_GD0912U	0x0022		/* Intuos 9x12 Graphics Tablet */
 #define	USB_PRODUCT_WACOM_XD0912U	0x0043		/* Intuos2 A4 i-920 XD-0912-U */
+#define	USB_PRODUCT_WACOM_CTL671	0x0301		/* CTL-671 Tablet */
 #define	USB_PRODUCT_WACOM_CTH690K0	0x033e		/* Intuos Art CTH-690/K0 */
 
 /* Weltrend Semiconductor */
Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.795 src/sys/dev/usb/usbdevs_data.h:1.796
--- src/sys/dev/usb/usbdevs_data.h:1.795	Thu May 19 03:58:13 2022
+++ src/sys/dev/usb/usbdevs_data.h	Sun May 22 00:54:07 2022
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.795 2022/05/19 03:58:13 charlotte Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.796 2022/05/22 00:54:07 charlotte Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.803 2022/05/19 03:42:12 charlotte Exp
+ *	NetBSD: usbdevs,v 1.804 2022/05/22 00:47:00 charlotte Exp
  */
 
 /*-
@@ -4848,22 +4848,24 @@ static const uint32_t usb_products[] = {
 	20241, 20251, 1967, 20176, 0,
 	USB_VENDOR_WACOM, USB_PRODUCT_WACOM_XD0912U, 
 	20256, 19290, 20264, 20270, 0,
+	USB_VENDOR_WACOM, USB_PRODUCT_WACOM_CTL671, 
+	20280, 20176, 0,
 	USB_VENDOR_WACOM, USB_PRODUCT_WACOM_CTH690K0, 
-	20241, 20280, 20284, 0,
+	20241, 20288, 20292, 0,
 	USB_VENDOR_WELTREND, USB_PRODUCT_WELTREND_HID, 
-	20295, 8010, 0,
+	20303, 8010, 0,
 	USB_VENDOR_WMR, USB_PRODUCT_WMR_RIGBLASTER, 
-	20299, 0,
+	20307, 0,
 	USB_VENDOR_WESTERN, USB_PRODUCT_WESTERN_EXTHDD, 
-	20310, 20319, 0,
+	20318, 20327, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_WNC0600, 
-	20323, 0,
+	20331, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_UR045G, 
 	5373, 4939, 5381, 5346, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_UR055G, 
-	20335, 0,
+	20343, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_O8494, 
-	20342, 20350, 0,
+	20350, 20358, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_AR5523_1, 
 	7045, 0,
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_AR5523_1_NF, 
@@ -4873,7 +4875,7 @@ static const uint32_t usb_products[] = {
 	USB_VENDOR_WISTRONNEWEB, USB_PRODUCT_WISTRONNEWEB_AR5523_2_NF, 
 	7045, 0,
 	USB_VENDOR_XIRLINK, USB_PRODUCT_XIRLINK_IMAGING, 
-	20358, 20366, 0,
+	20366, 20374, 0,
 	USB_VENDOR_XIRLINK, USB_PRODUCT_XIRLINK_PCCAM, 
 	767, 5830, 3016, 0,
 	USB_VENDOR_XRITE, USB_PRODUCT_XRITE_HUEY_1, 
@@ -4887,59 +4889,59 @@ static const uint32_t usb_products[] = {
 	USB_VENDOR_CONEXANT, USB_PRODUCT_CONEXANT_PRISM_GT_2, 
 	5373, 4939, 5381, 5346, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_UX256, 
-	20373, 17333, 17324, 0,
+	20381, 17333, 17324, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MU1000, 
-	20379, 17333, 17368, 0,
+	20387, 17333, 17368, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MU2000, 
-	20386, 17333, 17368, 0,
+	20394, 17333, 17368, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MU500, 
-	20393, 17333, 17368, 0,
+	20401, 17333, 17368, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_UW500, 
-	20399, 4939, 7296, 17324, 0,
+	20407, 4939, 7296, 17324, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MOTIF6, 
-	20405, 17333, 17368, 20412, 0,
+	20413, 17333, 17368, 20420, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MOTIF7, 
-	20424, 17333, 17368, 20412, 0,
+	20432, 17333, 17368, 20420, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_MOTIF8, 
-	20431, 17333, 17368, 20412, 0,
+	20439, 17333, 17368, 20420, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_UX96, 
-	20438, 17333, 17324, 0,
+	20446, 17333, 17324, 0,
 	USB_VENDOR_YAMAHA, USB_PRODUCT_YAMAHA_UX16, 
-	20443, 17333, 17324, 0,
+	20451, 17333, 

CVS commit: src/sys/dev/usb

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 00:54:08 UTC 2022

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.795 -r1.796 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.h

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



CVS commit: src/sys/dev/usb

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 00:47:00 UTC 2022

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
usbdevs: Add Wacom "One" CTL-671 tablet


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

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.803 src/sys/dev/usb/usbdevs:1.804
--- src/sys/dev/usb/usbdevs:1.803	Thu May 19 03:42:12 2022
+++ src/sys/dev/usb/usbdevs	Sun May 22 00:47:00 2022
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.803 2022/05/19 03:42:12 charlotte Exp $
+$NetBSD: usbdevs,v 1.804 2022/05/22 00:47:00 charlotte Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -3550,6 +3550,7 @@ product WACOM GRAPHIRE4_4X5	0x0015	Graph
 product WACOM INTUOSA5		0x0021	Intuos A5
 product WACOM GD0912U		0x0022	Intuos 9x12 Graphics Tablet
 product WACOM XD0912U		0x0043	Intuos2 A4 i-920 XD-0912-U
+product WACOM CTL671		0x0301	CTL-671 Tablet
 product WACOM CTH690K0		0x033e	Intuos Art CTH-690/K0
 
 /* Weltrend Semiconductor */



CVS commit: src/sys/dev/usb

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sun May 22 00:47:00 UTC 2022

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
usbdevs: Add Wacom "One" CTL-671 tablet


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

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



CVS commit: src/sys/external/bsd/drm2/drm

2022-05-21 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sun May 22 00:10:56 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/drm: files.drmkms

Log Message:
rename CONFIG_AARCH64 to CONFIG_ARM64 which is what upstream code expects


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/external/bsd/drm2/drm/files.drmkms

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



CVS commit: src/sys/external/bsd/drm2/drm

2022-05-21 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sun May 22 00:10:56 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/drm: files.drmkms

Log Message:
rename CONFIG_AARCH64 to CONFIG_ARM64 which is what upstream code expects


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/external/bsd/drm2/drm/files.drmkms

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/files.drmkms
diff -u src/sys/external/bsd/drm2/drm/files.drmkms:1.72 src/sys/external/bsd/drm2/drm/files.drmkms:1.73
--- src/sys/external/bsd/drm2/drm/files.drmkms:1.72	Tue Dec 21 12:55:23 2021
+++ src/sys/external/bsd/drm2/drm/files.drmkms	Sun May 22 00:10:56 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: files.drmkms,v 1.72 2021/12/21 12:55:23 tnn Exp $
+#	$NetBSD: files.drmkms,v 1.73 2022/05/22 00:10:56 tnn Exp $
 
 version	20180827
 
@@ -39,7 +39,7 @@ makeoptions	drmkms	CPPFLAGS+="-DCONFIG_X
 elifdef arm
 makeoptions	drmkms	CPPFLAGS+="-DCONFIG_ARM"
 elifdef aarch64
-makeoptions	drmkms	CPPFLAGS+="-DCONFIG_AARCH64"
+makeoptions	drmkms	CPPFLAGS+="-DCONFIG_ARM64"
 endif
 
 makeoptions	drmkms	CPPFLAGS+="-DCONFIG_BACKLIGHT_CLASS_DEVICE=0"



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2022-05-21 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat May 21 23:42:13 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_cache.h

Log Message:
drm_cache.h: fix a merge error

this reverts revision 1.3 which should have been reverted when it got
introduced by upstream through revision 1.5.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.10 src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.11
--- src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h:1.10	Sun Dec 19 11:33:30 2021
+++ src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h	Sat May 21 23:42:13 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_cache.h,v 1.10 2021/12/19 11:33:30 riastradh Exp $	*/
+/*	$NetBSD: drm_cache.h,v 1.11 2022/05/21 23:42:13 tnn Exp $	*/
 
 /**
  *
@@ -69,8 +69,6 @@ static inline bool drm_arch_can_wc_memor
 	 * optimization entirely for ARM and arm64.
 	 */
 	return false;
-#elif defined(CONFIG_ARM) || defined(CONFIG_ARM64)
-	return false;
 #else
 	return true;
 #endif



CVS commit: src/sys/external/bsd/drm2/dist/include/drm

2022-05-21 Thread Tobias Nygren
Module Name:src
Committed By:   tnn
Date:   Sat May 21 23:42:13 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/include/drm: drm_cache.h

Log Message:
drm_cache.h: fix a merge error

this reverts revision 1.3 which should have been reverted when it got
introduced by upstream through revision 1.5.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/sys/external/bsd/drm2/dist/include/drm/drm_cache.h

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



CVS commit: src/sys/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 23:11:03 UTC 2022

Modified Files:
src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Fix set-but-unused variable warning.

This deliberately ignores the error code returned by crypto_dispatch,
but that error code is fundamentally incoherent and the issue will be
mooted by subsequent changes to make it return void and always pass
the error through the callback, as well as subsequent changes to rip
out the EAGAIN logic anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.114 src/sys/opencrypto/cryptodev.c:1.115
--- src/sys/opencrypto/cryptodev.c:1.114	Sat May 21 20:37:18 2022
+++ src/sys/opencrypto/cryptodev.c	Sat May 21 23:11:03 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.115 2022/05/21 23:11:03 riastradh Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.115 2022/05/21 23:11:03 riastradh Exp $");
 
 #include 
 #include 
@@ -737,13 +737,12 @@ static int
 cryptodev_mcb(struct cryptop *crp)
 {
 	struct csession *cse = crp->crp_opaque;
-	int error = 0;
 
 	mutex_enter(_mtx);
 	cse->error = crp->crp_etype;
 	if (crp->crp_etype == EAGAIN) {
 		mutex_exit(_mtx);
-		error = crypto_dispatch(crp);
+		(void)crypto_dispatch(crp);
 		mutex_enter(_mtx);
 	}
 



CVS commit: src/sys/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 23:11:03 UTC 2022

Modified Files:
src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Fix set-but-unused variable warning.

This deliberately ignores the error code returned by crypto_dispatch,
but that error code is fundamentally incoherent and the issue will be
mooted by subsequent changes to make it return void and always pass
the error through the callback, as well as subsequent changes to rip
out the EAGAIN logic anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/sys/opencrypto/cryptodev.c

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



CVS commit: src/tests/crypto/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 20:38:34 UTC 2022

Modified Files:
src/tests/crypto/opencrypto: h_ioctl.c

Log Message:
tests/crypto/opencrypto: Wait a bit for async results.

These may not be ready immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/crypto/opencrypto/h_ioctl.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/crypto/opencrypto/h_ioctl.c
diff -u src/tests/crypto/opencrypto/h_ioctl.c:1.4 src/tests/crypto/opencrypto/h_ioctl.c:1.5
--- src/tests/crypto/opencrypto/h_ioctl.c:1.4	Sat May 21 13:31:29 2022
+++ src/tests/crypto/opencrypto/h_ioctl.c	Sat May 21 20:38:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_ioctl.c,v 1.4 2022/05/21 13:31:29 riastradh Exp $	*/
+/*	$NetBSD: h_ioctl.c,v 1.5 2022/05/21 20:38:34 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -59,6 +60,30 @@ unsigned char aes_cipher[AES_CIPHER_LEN]
 
 #define COUNT 2
 
+static int
+wait_for_read(int fd)
+{
+	struct pollfd pfd = { .fd = fd, .events = POLLIN };
+	int nfd;
+
+	nfd = poll(, 1, 5000);
+	if (nfd == -1) {
+		warn("failed: poll");
+		return -1;
+	}
+	if (nfd == 0) {
+		warnx("failed: timeout");
+		errno = ETIMEDOUT;
+		return -1;
+	}
+	if (nfd != 1 || (pfd.revents & POLLIN) == 0) {
+		warnx("failed: invalid poll: %d", nfd);
+		errno = EIO;
+		return -1;
+	}
+	return 0;
+}
+
 /*
  * CRIOGET is deprecated.
  */
@@ -190,8 +215,10 @@ test_ncryptretm(int fd)
 	mop.count = COUNT;
 	mop.reqs = cnos;
 	ret = ioctl(fd, CIOCNCRYPTM, );
-	if (ret < 0)
+	if (ret < 0) {
 		warn("failed: CIOCNCRYPTM");
+		return ret;
+	}
 
 	for (size_t i = 0; i < COUNT; i++) {
 		struct crypt_result *cr = [i];
@@ -204,8 +231,24 @@ test_ncryptretm(int fd)
 	cret.count = COUNT;
 	cret.results = crs;
 	ret = ioctl(fd, CIOCNCRYPTRETM, );
-	if (ret < 0)
-		warn("failed: CIOCNCRYPTRETM");
+	if (ret < 0) {
+		if (errno != EINPROGRESS) {
+			warn("failed: CIOCNCRYPTRETM");
+			return ret;
+		}
+
+		ret = wait_for_read(fd);
+		if (ret < 0)
+			return ret;
+
+		cret.count = COUNT;
+		cret.results = crs;
+		ret = ioctl(fd, CIOCNCRYPTRETM, );
+		if (ret < 0) {
+			warn("failed: CIOCNCRYPTRET");
+			return ret;
+		}
+	}
 
 	return ret;
 }
@@ -269,15 +312,31 @@ test_ncryptret_ent(int fd)
 	mop.count = 1;
 	mop.reqs = 
 	ret = ioctl(fd, CIOCNCRYPTM, );
-	if (ret < 0)
+	if (ret < 0) {
 		warn("failed: CIOCNCRYPTM");
+		return ret;
+	}
 
 	memset(, 0, sizeof(cr));
 	cr.reqid = cno.reqid;
 
 	ret = ioctl(fd, CIOCNCRYPTRET, );
-	if (ret < 0)
-		warn("failed: CIOCNCRYPTRET");
+	if (ret < 0) {
+		if (errno != EINPROGRESS) {
+			warn("failed: CIOCNCRYPTRET");
+			return ret;
+		}
+
+		ret = wait_for_read(fd);
+		if (ret < 0)
+			return ret;
+		ret = ioctl(fd, CIOCNCRYPTRET, );
+		if (ret < 0) {
+			warn("failed: CIOCNCRYPTRET");
+			return ret;
+		}
+		return 0;
+	}
 
 	return ret;
 }



CVS commit: src/tests/crypto/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 20:38:34 UTC 2022

Modified Files:
src/tests/crypto/opencrypto: h_ioctl.c

Log Message:
tests/crypto/opencrypto: Wait a bit for async results.

These may not be ready immediately.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/crypto/opencrypto/h_ioctl.c

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



CVS commit: src/sys/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 20:37:18 UTC 2022

Modified Files:
src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Don't signal the condvar for multi-operation completion.

The condvar may be destroyed by the time we got here, and nothing
waits on it anyway -- instead the caller is expected to select/poll
for completion in userland.

The bug was already here, but the recent change to eliminate
CRYPTO_F_CBIMM made it happen more often by causing the callback to
_always_ be run asynchronously instead of sometimes being run
synchronously.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/opencrypto/cryptodev.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/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.113 src/sys/opencrypto/cryptodev.c:1.114
--- src/sys/opencrypto/cryptodev.c:1.113	Thu May 19 20:51:46 2022
+++ src/sys/opencrypto/cryptodev.c	Sat May 21 20:37:18 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.113 2022/05/19 20:51:46 riastradh Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.113 2022/05/19 20:51:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $");
 
 #include 
 #include 
@@ -746,9 +746,6 @@ cryptodev_mcb(struct cryptop *crp)
 		error = crypto_dispatch(crp);
 		mutex_enter(_mtx);
 	}
-	if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
-		cv_signal(>crp_cv);
-	}
 
 	TAILQ_INSERT_TAIL(>fcrp->crp_ret_mq, crp, crp_next);
 	selnotify(>fcrp->sinfo, 0, 0);



CVS commit: src/sys/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 20:37:18 UTC 2022

Modified Files:
src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Don't signal the condvar for multi-operation completion.

The condvar may be destroyed by the time we got here, and nothing
waits on it anyway -- instead the caller is expected to select/poll
for completion in userland.

The bug was already here, but the recent change to eliminate
CRYPTO_F_CBIMM made it happen more often by causing the callback to
_always_ be run asynchronously instead of sometimes being run
synchronously.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/opencrypto/cryptodev.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/argon2/dist/phc-winner-argon2/src

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 19:57:06 UTC 2022

Modified Files:
src/external/apache2/argon2/dist/phc-winner-argon2/src: thread.c
thread.h

Log Message:
argon2: Silence -Wmissing-noreturn in thread.c on clang.

Saves the trouble of patching it away in external code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c \
src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h

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/argon2/dist/phc-winner-argon2/src/thread.c
diff -u src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c:1.1 src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c:1.2
--- src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c:1.1	Wed Oct  9 13:13:09 2019
+++ src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c	Sat May 21 19:57:06 2022
@@ -46,6 +46,7 @@ int argon2_thread_join(argon2_thread_han
 #endif
 }
 
+__attribute__((__noreturn__))
 void argon2_thread_exit(void) {
 #if defined(_WIN32)
 _endthreadex(0);
Index: src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h
diff -u src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h:1.1 src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h:1.2
--- src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h:1.1	Wed Oct  9 13:13:09 2019
+++ src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h	Sat May 21 19:57:06 2022
@@ -61,7 +61,7 @@ int argon2_thread_join(argon2_thread_han
 /* Terminate the current thread. Must be run inside a thread created by
  * argon2_thread_create.
 */
-void argon2_thread_exit(void);
+void argon2_thread_exit(void) __attribute__((__noreturn__));
 
 #endif /* ARGON2_NO_THREADS */
 #endif



CVS commit: src/external/apache2/argon2/dist/phc-winner-argon2/src

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 19:57:06 UTC 2022

Modified Files:
src/external/apache2/argon2/dist/phc-winner-argon2/src: thread.c
thread.h

Log Message:
argon2: Silence -Wmissing-noreturn in thread.c on clang.

Saves the trouble of patching it away in external code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.c \
src/external/apache2/argon2/dist/phc-winner-argon2/src/thread.h

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



CVS commit: src/sys

2022-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat May 21 19:07:23 UTC 2022

Modified Files:
src/sys/arch/arm/omap: omap_edma.c
src/sys/arch/arm/ti: ti_edma.c
src/sys/dev/ic: scmdreg.h

Log Message:
s/artifical/artificial/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap_edma.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/ti/ti_edma.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/scmdreg.h

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

Modified files:

Index: src/sys/arch/arm/omap/omap_edma.c
diff -u src/sys/arch/arm/omap/omap_edma.c:1.5 src/sys/arch/arm/omap/omap_edma.c:1.6
--- src/sys/arch/arm/omap/omap_edma.c:1.5	Thu Sep 16 22:19:10 2021
+++ src/sys/arch/arm/omap/omap_edma.c	Sat May 21 19:07:23 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: omap_edma.c,v 1.5 2021/09/16 22:19:10 andvar Exp $ */
+/* $NetBSD: omap_edma.c,v 1.6 2022/05/21 19:07:23 andvar Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.5 2021/09/16 22:19:10 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap_edma.c,v 1.6 2022/05/21 19:07:23 andvar Exp $");
 
 #include "opt_omap.h"
 
@@ -383,7 +383,7 @@ edma_channel_free(struct edma_channel *c
 }
 
 /*
- * Allocate a PaRAM entry. The driver artifically restricts the number
+ * Allocate a PaRAM entry. The driver artificially restricts the number
  * of PaRAM entries available for each channel to MAX_PARAM_PER_CHANNEL.
  * If the number of entries for the channel has been exceeded, or there
  * are no entries available, 0x is returned.

Index: src/sys/arch/arm/ti/ti_edma.c
diff -u src/sys/arch/arm/ti/ti_edma.c:1.4 src/sys/arch/arm/ti/ti_edma.c:1.5
--- src/sys/arch/arm/ti/ti_edma.c:1.4	Thu Sep 16 22:19:10 2021
+++ src/sys/arch/arm/ti/ti_edma.c	Sat May 21 19:07:23 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_edma.c,v 1.4 2021/09/16 22:19:10 andvar Exp $ */
+/* $NetBSD: ti_edma.c,v 1.5 2022/05/21 19:07:23 andvar Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ti_edma.c,v 1.4 2021/09/16 22:19:10 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_edma.c,v 1.5 2022/05/21 19:07:23 andvar Exp $");
 
 #include 
 #include 
@@ -353,7 +353,7 @@ edma_channel_free(struct edma_channel *c
 }
 
 /*
- * Allocate a PaRAM entry. The driver artifically restricts the number
+ * Allocate a PaRAM entry. The driver artificially restricts the number
  * of PaRAM entries available for each channel to MAX_PARAM_PER_CHANNEL.
  * If the number of entries for the channel has been exceeded, or there
  * are no entries available, 0x is returned.

Index: src/sys/dev/ic/scmdreg.h
diff -u src/sys/dev/ic/scmdreg.h:1.1 src/sys/dev/ic/scmdreg.h:1.2
--- src/sys/dev/ic/scmdreg.h:1.1	Tue Dec  7 17:39:54 2021
+++ src/sys/dev/ic/scmdreg.h	Sat May 21 19:07:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: scmdreg.h,v 1.1 2021/12/07 17:39:54 brad Exp $	*/
+/*	$NetBSD: scmdreg.h,v 1.2 2022/05/21 19:07:23 andvar Exp $	*/
 
 /*
  * Copyright (c) 2021 Brad Spencer 
@@ -224,7 +224,7 @@
 #define SCMD_REG_SIZE			0x7F /* Size of the register space including the holes */
 #define SCMD_REMOTE_ADDR_LOW		0x50 /* The first remote I2C addreess */
 #define SCMD_REMOTE_ADDR_HIGH		0x5F /* The last remote I2C address */
-#define SCMD_HOLE_VALUE			0x55 /* Artifical value on read for a hole register */
+#define SCMD_HOLE_VALUE			0x55 /* Artificial value on read for a hole register */
 #define SCMD_IS_HOLE(r) \
 ((r >= SCMD_REG_HOLE_1_LOW && r <= SCMD_REG_HOLE_1_HIGH) || \
 (r >= SCMD_REG_HOLE_2_LOW && r <= SCMD_REG_HOLE_2_HIGH))



CVS commit: src/sys

2022-05-21 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat May 21 19:07:23 UTC 2022

Modified Files:
src/sys/arch/arm/omap: omap_edma.c
src/sys/arch/arm/ti: ti_edma.c
src/sys/dev/ic: scmdreg.h

Log Message:
s/artifical/artificial/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/omap/omap_edma.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/ti/ti_edma.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/scmdreg.h

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 19:02:15 UTC 2022

Modified Files:
src/games/gomoku: main.c stoc.c

Log Message:
gomoku: fix error handling when reading moves from a file

The columns of the board are labeled from A to H and J to T, which makes
I5 or i5 an invalid coordinate.  Previously, reading this invalid
coordinate from a file resulted in the string "<6" appearing in the move
log.

The 'i' was converted into the nonexistent column 20, and PT(20, 5) got
an out-of-bounds argument, resulting in spot 120.  Converting this spot
back into coordinates resulted in PT(0, 6).  The '<' comes from
'letters[0]'.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/games/gomoku/main.c
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/stoc.c

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

Modified files:

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.48 src/games/gomoku/main.c:1.49
--- src/games/gomoku/main.c:1.48	Sat May 21 17:19:10 2022
+++ src/games/gomoku/main.c	Sat May 21 19:02:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.49 2022/05/21 19:02:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.49 2022/05/21 19:02:14 rillig Exp $");
 
 #include 
 #include 
@@ -235,7 +235,7 @@ again:
 		switch (input[color]) {
 		case INPUTF: /* input comes from a file */
 			curmove = readinput(inputfp);
-			if (curmove != ILLEGAL)
+			if (curmove != EOF)
 break;
 			/* Switch to another input source. */
 			switch (test) {
@@ -305,7 +305,7 @@ again:
 			curmove = pickmove(color);
 			break;
 		}
-		if (interactive) {
+		if (interactive && curmove != ILLEGAL) {
 			misclog("%3d%*s%-6s", movenum,
 			color == BLACK ? 2 : 9, "", stoc(curmove));
 		}
@@ -372,7 +372,7 @@ readinput(FILE *fp)
 	while ((c = getc(fp)) != EOF && c != '\n' && pos < sizeof(buf) - 1)
 		buf[pos++] = c;
 	buf[pos] = '\0';
-	return ctos(buf);
+	return c == EOF ? EOF : ctos(buf);
 }
 
 #ifdef DEBUG

Index: src/games/gomoku/stoc.c
diff -u src/games/gomoku/stoc.c:1.19 src/games/gomoku/stoc.c:1.20
--- src/games/gomoku/stoc.c:1.19	Sat May 21 17:19:10 2022
+++ src/games/gomoku/stoc.c	Sat May 21 19:02:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $	*/
+/*	$NetBSD: stoc.c,v 1.20 2022/05/21 19:02:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)stoc.c	8.1 (Berkeley) 7/24/94	*/
-__RCSID("$NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.20 2022/05/21 19:02:14 rillig Exp $");
 
 #include 
 #include 
@@ -43,19 +43,6 @@ __RCSID("$NetBSD: stoc.c,v 1.19 2022/05/
 
 const char	letters[]	= "";
 
-struct mvstr {
-	int	m_code;
-	const char	*m_text;
-};
-static	const struct	mvstr	mv[] = {
-	{ RESIGN,	"resign" },
-	{ RESIGN,	"quit" },
-	{ SAVE,		"save" },
-	{ -1,		0 }
-};
-
-static int lton(int);
-
 
 /*
  * Turn the spot number form of a move into the character form.
@@ -65,9 +52,10 @@ stoc(int s)
 {
 	static char buf[32];
 
-	for (int i = 0; mv[i].m_code >= 0; i++)
-		if (s == mv[i].m_code)
-			return mv[i].m_text;
+	if (s == RESIGN)
+		return "resign";
+	if (s == SAVE)
+		return "save";
 	snprintf(buf, sizeof(buf), "%c%d",
 	letters[s % (BSZ + 1)], s / (BSZ + 1));
 	return buf;
@@ -80,28 +68,21 @@ int
 ctos(const char *mp)
 {
 
-	for (int i = 0; mv[i].m_code >= 0; i++)
-		if (strcmp(mp, mv[i].m_text) == 0)
-			return mv[i].m_code;
-	if (!isalpha((unsigned char)mp[0]))
+	if (strcmp(mp, "resign") == 0 || strcmp(mp, "quit") == 0)
+		return RESIGN;
+	if (strcmp(mp, "save") == 0)
+		return SAVE;
+
+	int letter = toupper((unsigned char)mp[0]);
+	int x = 1;
+	while (x <= BSZ && letters[x] != letter)
+		x++;
+	if (x > BSZ)
 		return ILLEGAL;
-	int i = atoi([1]);
-	if (i < 1 || i > 19)
-		return ILLEGAL;
-	return PT(lton((unsigned char)mp[0]), i);
-}
 
-/*
- * Turn a letter into a number.
- */
-static int
-lton(int c)
-{
-	int i;
+	int y = atoi([1]);
+	if (y < 1 || y > 19)
+		return ILLEGAL;
 
-	if (islower(c))
-		c = toupper(c);
-	for (i = 1; i <= BSZ && letters[i] != c; i++)
-		;
-	return i;
+	return PT(x, y);
 }



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 19:02:15 UTC 2022

Modified Files:
src/games/gomoku: main.c stoc.c

Log Message:
gomoku: fix error handling when reading moves from a file

The columns of the board are labeled from A to H and J to T, which makes
I5 or i5 an invalid coordinate.  Previously, reading this invalid
coordinate from a file resulted in the string "<6" appearing in the move
log.

The 'i' was converted into the nonexistent column 20, and PT(20, 5) got
an out-of-bounds argument, resulting in spot 120.  Converting this spot
back into coordinates resulted in PT(0, 6).  The '<' comes from
'letters[0]'.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/games/gomoku/main.c
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/stoc.c

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



CVS commit: src/sys/external/bsd/drm2/dist/drm

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 17:50:21 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_drv.h nouveau_ttm.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ttm.c

Log Message:
drm: Nix driver-specific DRM_FILE_PAGE_OFFSET defs and tests.

This was consolidated upstream into the vma manager.

PR kern/56812


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.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/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h:1.3	Sun Dec 19 10:50:13 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h	Sat May 21 17:50:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_drv.h,v 1.3 2021/12/19 10:50:13 riastradh Exp $	*/
+/*	$NetBSD: nouveau_drv.h,v 1.4 2022/05/21 17:50:21 riastradh Exp $	*/
 
 /* SPDX-License-Identifier: MIT */
 #ifndef __NOUVEAU_DRV_H__
@@ -67,12 +67,6 @@
 struct nouveau_channel;
 struct platform_device;
 
-#ifdef _LP64
-#define DRM_FILE_PAGE_OFFSET (0x1ULL >> PAGE_SHIFT)
-#else
-#define DRM_FILE_PAGE_OFFSET (0xa000UL >> PAGE_SHIFT)
-#endif
-
 #include "nouveau_fence.h"
 #include "nouveau_bios.h"
 #include "nouveau_vmm.h"

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c:1.9 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c:1.9	Sun Dec 19 10:51:56 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c	Sat May 21 17:50:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_ttm.c,v 1.9 2021/12/19 10:51:56 riastradh Exp $	*/
+/*	$NetBSD: nouveau_ttm.c,v 1.10 2022/05/21 17:50:21 riastradh Exp $	*/
 
 // SPDX-License-Identifier: GPL-2.0 OR MIT
 /*
@@ -25,7 +25,7 @@
  * USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_ttm.c,v 1.9 2021/12/19 10:51:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_ttm.c,v 1.10 2022/05/21 17:50:21 riastradh Exp $");
 
 #include 
 #include 	/* pmap_pv_track/untrack */
@@ -177,12 +177,8 @@ nouveau_ttm_mmap_object(struct drm_devic
 
 	KASSERT(0 == (offset & (PAGE_SIZE - 1)));
 
-	if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET))
-		return drm_legacy_mmap_object(dev, offset, size, prot, uobjp,
-		uoffsetp, file);
-	else
-		return ttm_bo_mmap_object(>ttm.bdev, offset, size, prot,
-		uobjp, uoffsetp, file);
+	return ttm_bo_mmap_object(>ttm.bdev, offset, size, prot,
+	uobjp, uoffsetp, file);
 }
 
 #else

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.24 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.25
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c:1.24	Thu Dec 23 17:09:25 2021
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c	Sat May 21 17:50:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_ttm.c,v 1.24 2021/12/23 17:09:25 hannken Exp $	*/
+/*	$NetBSD: radeon_ttm.c,v 1.25 2022/05/21 17:50:21 riastradh Exp $	*/
 
 /*
  * Copyright 2009 Jerome Glisse.
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.24 2021/12/23 17:09:25 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c,v 1.25 2022/05/21 17:50:21 riastradh Exp $");
 
 #include 
 #include 
@@ -65,12 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_ttm.c
 #include 
 #endif
 
-#ifdef _LP64
-#define DRM_FILE_PAGE_OFFSET (0x1ULL >> PAGE_SHIFT)
-#else
-#define DRM_FILE_PAGE_OFFSET (0xa000UL >> PAGE_SHIFT)
-#endif
-
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev);
 static void radeon_ttm_debugfs_fini(struct radeon_device *rdev);
 
@@ -1108,9 +1102,6 @@ radeon_mmap_object(struct drm_device *de
 	if (__predict_false(rdev == NULL))	/* XXX How?? */
 		return -EINVAL;
 
-	if (__predict_false((offset >> PAGE_SHIFT) < DRM_FILE_PAGE_OFFSET))
-		return -EINVAL;
-
 	return ttm_bo_mmap_object(>mman.bdev, offset, size, prot,
 	uobjp, uoffsetp, file);
 }



CVS commit: src/sys/external/bsd/drm2/dist/drm

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 17:50:21 UTC 2022

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_drv.h nouveau_ttm.c
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_ttm.c

Log Message:
drm: Nix driver-specific DRM_FILE_PAGE_OFFSET defs and tests.

This was consolidated upstream into the vma manager.

PR kern/56812


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_drv.h
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_ttm.c
cvs rdiff -u -r1.24 -r1.25 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_ttm.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 17:19:11 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c stoc.c

Log Message:
gomoku: right-align column header for move number


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.37 -r1.38 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.47 -r1.48 src/games/gomoku/main.c
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/stoc.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 17:19:11 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c stoc.c

Log Message:
gomoku: right-align column header for move number


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.37 -r1.38 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.47 -r1.48 src/games/gomoku/main.c
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/stoc.c

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.41 src/games/gomoku/bdisp.c:1.42
--- src/games/gomoku/bdisp.c:1.41	Sat May 21 15:21:40 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.42 2022/05/21 17:19:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.42 2022/05/21 17:19:10 rillig Exp $");
 
 #include 
 #include 
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: bdisp.c,v 1.41 2022/05
 #define	SCRNW		80		/* assume 80 chars for the moment */
 
 static	int	lastline;
-static	char	pcolor[] = "*O.?";
+static	const char pcolor[] = "*O.?";
 
 #define	scr_y(by)	(1 + (BSZ - 1) - ((by) - 1))
 #define	scr_x(bx)	(3 + 2 * ((bx) - 1))
@@ -107,12 +107,12 @@ bdisp_init(void)
 
 	/* left and right edges */
 	for (int j = BSZ + 1; --j > 0; ) {
-		mvprintw(scr_y(j), 0, "%2d ", j);
-		mvprintw(scr_y(j), scr_x(BSZ) + 2, "%d ", j);
+		mvprintw(scr_y(j), 0, "%2d", j);
+		mvprintw(scr_y(j), scr_x(BSZ) + 2, "%d", j);
 	}
 
 	bdwho();
-	mvaddstr(0, TRANSCRIPT_COL + 1, "#  black  white");
+	mvaddstr(0, TRANSCRIPT_COL, "  #  black  white");
 	lastline = 0;
 	bdisp();
 }

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.37 src/games/gomoku/gomoku.h:1.38
--- src/games/gomoku/gomoku.h:1.37	Sat May 21 16:39:14 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.37 2022/05/21 16:39:14 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.38 2022/05/21 17:19:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -215,7 +215,7 @@ struct	spotstr {
 #define BFLAG		0x01	/* frame intersects border or dead */
 #define BFLAGALL	0x0F	/* all frames dead */
 
-extern	const char	*letters;
+extern	const char	letters[];
 extern	const char	pdir[];
 
 extern	const int dd[4];

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.47 src/games/gomoku/main.c:1.48
--- src/games/gomoku/main.c:1.47	Sat May 21 14:55:26 2022
+++ src/games/gomoku/main.c	Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $");
 
 #include 
 #include 
@@ -306,9 +306,8 @@ again:
 			break;
 		}
 		if (interactive) {
-			misclog("%3d%s%-6s", movenum,
-			color != BLACK ? "" : " ",
-			stoc(curmove));
+			misclog("%3d%*s%-6s", movenum,
+			color == BLACK ? 2 : 9, "", stoc(curmove));
 		}
 		if ((i = makemove(color, curmove)) != MOVEOK)
 			break;

Index: src/games/gomoku/stoc.c
diff -u src/games/gomoku/stoc.c:1.18 src/games/gomoku/stoc.c:1.19
--- src/games/gomoku/stoc.c:1.18	Thu May 19 22:19:18 2022
+++ src/games/gomoku/stoc.c	Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: stoc.c,v 1.18 2022/05/19 22:19:18 rillig Exp $	*/
+/*	$NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,14 +34,14 @@
 
 #include 
 /*	@(#)stoc.c	8.1 (Berkeley) 7/24/94	*/
-__RCSID("$NetBSD: stoc.c,v 1.18 2022/05/19 22:19:18 rillig Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $");
 
 #include 
 #include 
 #include 
 #include "gomoku.h"
 
-const char	*letters	= "";
+const char	letters[]	= "";
 
 struct mvstr {
 	int	m_code;



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 16:39:14 UTC 2022

Modified Files:
src/games/gomoku: bdinit.c gomoku.h makemove.c pickmove.c

Log Message:
gomoku: provide readable names for c.a and c.b

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.36 -r1.37 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/makemove.c
cvs rdiff -u -r1.41 -r1.42 src/games/gomoku/pickmove.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 16:39:14 UTC 2022

Modified Files:
src/games/gomoku: bdinit.c gomoku.h makemove.c pickmove.c

Log Message:
gomoku: provide readable names for c.a and c.b

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.36 -r1.37 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/makemove.c
cvs rdiff -u -r1.41 -r1.42 src/games/gomoku/pickmove.c

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

Modified files:

Index: src/games/gomoku/bdinit.c
diff -u src/games/gomoku/bdinit.c:1.20 src/games/gomoku/bdinit.c:1.21
--- src/games/gomoku/bdinit.c:1.20	Sat May 21 15:11:24 2022
+++ src/games/gomoku/bdinit.c	Sat May 21 16:39:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdinit.c,v 1.20 2022/05/21 15:11:24 rillig Exp $	*/
+/*	$NetBSD: bdinit.c,v 1.21 2022/05/21 16:39:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	from: @(#)bdinit.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdinit.c,v 1.20 2022/05/21 15:11:24 rillig Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.21 2022/05/21 16:39:14 rillig Exp $");
 
 #include 
 #include "gomoku.h"
@@ -186,7 +186,7 @@ init_overlap(void)
 	 * s = 5 if closed, 6 if open.
 	 * At this point black & white are the same.
 	 */
-	int s = 5 + sp1->s_fval[BLACK][cbp->c_dir].c.b;
+	int s = 5 + sp1->s_fval[BLACK][cbp->c_dir].cv_win;
 	/* for each spot in frame A */
 	for (int i = 0; i < s; i++, sp1 += d1, vertex += d1) {
 		/* the sixth spot in frame A only overlaps if it is open */

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.36 src/games/gomoku/gomoku.h:1.37
--- src/games/gomoku/gomoku.h:1.36	Sat May 21 15:21:40 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 16:39:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.36 2022/05/21 15:21:40 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.37 2022/05/21 16:39:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -75,8 +75,8 @@
 
 /*
  * A 'combo' is a group of intersecting frames and consists of two numbers:
- * 'A' is the number of moves to make the combo non-blockable.
- * 'B' is the minimum number of moves needed to win once it can't be blocked.
+ * 'F' is the number of moves to make the combo non-blockable.
+ * 'W' is the minimum number of moves needed to win once it can't be blocked.
  *
  * A 'force' is a combo that is one move away from being non-blockable.
  *
@@ -88,13 +88,13 @@
  * it is already a force. Also, the frames have to be independent so a
  * single move doesn't affect more than one frame making up the combo.
  *
- * Rules for comparing which of two combos ( ) is better:
+ * Rules for comparing which of two combos ( ) is better:
  * Both the same color:
- *	 = (A1 < A2 || A1 == A2 && B1 <= B2) ?  : 
+ *	 = (F1 < F2 || F1 == F2 && W1 <= W2) ?  : 
  *	We want to complete the force first, then the combo with the
  *	fewest moves to win.
- * Different colors,  is the combo for the player with the next move:
- *	 = A2 <= 1 && (A1 > 1 || A2 + B2 < A1 + B1) ?  : 
+ * Different colors,  is the combo for the player with the next move:
+ *	 = F2 <= 1 && (F1 > 1 || F2 + W2 < F1 + W1) ?  : 
  *	We want to block only if we have to (i.e., if they are one move away
  *	from completing a force, and we don't have a force that we can
  *	complete which takes fewer or the same number of moves to win).
@@ -102,7 +102,7 @@
 
 /*
  * Single frame combo values:
- * 	board values
+ * 	board values
  *	5,0	. . . . . O
  *	4,1	. . . . . .
  *	4,0	. . . . X O
@@ -115,24 +115,26 @@
  *	0,1	. X X X X .
  *	0,0	X X X X X O
  *
- * The rule for combining two combos ( ) with V valid
+ * The rule for combining two combos ( ) with V valid
  * intersection points is:
- *	A' = A1 + A2 - 2 - V
- *	B' = MIN(A1 + B1 - 1, A2 + B2 - 1)
+ *	F' = F1 + F2 - 2 - V
+ *	W' = MIN(F1 + W1 - 1, F2 + W2 - 1)
  */
 union comboval {
 	struct {
 #if BYTE_ORDER == BIG_ENDIAN
-		u_char	a;	/* # moves to complete force */
-		u_char	b;	/* # moves to win */
+		u_char	a;
+		u_char	b;
 #endif
 #if BYTE_ORDER == LITTLE_ENDIAN
-		u_char	b;	/* # moves to win */
-		u_char	a;	/* # moves to complete force */
+		u_char	b;
+		u_char	a;
 #endif
 	} c;
 	u_short	s;
 };
+#define cv_force	c.a	/* # moves to complete force */
+#define cv_win		c.b	/* # moves to win */
 
 /*
  * This structure is used to record information about single frames (F) and

Index: src/games/gomoku/makemove.c
diff -u src/games/gomoku/makemove.c:1.19 src/games/gomoku/makemove.c:1.20
--- src/games/gomoku/makemove.c:1.19	Sat May 21 15:11:24 2022
+++ src/games/gomoku/makemove.c	Sat May 21 16:39:14 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemove.c,v 1.19 2022/05/21 15:11:24 rillig Exp $	*/
+/*	$NetBSD: makemove.c,v 1.20 2022/05/21 16:39:14 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)makemove.c	8.2 (Berkeley) 

CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 15:21:40 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h

Log Message:
gomoku: move comments closer to their corresponding entities

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.35 -r1.36 src/games/gomoku/gomoku.h

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.40 src/games/gomoku/bdisp.c:1.41
--- src/games/gomoku/bdisp.c:1.40	Sat May 21 12:29:34 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 15:21:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.40 2022/05/21 12:29:34 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.40 2022/05/21 12:29:34 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $");
 
 #include 
 #include 
@@ -51,6 +51,8 @@ static	char	pcolor[] = "*O.?";
 #define	scr_y(by)	(1 + (BSZ - 1) - ((by) - 1))
 #define	scr_x(bx)	(3 + 2 * ((bx) - 1))
 
+#define TRANSCRIPT_COL	(3 + (2 * BSZ - 1) + 3 + 3)
+
 /*
  * Initialize screen display.
  */

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.35 src/games/gomoku/gomoku.h:1.36
--- src/games/gomoku/gomoku.h:1.35	Sat May 21 15:11:24 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 15:21:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.35 2022/05/21 15:11:24 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.36 2022/05/21 15:21:40 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -39,13 +39,18 @@
 #include 
 #include 
 
-/* board dimensions */
+/*
+ * The board consists of 19x19 spots, the coordinates are 1-based. The board
+ * is surrounded by border spots.
+ */
+
 #define BSZ	19
 #define BAREA	((1 + BSZ + 1) * (BSZ + 1) + 1)
 
-#define TRANSCRIPT_COL	(3 + (2 * BSZ - 1) + 3 + 3)
-
-/* frame dimensions (based on 5 in a row) */
+/*
+ * A 'frame' is a group of five or six contiguous board locations. An
+ * open-ended frame is one with spaces on both ends; otherwise, it is closed.
+ */
 #define FAREA	(2 * BSZ * (BSZ - 4) + 2 * (BSZ - 4) * (BSZ - 4))
 
 #define MUP	(BSZ + 1)
@@ -69,31 +74,12 @@
 #define PT(x, y)	((x) + (BSZ + 1) * (y))
 
 /*
- * A 'frame' is a group of five or six contiguous board locations.
- * An open-ended frame is one with spaces on both ends; otherwise, its closed.
  * A 'combo' is a group of intersecting frames and consists of two numbers:
  * 'A' is the number of moves to make the combo non-blockable.
  * 'B' is the minimum number of moves needed to win once it can't be blocked.
- * A 'force' is a combo that is one move away from being non-blockable
  *
- * Single frame combo values:
- * 	board values
- *	5,0	. . . . . O
- *	4,1	. . . . . .
- *	4,0	. . . . X O
- *	3,1	. . . . X .
- *	3,0	. . . X X O
- *	2,1	. . . X X .
- *	2,0	. . X X X O
- *	1,1	. . X X X .
- *	1,0	. X X X X O
- *	0,1	. X X X X .
- *	0,0	X X X X X O
+ * A 'force' is a combo that is one move away from being non-blockable.
  *
- * The rule for combining two combos ( )
- * with V valid intersection points, is:
- *	A' = A1 + A2 - 2 - V
- *	B' = MIN(A1 + B1 - 1, A2 + B2 - 1)
  * Each time a frame is added to the combo, the number of moves to complete
  * the force is the number of moves needed to 'fill' the frame plus one at
  * the intersection point. The number of moves to win is the number of moves
@@ -114,6 +100,26 @@
  *	complete which takes fewer or the same number of moves to win).
  */
 
+/*
+ * Single frame combo values:
+ * 	board values
+ *	5,0	. . . . . O
+ *	4,1	. . . . . .
+ *	4,0	. . . . X O
+ *	3,1	. . . . X .
+ *	3,0	. . . X X O
+ *	2,1	. . . X X .
+ *	2,0	. . X X X O
+ *	1,1	. . X X X .
+ *	1,0	. X X X X O
+ *	0,1	. X X X X .
+ *	0,0	X X X X X O
+ *
+ * The rule for combining two combos ( ) with V valid
+ * intersection points is:
+ *	A' = A1 + A2 - 2 - V
+ *	B' = MIN(A1 + B1 - 1, A2 + B2 - 1)
+ */
 union comboval {
 	struct {
 #if BYTE_ORDER == BIG_ENDIAN



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 15:21:40 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h

Log Message:
gomoku: move comments closer to their corresponding entities

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.35 -r1.36 src/games/gomoku/gomoku.h

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 15:11:24 UTC 2022

Modified Files:
src/games/gomoku: bdinit.c gomoku.h makemove.c pickmove.c

Log Message:
gomoku: inline macro MAXCOMBO

The name of the macro was not descriptive enough, the other constants in
bdinit also don't have names.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.34 -r1.35 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/makemove.c
cvs rdiff -u -r1.40 -r1.41 src/games/gomoku/pickmove.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 15:11:24 UTC 2022

Modified Files:
src/games/gomoku: bdinit.c gomoku.h makemove.c pickmove.c

Log Message:
gomoku: inline macro MAXCOMBO

The name of the macro was not descriptive enough, the other constants in
bdinit also don't have names.

No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/games/gomoku/bdinit.c
cvs rdiff -u -r1.34 -r1.35 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/makemove.c
cvs rdiff -u -r1.40 -r1.41 src/games/gomoku/pickmove.c

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

Modified files:

Index: src/games/gomoku/bdinit.c
diff -u src/games/gomoku/bdinit.c:1.19 src/games/gomoku/bdinit.c:1.20
--- src/games/gomoku/bdinit.c:1.19	Thu May 19 22:29:36 2022
+++ src/games/gomoku/bdinit.c	Sat May 21 15:11:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdinit.c,v 1.19 2022/05/19 22:29:36 rillig Exp $	*/
+/*	$NetBSD: bdinit.c,v 1.20 2022/05/21 15:11:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	from: @(#)bdinit.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdinit.c,v 1.19 2022/05/19 22:29:36 rillig Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.20 2022/05/21 15:11:24 rillig Exp $");
 
 #include 
 #include "gomoku.h"
@@ -68,12 +68,12 @@ bdinit(struct spotstr *bp)
 /* directions 1, 2, 3 are blocked */
 sp->s_flags |= (BFLAG << 1) | (BFLAG << 2) |
 (BFLAG << 3);
-sp->s_fval[BLACK][1].s = MAXCOMBO;
-sp->s_fval[BLACK][2].s = MAXCOMBO;
-sp->s_fval[BLACK][3].s = MAXCOMBO;
-sp->s_fval[WHITE][1].s = MAXCOMBO;
-sp->s_fval[WHITE][2].s = MAXCOMBO;
-sp->s_fval[WHITE][3].s = MAXCOMBO;
+sp->s_fval[BLACK][1].s = 0x600;
+sp->s_fval[BLACK][2].s = 0x600;
+sp->s_fval[BLACK][3].s = 0x600;
+sp->s_fval[WHITE][1].s = 0x600;
+sp->s_fval[WHITE][2].s = 0x600;
+sp->s_fval[WHITE][3].s = 0x600;
 			} else if (j == 5) {
 /* five spaces, blocked on one side */
 sp->s_fval[BLACK][1].s = 0x500;
@@ -94,10 +94,10 @@ bdinit(struct spotstr *bp)
 			if (i > (BSZ - 4)) {
 /* directions 0, 1 are blocked */
 sp->s_flags |= BFLAG | (BFLAG << 1);
-sp->s_fval[BLACK][0].s = MAXCOMBO;
-sp->s_fval[BLACK][1].s = MAXCOMBO;
-sp->s_fval[WHITE][0].s = MAXCOMBO;
-sp->s_fval[WHITE][1].s = MAXCOMBO;
+sp->s_fval[BLACK][0].s = 0x600;
+sp->s_fval[BLACK][1].s = 0x600;
+sp->s_fval[WHITE][0].s = 0x600;
+sp->s_fval[WHITE][1].s = 0x600;
 			} else if (i == (BSZ - 4)) {
 sp->s_fval[BLACK][0].s = 0x500;
 sp->s_fval[WHITE][0].s = 0x500;
@@ -112,8 +112,8 @@ bdinit(struct spotstr *bp)
 if (i < 5) {
 	/* direction 3 is blocked */
 	sp->s_flags |= (BFLAG << 3);
-	sp->s_fval[BLACK][3].s = MAXCOMBO;
-	sp->s_fval[WHITE][3].s = MAXCOMBO;
+	sp->s_fval[BLACK][3].s = 0x600;
+	sp->s_fval[WHITE][3].s = 0x600;
 } else if (i == 5 &&
 (sp->s_flags & (BFLAG << 3)) == 0) {
 	sp->s_fval[BLACK][3].s = 0x500;

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.34 src/games/gomoku/gomoku.h:1.35
--- src/games/gomoku/gomoku.h:1.34	Sat May 21 14:55:26 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 15:11:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.34 2022/05/21 14:55:26 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.35 2022/05/21 15:11:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -114,8 +114,6 @@
  *	complete which takes fewer or the same number of moves to win).
  */
 
-#define MAXCOMBO	0x600
-
 union comboval {
 	struct {
 #if BYTE_ORDER == BIG_ENDIAN

Index: src/games/gomoku/makemove.c
diff -u src/games/gomoku/makemove.c:1.18 src/games/gomoku/makemove.c:1.19
--- src/games/gomoku/makemove.c:1.18	Thu May 19 22:19:18 2022
+++ src/games/gomoku/makemove.c	Sat May 21 15:11:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemove.c,v 1.18 2022/05/19 22:19:18 rillig Exp $	*/
+/*	$NetBSD: makemove.c,v 1.19 2022/05/21 15:11:24 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)makemove.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: makemove.c,v 1.18 2022/05/19 22:19:18 rillig Exp $");
+__RCSID("$NetBSD: makemove.c,v 1.19 2022/05/21 15:11:24 rillig Exp $");
 
 #include "gomoku.h"
 
@@ -128,8 +128,8 @@ makemove(int us, int mv)
 		else {
 			/* this frame is now blocked, adjust values */
 			fsp->s_flags |= bmask;
-			fsp->s_fval[BLACK][r].s = MAXCOMBO;
-			fsp->s_fval[WHITE][r].s = MAXCOMBO;
+			fsp->s_fval[BLACK][r].s = 0x600;
+			fsp->s_fval[WHITE][r].s = 0x600;
 			while (--i >= 0) {
 			sp += d;
 			if (sp->s_occ == EMPTY)
@@ -144,7 +144,7 @@ makemove(int us, int mv)
 		return(WIN);
 
 		/* compute new value & combo number for this frame & color */
-		fsp->s_fval[us != BLACK ? BLACK : WHITE][r].s = MAXCOMBO;
+		fsp->s_fval[us != BLACK ? BLACK : WHITE][r].s = 0x600;
 		cp = >s_fval[us][r];
 		/* both ends open? */
 		if (space && sp->s_occ == EMPTY) {

CVS commit: src/doc

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 15:03:08 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: Expand notes on vether(4) and tap(4).


To generate a diff of this commit:
cvs rdiff -u -r1.2874 -r1.2875 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.2874 src/doc/CHANGES:1.2875
--- src/doc/CHANGES:1.2874	Sat May 21 14:58:20 2022
+++ src/doc/CHANGES	Sat May 21 15:03:08 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2874 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2875 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -288,7 +288,12 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		pmap module.  Implemented fast-soft-interrupts.  Enabled
 		MULTIPROCESSOR in GENERIC.  [thorpej 20200918]
 	ld.so(1): Upgrade r_debug to the protocol version 1. [kamil 20200921]
-	vether(4): Imported from OpenBSD. [roy 20200927]
+	vether(4): New virtual ethernet interface for bridging to physical
+		interfaces, imported from OpenBSD.  [roy 20200927]
+	tap(4): Link state now reflects whether device is open by a process.
+	For virtual ethernet interfaces not associated with a
+		backing process to bridge with physical interfaces, use
+		vether(4).  [roy 20200927]
 	dhcpcd: Update to version 9.3.0 [roy 20201005]
 	tzdata updated to 2020b  [kre 20201008]
 	tzcode: Updated to 2020b. [christos 20201009]



CVS commit: src/doc

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 15:03:08 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: Expand notes on vether(4) and tap(4).


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

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



CVS commit: src/doc

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 14:58:20 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2873 -r1.2874 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.2873 src/doc/CHANGES:1.2874
--- src/doc/CHANGES:1.2873	Mon May  9 07:20:18 2022
+++ src/doc/CHANGES	Sat May 21 14:58:20 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2873 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2874 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -326,10 +326,10 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	resize: Import Xterm's resize(1) for querying (x)terminal sizes in
 		base for headless clients [reinoud 20201227]
 	dhcpcd: Update to version 9.4.0 [roy 20201228]
-	tzdata updated to 2020f (includes update to 2020e)  [kre 20201231] 
+	tzdata updated to 2020f (includes update to 2020e)  [kre 20201231]
 	evbarm: Add support for Amlogic G12 family SoCs. [ryo 20210101]
 	pppd(8): updated to version 2.4.9. [christos 20210109]
-	tzdata updated to 2021a [kre 20210124] 
+	tzdata updated to 2021a [kre 20210124]
 	evbmips: Add support for QEMU "mipssim" emulator. [simonb 20210127]
 	x68k: Add Emulate3Buttons support to X68k Xorg based monolithic server.
 		[tsutsui 20210207]
@@ -395,7 +395,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	hp300: Add support of multiple rd(4) disks on all punits for HPDisk.
 		[tsutsui 20210709]
 	GMP: Import 6.2.1 [mrg 20210711]
-	kernel: Tie the maximum file lock per unprivilegied uid to 
+	kernel: Tie the maximum file lock per unprivilegied uid to
 		kern.maxfiles [manu 20210727]
 	evbppc: Switch ibm4xx to generic evbppc kernel modules. [rin 20210803]
 	evbarm: Add support for Arm PCI Configuration Space Access Firmware
@@ -437,7 +437,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		and integrated them into the synaptics(4) driver and
 		xf86-input-ws. [nia 20210928]
 	gnu-efi: Import version 3.0.14. [jmcneill 20210930]
-	tzdata partly updated to 2021b [kre 20211001] 
+	tzdata partly updated to 2021b [kre 20211001]
 	sht4xtemp(4): Driver for the Sensirion SHT40/SHT41/SHT45 temperature
 		and humidity sensor [brad 20211003]
 	network: Make pktq_rps_hash() pluggable for each interface type.
@@ -449,7 +449,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	aarch64: Enable MKRELRO and MKPIE by default. [nia 20211014]
 	dhcpcd(8): Update to dhcpcd-9.4.1. [roy 20211022]
 	tzcode: Updated to 2021e. [christos 20211022]
-	tzdata: updated to 2021e (still missing trash from 2021b) [kre 20211022] 
+	tzdata: updated to 2021e (still missing trash from 2021b) [kre 20211022]
 	passwd.conf(5): Make 'argon2id' the default cipher for new
 		passwords. [nia 20211026]
 	acpi(4): Updated ACPICA to 20210930. [christos 20211028]
@@ -485,7 +485,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[reinoud 20220309]
 	OpenSSL: Imported 1.1.1n. [christos 20220315]
 	tzdata: updated to 2022a (using the 2022agtz fork to restore data
-		from previously merged zones) [kre 20220320] 
+		from previously merged zones) [kre 20220320]
 	tzcode: Updated to 2022a. [christos 20220322]
 	dhcp: Import version 4.4.3. [christos 20220402]
 	udf: Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF. [reinoud 20220506]



CVS commit: src/doc

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 14:58:20 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc/CHANGES: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.2873 -r1.2874 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/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 14:55:26 UTC 2022

Modified Files:
src/games/gomoku: Makefile gomoku.h main.c

Log Message:
gomoku: convert input source constants to an enum

I also tried converting other macros, but s_occ would use more memory
and the return values for makemove are special values, besides the usual
coordinates in the form PT(x, y), so turning the special values into an
enum would be confusing.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/gomoku/Makefile
cvs rdiff -u -r1.33 -r1.34 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.46 -r1.47 src/games/gomoku/main.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 14:55:26 UTC 2022

Modified Files:
src/games/gomoku: Makefile gomoku.h main.c

Log Message:
gomoku: convert input source constants to an enum

I also tried converting other macros, but s_occ would use more memory
and the return values for makemove are special values, besides the usual
coordinates in the form PT(x, y), so turning the special values into an
enum would be confusing.

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/games/gomoku/Makefile
cvs rdiff -u -r1.33 -r1.34 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.46 -r1.47 src/games/gomoku/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/games/gomoku/Makefile
diff -u src/games/gomoku/Makefile:1.9 src/games/gomoku/Makefile:1.10
--- src/games/gomoku/Makefile:1.9	Mon May 16 21:48:45 2022
+++ src/games/gomoku/Makefile	Sat May 21 14:55:26 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2022/05/16 21:48:45 rillig Exp $
+#	$NetBSD: Makefile,v 1.10 2022/05/21 14:55:26 rillig Exp $
 #	@(#)Makefile	8.1 (Berkeley) 7/24/94
 
 PROG=	gomoku
@@ -11,5 +11,6 @@ CPPFLAGS+=	${DEBUG:D-DDEBUG}
 
 LINTFLAGS+=	-w	# treat warnings as errors
 LINTFLAGS+=	-T	# strict bool mode
+LINTFLAGS+=	-e	# strict enum checks
 
 .include 

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.33 src/games/gomoku/gomoku.h:1.34
--- src/games/gomoku/gomoku.h:1.33	Sat May 21 12:29:34 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 14:55:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.33 2022/05/21 12:29:34 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.34 2022/05/21 14:55:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -59,14 +59,13 @@
 #define EMPTY	2
 #define BORDER	3
 
-/* return values for makemove() */
+/* return values for makemove, readinput */
 #define MOVEOK	0
 #define RESIGN	1
 #define ILLEGAL	2
 #define WIN	3
 #define TIE	4
 #define SAVE	5
-
 #define PT(x, y)	((x) + (BSZ + 1) * (y))
 
 /*

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.46 src/games/gomoku/main.c:1.47
--- src/games/gomoku/main.c:1.46	Sat May 21 14:23:10 2022
+++ src/games/gomoku/main.c	Sat May 21 14:55:26 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.46 2022/05/21 14:23:10 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.46 2022/05/21 14:23:10 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $");
 
 #include 
 #include 
@@ -51,9 +51,11 @@ __RCSID("$NetBSD: main.c,v 1.46 2022/05/
 
 #include "gomoku.h"
 
-#define USER	0		/* get input from standard input */
-#define PROGRAM	1		/* get input from program */
-#define INPUTF	2		/* get input from a file */
+enum input_source {
+	USER,			/* get input from standard input */
+	PROGRAM,		/* get input from program */
+	INPUTF			/* get input from a file */
+};
 
 bool	interactive = true;	/* true if interactive */
 int	debug;			/* > 0 if debugging */
@@ -102,7 +104,7 @@ main(int argc, char **argv)
 	char fname[PATH_MAX];
 	char *user_name;
 	int color, curmove, i, ch;
-	int input[2];
+	enum input_source input[2];
 
 	/* Revoke setgid privileges */
 	setgid(getgid());
@@ -235,6 +237,7 @@ again:
 			curmove = readinput(inputfp);
 			if (curmove != ILLEGAL)
 break;
+			/* Switch to another input source. */
 			switch (test) {
 			case 0: /* user versus program */
 input[color] = USER;



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 14:23:10 UTC 2022

Modified Files:
src/games/gomoku: main.c

Log Message:
gomoku: shorten code, error out on too many arguments


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/games/gomoku/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/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.45 src/games/gomoku/main.c:1.46
--- src/games/gomoku/main.c:1.45	Sat May 21 12:29:34 2022
+++ src/games/gomoku/main.c	Sat May 21 14:23:10 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.45 2022/05/21 12:29:34 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.46 2022/05/21 14:23:10 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.45 2022/05/21 12:29:34 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.46 2022/05/21 14:23:10 rillig Exp $");
 
 #include 
 #include 
@@ -100,7 +100,7 @@ main(int argc, char **argv)
 {
 	char buf[128];
 	char fname[PATH_MAX];
-	char *tmp;
+	char *user_name;
 	int color, curmove, i, ch;
 	int input[2];
 
@@ -109,27 +109,20 @@ main(int argc, char **argv)
 
 	setprogname(argv[0]);
 
-	tmp = getlogin();
-	if (tmp != NULL) {
-		strlcpy(user, tmp, sizeof(user));
-	} else {
-		strcpy(user, "you");
-	}
+	user_name = getlogin();
+	strlcpy(user, user_name != NULL ? user_name : "you", sizeof(user));
 
 	color = curmove = 0;
 
 	prog = strrchr(argv[0], '/');
-	if (prog != NULL)
-		prog++;
-	else
-		prog = argv[0];
+	prog = prog != NULL ? prog + 1 : argv[0];
 
 	while ((ch = getopt(argc, argv, "bcdD:u")) != -1) {
 		switch (ch) {
 		case 'b':	/* background */
 			interactive = false;
 			break;
-		case 'd':	/* debugging */
+		case 'd':
 			debug++;
 			break;
 		case 'D':	/* log debug output to file */
@@ -143,6 +136,7 @@ main(int argc, char **argv)
 			test = 2;
 			break;
 		default:
+		usage:
 			fprintf(stderr, "usage: %s [-bcdu] [-Dfile] [file]\n",
 			getprogname());
 			return EXIT_FAILURE;
@@ -150,10 +144,10 @@ main(int argc, char **argv)
 	}
 	argc -= optind;
 	argv += optind;
-	if (argc != 0) {
-		if ((inputfp = fopen(*argv, "r")) == NULL)
-			err(1, "%s", *argv);
-	}
+	if (argc > 1)
+		goto usage;
+	if (argc == 1 && (inputfp = fopen(*argv, "r")) == NULL)
+		err(1, "%s", *argv);
 
 	if (debug == 0)
 		srandom((unsigned int)time(0));



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 14:23:10 UTC 2022

Modified Files:
src/games/gomoku: main.c

Log Message:
gomoku: shorten code, error out on too many arguments


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/games/gomoku/main.c

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



CVS commit: src/tests/crypto/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 13:31:29 UTC 2022

Modified Files:
src/tests/crypto/opencrypto: h_ioctl.c

Log Message:
opencrypto/h_ioctl: Print error messages with warn.

Might help track down what's going on when this fails.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/crypto/opencrypto/h_ioctl.c

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



CVS commit: src/tests/crypto/opencrypto

2022-05-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 21 13:31:29 UTC 2022

Modified Files:
src/tests/crypto/opencrypto: h_ioctl.c

Log Message:
opencrypto/h_ioctl: Print error messages with warn.

Might help track down what's going on when this fails.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/crypto/opencrypto/h_ioctl.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/crypto/opencrypto/h_ioctl.c
diff -u src/tests/crypto/opencrypto/h_ioctl.c:1.3 src/tests/crypto/opencrypto/h_ioctl.c:1.4
--- src/tests/crypto/opencrypto/h_ioctl.c:1.3	Wed Jun 14 21:43:02 2017
+++ src/tests/crypto/opencrypto/h_ioctl.c	Sat May 21 13:31:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: h_ioctl.c,v 1.3 2017/06/14 21:43:02 christos Exp $	*/
+/*	$NetBSD: h_ioctl.c,v 1.4 2022/05/21 13:31:29 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -88,7 +88,7 @@ test_ngsession(int fd)
 
 	ret = ioctl(fd, CIOCNGSESSION, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNGSESSION\n");
+		warn("failed: CIOCNGSESSION");
 
 	return ret;
 }
@@ -111,7 +111,7 @@ test_nfsession(int fd)
 
 	ret = ioctl(fd, CIOCNFSESSION, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNFSESSION\n");
+		warn("failed: CIOCNFSESSION");
 
 	return ret;
 }
@@ -143,7 +143,7 @@ test_ncryptm(int fd)
 
 	ret = ioctl(fd, CIOCNCRYPTM, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNCRYPTM\n");
+		warn("failed: CIOCNCRYPTM");
 
 	return ret;
 }
@@ -170,7 +170,7 @@ test_ncryptretm(int fd)
 	cs.key = __UNCONST(_key);
 	ret = ioctl(fd, CIOCGSESSION, );
 	if (ret < 0) {
-		fprintf(stderr, "failed: CIOCGSESSION\n");
+		warn("failed: CIOCGSESSION");
 		return ret;
 	}
 
@@ -191,7 +191,7 @@ test_ncryptretm(int fd)
 	mop.reqs = cnos;
 	ret = ioctl(fd, CIOCNCRYPTM, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNCRYPTM\n");
+		warn("failed: CIOCNCRYPTM");
 
 	for (size_t i = 0; i < COUNT; i++) {
 		struct crypt_result *cr = [i];
@@ -205,7 +205,7 @@ test_ncryptretm(int fd)
 	cret.results = crs;
 	ret = ioctl(fd, CIOCNCRYPTRETM, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNCRYPTRETM\n");
+		warn("failed: CIOCNCRYPTRETM");
 
 	return ret;
 }
@@ -225,8 +225,7 @@ test_ncryptret_noent(int fd)
 
 	ret = ioctl(fd, CIOCNCRYPTRET, );
 	if (ret == 0) {
-		fprintf(stderr,
-		"failed: CIOCNCRYPTRET unexpected success when no entry\n");
+		warn("failed: CIOCNCRYPTRET unexpected success when no entry");
 		ret = -1;
 	} else if (errno == EINPROGRESS) {
 		/* expected fail */
@@ -254,7 +253,7 @@ test_ncryptret_ent(int fd)
 	cs.key = __UNCONST(_key);
 	ret = ioctl(fd, CIOCGSESSION, );
 	if (ret < 0) {
-		fprintf(stderr, "failed: CIOCGSESSION\n");
+		warn("failed: CIOCGSESSION");
 		return ret;
 	}
 
@@ -271,14 +270,14 @@ test_ncryptret_ent(int fd)
 	mop.reqs = 
 	ret = ioctl(fd, CIOCNCRYPTM, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNCRYPTM\n");
+		warn("failed: CIOCNCRYPTM");
 
 	memset(, 0, sizeof(cr));
 	cr.reqid = cno.reqid;
 
 	ret = ioctl(fd, CIOCNCRYPTRET, );
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCNCRYPTRET\n");
+		warn("failed: CIOCNCRYPTRET");
 
 	return ret;
 }
@@ -309,7 +308,7 @@ set_userasymcrypto(int new, int *old)
 
 	ret = sysctlbyname("kern.userasymcrypto", NULL, NULL, , sizeof(new));
 	if (ret < 0) {
-		fprintf(stderr, "failed: kern.userasymcrypto=%d", new);
+		warn("failed: kern.userasymcrypto=%d", new);
 		return ret;
 	}
 
@@ -326,7 +325,7 @@ test_asymfeat_each(int fd, u_int32_t *as
 
 	ret = ioctl(fd, CIOCASYMFEAT, asymfeat);
 	if (ret < 0)
-		fprintf(stderr, "failed: CIOCASYMFEAT when userasym=%d\n", userasym);
+		warn("failed: CIOCASYMFEAT when userasym=%d", userasym);
 
 	return ret;
 }
@@ -358,7 +357,7 @@ test_asymfeat(int fd)
 	/* cleanup */
 	ret = set_userasymcrypto(orig, NULL);
 	if (ret < 0)
-		fprintf(stderr, "failed: cleanup kern.userasymcrypto\n");
+		warnx("failed: cleanup kern.userasymcrypto");
 
 	return ret;
 }



CVS commit: src/lib/libcurses

2022-05-21 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat May 21 12:34:45 UTC 2022

Modified Files:
src/lib/libcurses: curses_input.3

Log Message:
curses_input.3: wtimeout() returns void too


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

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

Modified files:

Index: src/lib/libcurses/curses_input.3
diff -u src/lib/libcurses/curses_input.3:1.29 src/lib/libcurses/curses_input.3:1.30
--- src/lib/libcurses/curses_input.3:1.29	Sat May 21 06:22:49 2022
+++ src/lib/libcurses/curses_input.3	Sat May 21 12:34:44 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_input.3,v 1.29 2022/05/21 06:22:49 charlotte Exp $
+.\"	$NetBSD: curses_input.3,v 1.30 2022/05/21 12:34:44 uwe Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -101,7 +101,7 @@
 .Fn notimeout "WINDOW *win" "bool flag"
 .Ft void
 .Fn timeout "int delay"
-.Ft int
+.Ft void
 .Fn wtimeout "WINDOW *win" "int delay"
 .Ft int
 .Fn nodelay "WINDOW *win" "bool flag"



CVS commit: src/lib/libcurses

2022-05-21 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Sat May 21 12:34:45 UTC 2022

Modified Files:
src/lib/libcurses: curses_input.3

Log Message:
curses_input.3: wtimeout() returns void too


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

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:29:34 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c

Log Message:
gomoku: warn before overwriting a saved game file


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.32 -r1.33 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.44 -r1.45 src/games/gomoku/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/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.39 src/games/gomoku/bdisp.c:1.40
--- src/games/gomoku/bdisp.c:1.39	Sat May 21 12:16:53 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 12:29:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.39 2022/05/21 12:16:53 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.40 2022/05/21 12:29:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.39 2022/05/21 12:16:53 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.40 2022/05/21 12:29:34 rillig Exp $");
 
 #include 
 #include 
@@ -272,7 +272,7 @@ get_key(const char *allowed)
 }
 
 bool
-get_line(char *buf, int size)
+get_line(char *buf, int size, void (*on_change)(const char *))
 {
 	char *cp, *end;
 	int c;
@@ -311,6 +311,10 @@ get_line(char *buf, int size)
 			} else
 beep();
 		}
+		if (on_change != NULL) {
+			*cp = '\0';
+			on_change(buf);
+		}
 		refresh();
 	}
 	*cp = '\0';

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.32 src/games/gomoku/gomoku.h:1.33
--- src/games/gomoku/gomoku.h:1.32	Sat May 21 09:25:51 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 12:29:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.32 2022/05/21 09:25:51 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.33 2022/05/21 12:29:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -229,7 +229,7 @@ extern const char *plyr[];
 void	bdinit(struct spotstr *);
 int	get_coord(void);
 int	get_key(const char *);
-bool	get_line(char *, int);
+bool	get_line(char *, int, void (*)(const char *));
 void	ask(const char *);
 void	dislog(const char *);
 void	bdump(FILE *);

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.44 src/games/gomoku/main.c:1.45
--- src/games/gomoku/main.c:1.44	Sat May 21 09:57:53 2022
+++ src/games/gomoku/main.c	Sat May 21 12:29:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.44 2022/05/21 09:57:53 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.45 2022/05/21 12:29:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,8 +36,9 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.44 2022/05/21 09:57:53 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.45 2022/05/21 12:29:34 rillig Exp $");
 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +81,20 @@ static void quit(void) __dead;
 static void quitsig(int) __dead;
 #endif
 
+static void
+warn_if_exists(const char *fname)
+{
+	struct stat st;
+
+	if (lstat(fname, ) == 0) {
+		int x, y;
+		getyx(stdscr, y, x);
+		addstr("  (already exists)");
+		move(y, x);
+	} else
+		clrtoeol();
+}
+
 int
 main(int argc, char **argv)
 {
@@ -180,7 +195,7 @@ again:
 		}
 	} else {
 		setbuf(stdout, 0);
-		get_line(buf, sizeof(buf));
+		get_line(buf, sizeof(buf), NULL);
 		if (strcmp(buf, "black") == 0)
 			color = BLACK;
 		else if (strcmp(buf, "white") == 0)
@@ -258,7 +273,8 @@ again:
 	FILE *fp;
 
 	ask("Save file name? ");
-	(void)get_line(fname, sizeof(fname));
+	(void)get_line(fname, sizeof(fname),
+	warn_if_exists);
 	if ((fp = fopen(fname, "w")) == NULL) {
 		misclog("cannot create save file");
 		goto getinput;
@@ -276,7 +292,7 @@ again:
 	goto getinput;
 }
 			} else {
-if (!get_line(buf, sizeof(buf))) {
+if (!get_line(buf, sizeof(buf), NULL)) {
 	curmove = RESIGN;
 	break;
 }
@@ -332,7 +348,8 @@ again:
 FILE *fp;
 
 ask("Save file name? ");
-(void)get_line(fname, sizeof(fname));
+(void)get_line(fname, sizeof(fname),
+warn_if_exists);
 if ((fp = fopen(fname, "w")) == NULL) {
 	misclog("cannot create save file");
 	goto replay;
@@ -383,7 +400,7 @@ whatsup(int signum)
 		quit();
 top:
 	ask("debug command: ");
-	if (!get_line(input, sizeof(input)))
+	if (!get_line(input, sizeof(input), NULL))
 		quit();
 	switch (*input) {
 	case '\0':



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:29:34 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c

Log Message:
gomoku: warn before overwriting a saved game file


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.32 -r1.33 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.44 -r1.45 src/games/gomoku/main.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:16:54 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c

Log Message:
gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/games/gomoku/bdisp.c

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.38 src/games/gomoku/bdisp.c:1.39
--- src/games/gomoku/bdisp.c:1.38	Sat May 21 12:08:06 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 12:16:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.38 2022/05/21 12:08:06 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.39 2022/05/21 12:16:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.38 2022/05/21 12:08:06 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.39 2022/05/21 12:16:53 rillig Exp $");
 
 #include 
 #include 
@@ -280,36 +280,38 @@ get_line(char *buf, int size)
 	c = 0;
 	cp = buf;
 	end = buf + size - 1;	/* save room for the '\0' */
-	while (cp < end && (c = getchar()) != EOF && c != '\n' && c != '\r') {
-		*cp++ = c;
-		if (interactive) {
-			switch (c) {
-			case 0x0c: /* ^L */
-wrefresh(curscr);
-cp--;
-continue;
-			case 0x15: /* ^U */
-			case 0x18: /* ^X */
-while (cp > buf) {
-	cp--;
-	addch('\b');
-}
-clrtoeol();
-break;
-			case '\b':
-			case 0x7f: /* DEL */
-if (cp == buf + 1) {
-	cp--;
-	continue;
-}
-cp -= 2;
+	while ((c = getchar()) != EOF && c != '\n' && c != '\r') {
+		if (!interactive && cp < end) {
+			*cp++ = c;
+			continue;
+		}
+		if (!interactive)
+			errx(EXIT_FAILURE, "line too long");
+
+		switch (c) {
+		case 0x0c:	/* ^L */
+			wrefresh(curscr);
+			continue;
+		case 0x15:	/* ^U */
+		case 0x18:	/* ^X */
+			for (; cp > buf; cp--)
 addstr("\b \b");
-break;
-			default:
+			break;
+		case '\b':
+		case 0x7f:	/* DEL */
+			if (cp == buf)
+continue;
+			cp--;
+			addstr("\b \b");
+			break;
+		default:
+			if (cp < end) {
+*cp++ = c;
 addch(c);
-			}
-			refresh();
+			} else
+beep();
 		}
+		refresh();
 	}
 	*cp = '\0';
 	return c != EOF;



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:16:54 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c

Log Message:
gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/games/gomoku/bdisp.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:08:06 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c

Log Message:
gomoku: fix deleting a character when reading a line


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/games/gomoku/bdisp.c

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

Modified files:

Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.37 src/games/gomoku/bdisp.c:1.38
--- src/games/gomoku/bdisp.c:1.37	Sat May 21 09:25:51 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 12:08:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.37 2022/05/21 09:25:51 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.38 2022/05/21 12:08:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.37 2022/05/21 09:25:51 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.38 2022/05/21 12:08:06 rillig Exp $");
 
 #include 
 #include 
@@ -303,9 +303,8 @@ get_line(char *buf, int size)
 	continue;
 }
 cp -= 2;
-addch('\b');
-c = ' ';
-/* FALLTHROUGH */
+addstr("\b \b");
+break;
 			default:
 addch(c);
 			}



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 12:08:06 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c

Log Message:
gomoku: fix deleting a character when reading a line


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/games/gomoku/bdisp.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/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:33:05 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Correct byte-order for bufsize field of RX descriptor.

XXX
This bug affected only armeb. Unfortunately, the systems including
armel still lock up eventually with NFS root on mvgbe(4)...


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.65 src/sys/dev/marvell/if_mvgbe.c:1.66
--- src/sys/dev/marvell/if_mvgbe.c:1.65	Sat May 21 10:27:30 2022
+++ src/sys/dev/marvell/if_mvgbe.c	Sat May 21 10:33:05 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.66 2022/05/21 10:33:05 rin Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.66 2022/05/21 10:33:05 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -1587,6 +1587,7 @@ mvgbe_newbuf(struct mvgbe_softc *sc, int
 	struct mvgbe_rx_desc *r;
 	int align;
 	vaddr_t offset;
+	uint16_t bufsize;
 
 	if (m == NULL) {
 		void *buf = NULL;
@@ -1631,12 +1632,13 @@ mvgbe_newbuf(struct mvgbe_softc *sc, int
 	c->mvgbe_mbuf = m_new;
 	offset = (vaddr_t)m_new->m_data - (vaddr_t)sc->sc_cdata.mvgbe_jumbo_buf;
 	r->bufptr = H2MVGBE32(dmamap->dm_segs[0].ds_addr + offset);
-	r->bufsize = MVGBE_JLEN & ~MVGBE_RXBUF_MASK;
+	bufsize = MVGBE_JLEN & ~MVGBE_RXBUF_MASK;
+	r->bufsize = H2MVGBE16(bufsize);
 	r->cmdsts =
 	H2MVGBE32(MVGBE_BUFFER_OWNED_BY_DMA | MVGBE_RX_ENABLE_INTERRUPT);
 
 	/* Invalidate RX buffer */
-	bus_dmamap_sync(sc->sc_dmat, dmamap, offset, r->bufsize,
+	bus_dmamap_sync(sc->sc_dmat, dmamap, offset, bufsize,
 	BUS_DMASYNC_PREREAD);
 
 	MVGBE_CDRXSYNC(sc, i, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -1991,7 +1993,7 @@ mvgbe_rxeof(struct mvgbe_softc *sc)
 		m = cdata->mvgbe_rx_chain[idx].mvgbe_mbuf;
 		cdata->mvgbe_rx_chain[idx].mvgbe_mbuf = NULL;
 		total_len = MVGBE2H16(cur_rx->bytecnt) - ETHER_CRC_LEN;
-		bufsize = cur_rx->bufsize;
+		bufsize = MVGBE2H16(cur_rx->bufsize);
 
 		cdata->mvgbe_rx_map[idx] = NULL;
 



CVS commit: src/sys/dev/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:33:05 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Correct byte-order for bufsize field of RX descriptor.

XXX
This bug affected only armeb. Unfortunately, the systems including
armel still lock up eventually with NFS root on mvgbe(4)...


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/marvell/if_mvgbe.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/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:27:30 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
m_freem() *after* bus_dmamap_sync() and bus_dmamap_load() for
that mbuf. This is mandatory for some archs.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.64 src/sys/dev/marvell/if_mvgbe.c:1.65
--- src/sys/dev/marvell/if_mvgbe.c:1.64	Sat May 21 10:24:50 2022
+++ src/sys/dev/marvell/if_mvgbe.c	Sat May 21 10:27:30 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.65 2022/05/21 10:27:30 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -2127,13 +2127,14 @@ mvgbe_txeof(struct mvgbe_softc *sc)
 		if (cdata->mvgbe_tx_chain[idx].mvgbe_mbuf != NULL) {
 			entry = cdata->mvgbe_tx_map[idx];
 
-			m_freem(cdata->mvgbe_tx_chain[idx].mvgbe_mbuf);
-			cdata->mvgbe_tx_chain[idx].mvgbe_mbuf = NULL;
-
 			bus_dmamap_sync(sc->sc_dmat, entry->dmamap, 0,
 			entry->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
 
 			bus_dmamap_unload(sc->sc_dmat, entry->dmamap);
+
+			m_freem(cdata->mvgbe_tx_chain[idx].mvgbe_mbuf);
+			cdata->mvgbe_tx_chain[idx].mvgbe_mbuf = NULL;
+
 			SIMPLEQ_INSERT_TAIL(>sc_txmap_head, entry, link);
 			cdata->mvgbe_tx_map[idx] = NULL;
 		}



CVS commit: src/sys/dev/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:27:30 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
m_freem() *after* bus_dmamap_sync() and bus_dmamap_load() for
that mbuf. This is mandatory for some archs.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/marvell/if_mvgbe.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/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:24:50 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Add DPRINTF() to catch failure of m_defrag() in mvgbe_encap().


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.63 src/sys/dev/marvell/if_mvgbe.c:1.64
--- src/sys/dev/marvell/if_mvgbe.c:1.63	Sat May 21 10:22:27 2022
+++ src/sys/dev/marvell/if_mvgbe.c	Sat May 21 10:24:50 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.63 2022/05/21 10:22:27 rin Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.63 2022/05/21 10:22:27 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.64 2022/05/21 10:24:50 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -1825,8 +1825,10 @@ do_defrag:
 		/* A small unaligned segment was detected. */
 		struct mbuf *m_new;
 		m_new = m_defrag(m_head, M_DONTWAIT);
-		if (m_new == NULL)
+		if (m_new == NULL) {
+			DPRINTFN(2, ("mvgbe_encap: defrag failed\n"));
 			return EFBIG;
+		}
 		m_head = m_new;
 	}
 



CVS commit: src/sys/dev/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:24:50 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Add DPRINTF() to catch failure of m_defrag() in mvgbe_encap().


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/marvell/if_mvgbe.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/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:22:27 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Raise threshold of debug level to 3 for DPRINTF() in non-error path of
mvgbe_encap(). Without this change, debug level 2 is almost unusable...


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.62 src/sys/dev/marvell/if_mvgbe.c:1.63
--- src/sys/dev/marvell/if_mvgbe.c:1.62	Mon Aug 30 00:08:28 2021
+++ src/sys/dev/marvell/if_mvgbe.c	Sat May 21 10:22:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.62 2021/08/30 00:08:28 rin Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.63 2022/05/21 10:22:27 rin Exp $	*/
 /*
  * Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.62 2021/08/30 00:08:28 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.63 2022/05/21 10:22:27 rin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -1871,7 +1871,7 @@ do_defrag:
 	}
 
 
-	DPRINTFN(2, ("mvgbe_encap: dm_nsegs=%d\n", txmap->dm_nsegs));
+	DPRINTFN(3, ("mvgbe_encap: dm_nsegs=%d\n", txmap->dm_nsegs));
 
 	for (i = 0; i < txmap->dm_nsegs; i++) {
 		f = >sc_rdata->mvgbe_tx_ring[current];



CVS commit: src/sys/dev/marvell

2022-05-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat May 21 10:22:27 UTC 2022

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Raise threshold of debug level to 3 for DPRINTF() in non-error path of
mvgbe_encap(). Without this change, debug level 2 is almost unusable...


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/marvell/if_mvgbe.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 10:01:49 UTC 2022

Modified Files:
src/games/gomoku: pickmove.c

Log Message:
gomoku: prevent thinking for too long

At search depth 9, picking a move takes about a minute on modern
hardware, which is enough for casual game play.  Even then, gomoku does
not always find the perfect move, so investing that much time seems
questionable.  Limiting the search depth also puts an upper bound on the
memory usage, which is quite high with 150 MB.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/games/gomoku/pickmove.c

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

Modified files:

Index: src/games/gomoku/pickmove.c
diff -u src/games/gomoku/pickmove.c:1.39 src/games/gomoku/pickmove.c:1.40
--- src/games/gomoku/pickmove.c:1.39	Fri May 20 19:30:17 2022
+++ src/games/gomoku/pickmove.c	Sat May 21 10:01:49 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pickmove.c,v 1.39 2022/05/20 19:30:17 rillig Exp $	*/
+/*	$NetBSD: pickmove.c,v 1.40 2022/05/21 10:01:49 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)pickmove.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: pickmove.c,v 1.39 2022/05/20 19:30:17 rillig Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.40 2022/05/21 10:01:49 rillig Exp $");
 
 #include 
 #include 
@@ -332,6 +332,8 @@ scanframes(int color)
 	d = 2;
 	/* LINTED 117: bitwise '>>' on signed value possibly nonportable */
 	while (d <= ((movenum + 1) >> 1) && combolen > n) {
+		if (d >= 9)
+			break;	/* Do not think too long. */
 		if (debug != 0) {
 			debuglog("%cL%d %d %d %d", "BW"[color],
 			d, combolen - n, combocnt, elistcnt);



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 10:01:49 UTC 2022

Modified Files:
src/games/gomoku: pickmove.c

Log Message:
gomoku: prevent thinking for too long

At search depth 9, picking a move takes about a minute on modern
hardware, which is enough for casual game play.  Even then, gomoku does
not always find the perfect move, so investing that much time seems
questionable.  Limiting the search depth also puts an upper bound on the
memory usage, which is quite high with 150 MB.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/games/gomoku/pickmove.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 09:57:54 UTC 2022

Modified Files:
src/games/gomoku: main.c

Log Message:
gomoku: in debug mode, after pressing 'd', allow another debug command

While here, remove the sleeping, as there is no obvious reason for it.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/games/gomoku/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/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.43 src/games/gomoku/main.c:1.44
--- src/games/gomoku/main.c:1.43	Sat May 21 09:25:51 2022
+++ src/games/gomoku/main.c	Sat May 21 09:57:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.43 2022/05/21 09:25:51 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.44 2022/05/21 09:57:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.43 2022/05/21 09:25:51 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.44 2022/05/21 09:57:53 rillig Exp $");
 
 #include 
 #include 
@@ -394,8 +394,7 @@ top:
 	case 'd':		/* set debug level */
 		debug = input[1] - '0';
 		debuglog("Debug set to %d", debug);
-		sleep(1);
-		break;
+		goto top;
 	case 'c':
 		break;
 	case 'b':		/* back up a move */



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 09:57:54 UTC 2022

Modified Files:
src/games/gomoku: main.c

Log Message:
gomoku: in debug mode, after pressing 'd', allow another debug command

While here, remove the sleeping, as there is no obvious reason for it.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/games/gomoku/main.c

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



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 09:25:51 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c

Log Message:
gomoku: make drawing the player's names simpler

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.31 -r1.32 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.42 -r1.43 src/games/gomoku/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/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.36 src/games/gomoku/bdisp.c:1.37
--- src/games/gomoku/bdisp.c:1.36	Thu May 19 22:49:05 2022
+++ src/games/gomoku/bdisp.c	Sat May 21 09:25:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bdisp.c,v 1.36 2022/05/19 22:49:05 rillig Exp $	*/
+/*	$NetBSD: bdisp.c,v 1.37 2022/05/21 09:25:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -34,7 +34,7 @@
 
 #include 
 /*	@(#)bdisp.c	8.2 (Berkeley) 5/3/95	*/
-__RCSID("$NetBSD: bdisp.c,v 1.36 2022/05/19 22:49:05 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.37 2022/05/21 09:25:51 rillig Exp $");
 
 #include 
 #include 
@@ -109,7 +109,7 @@ bdisp_init(void)
 		mvprintw(scr_y(j), scr_x(BSZ) + 2, "%d ", j);
 	}
 
-	bdwho(false);
+	bdwho();
 	mvaddstr(0, TRANSCRIPT_COL + 1, "#  black  white");
 	lastline = 0;
 	bdisp();
@@ -119,21 +119,18 @@ bdisp_init(void)
  * Update who is playing whom.
  */
 void
-bdwho(bool update)
+bdwho(void)
 {
 	int bw = (int)strlen(plyr[BLACK]);
 	int ww = (int)strlen(plyr[WHITE]);
 	int available = 3 + (1 + scr_x(BSZ) - scr_x(1)) + 3;
 	int fixed = (int)sizeof("BLACK/ (*) vs. WHITE/ (O)") - 1;
 	int total = fixed + bw + ww;
+	int x;
 
-	mvhline(BSZ + 2, 0, ' ', available);
-
-	if (total <= available) {
-		mvprintw(BSZ + 2, (available - total) / 2,
-		"BLACK/%s (*) vs. WHITE/%s (O)",
-		plyr[BLACK], plyr[WHITE]);
-	} else {
+	if (total <= available)
+		x = (available - total) / 2;
+	else {
 		int remaining = available - fixed;
 		int half = remaining / 2;
 
@@ -143,12 +140,12 @@ bdwho(bool update)
 			bw = remaining - ww;
 		else
 			bw = half, ww = remaining - half;
-
-		mvprintw(BSZ + 2, 0, "BLACK/%.*s (*) vs. WHITE/%.*s (O)",
-		bw, plyr[BLACK], ww, plyr[WHITE]);
+		x = 0;
 	}
-	if (update)
-		refresh();
+
+	mvhline(BSZ + 2, 0, ' ', available);
+	mvprintw(BSZ + 2, x, "BLACK/%.*s (*) vs. WHITE/%.*s (O)",
+	bw, plyr[BLACK], ww, plyr[WHITE]);
 }
 
 /*

Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.31 src/games/gomoku/gomoku.h:1.32
--- src/games/gomoku/gomoku.h:1.31	Fri May 20 19:30:17 2022
+++ src/games/gomoku/gomoku.h	Sat May 21 09:25:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: gomoku.h,v 1.31 2022/05/20 19:30:17 rillig Exp $	*/
+/*	$NetBSD: gomoku.h,v 1.32 2022/05/21 09:25:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -237,7 +237,7 @@ void	bdisp(void);
 void	bdisp_init(void);
 void	cursfini(void);
 void	cursinit(void);
-void	bdwho(bool);
+void	bdwho(void);
 void	panic(const char *, ...) __printflike(1, 2) __dead;
 void	debuglog(const char *, ...) __printflike(1, 2);
 void	whatsup(int);

Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.42 src/games/gomoku/main.c:1.43
--- src/games/gomoku/main.c:1.42	Thu May 19 22:49:05 2022
+++ src/games/gomoku/main.c	Sat May 21 09:25:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.42 2022/05/19 22:49:05 rillig Exp $	*/
+/*	$NetBSD: main.c,v 1.43 2022/05/21 09:25:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994
@@ -36,7 +36,7 @@
 __COPYRIGHT("@(#) Copyright (c) 1994\
  The Regents of the University of California.  All rights reserved.");
 /*	@(#)main.c	8.4 (Berkeley) 5/4/95	*/
-__RCSID("$NetBSD: main.c,v 1.42 2022/05/19 22:49:05 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.43 2022/05/21 09:25:51 rillig Exp $");
 
 #include 
 #include 
@@ -215,7 +215,8 @@ again:
 	if (interactive) {
 		plyr[BLACK] = input[BLACK] == USER ? user : prog;
 		plyr[WHITE] = input[WHITE] == USER ? user : prog;
-		bdwho(true);
+		bdwho();
+		refresh();
 	}
 
 	for (color = BLACK; ; color = color != BLACK ? BLACK : WHITE) {
@@ -244,7 +245,8 @@ again:
 			}
 			plyr[BLACK] = input[BLACK] == USER ? user : prog;
 			plyr[WHITE] = input[WHITE] == USER ? user : prog;
-			bdwho(true);
+			bdwho();
+			refresh();
 			goto top;
 
 		case USER: /* input comes from standard input */



CVS commit: src/games/gomoku

2022-05-21 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sat May 21 09:25:51 UTC 2022

Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c

Log Message:
gomoku: make drawing the player's names simpler

No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.31 -r1.32 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.42 -r1.43 src/games/gomoku/main.c

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



CVS commit: src/lib/libcurses

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sat May 21 06:22:49 UTC 2022

Modified Files:
src/lib/libcurses: curses_input.3

Log Message:
curses_input.3: timeout() actually returns void


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/curses_input.3

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



CVS commit: src/lib/libcurses

2022-05-21 Thread Charlotte Koch
Module Name:src
Committed By:   charlotte
Date:   Sat May 21 06:22:49 UTC 2022

Modified Files:
src/lib/libcurses: curses_input.3

Log Message:
curses_input.3: timeout() actually returns void


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/curses_input.3

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

Modified files:

Index: src/lib/libcurses/curses_input.3
diff -u src/lib/libcurses/curses_input.3:1.28 src/lib/libcurses/curses_input.3:1.29
--- src/lib/libcurses/curses_input.3:1.28	Mon May 16 20:09:13 2022
+++ src/lib/libcurses/curses_input.3	Sat May 21 06:22:49 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_input.3,v 1.28 2022/05/16 20:09:13 rillig Exp $
+.\"	$NetBSD: curses_input.3,v 1.29 2022/05/21 06:22:49 charlotte Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -99,7 +99,7 @@
 .Fn is_keypad "const WINDOW *win"
 .Ft int
 .Fn notimeout "WINDOW *win" "bool flag"
-.Ft int
+.Ft void
 .Fn timeout "int delay"
 .Ft int
 .Fn wtimeout "WINDOW *win" "int delay"