CVS commit: src/lib/libm

2024-06-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 10 12:49:30 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm: Fix arm expected symbol list harder.

LIB is not defined by the time we need it in the m.expsym rule, so
just say m here like in the other lines.


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.237 src/lib/libm/Makefile:1.238
--- src/lib/libm/Makefile:1.237	Mon Jun 10 12:47:40 2024
+++ src/lib/libm/Makefile	Mon Jun 10 12:49:29 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.237 2024/06/10 12:47:40 riastradh Exp $
+#  $NetBSD: Makefile,v 1.238 2024/06/10 12:49:29 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -113,7 +113,7 @@ EXPSYM_SRCS=	m.common.expsym m.ieee754.e
 .PATH.c: ${.CURDIR}/arch/arm
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS+= fenv.c
-EXPSYM_SRC_MD=	${LIB}.armhf.expsym
+EXPSYM_SRC_MD=	m.armhf.expsym
 .endif
 .for f in fenv.c lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 COPTS.$f +=	-mfpu=vfp



CVS commit: src/lib/libm

2024-06-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 10 12:49:30 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm: Fix arm expected symbol list harder.

LIB is not defined by the time we need it in the m.expsym rule, so
just say m here like in the other lines.


To generate a diff of this commit:
cvs rdiff -u -r1.237 -r1.238 src/lib/libm/Makefile

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



CVS commit: src/lib/libm

2024-06-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 10 12:47:40 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm: Fix mips and arm expected symbol lists.

Had forgotten that they were overriding LIB_EXPSYM.  Use a new
intermediate variable EXPSYM_SRC_MD for that.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/lib/libm/Makefile

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.236 src/lib/libm/Makefile:1.237
--- src/lib/libm/Makefile:1.236	Sun Jun  9 14:10:05 2024
+++ src/lib/libm/Makefile	Mon Jun 10 12:47:40 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.236 2024/06/09 14:10:05 riastradh Exp $
+#  $NetBSD: Makefile,v 1.237 2024/06/10 12:47:40 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -62,10 +62,12 @@ LINTFLAGS.s_logl.c+=	-X 177	# non-consta
 EXPSYM_SRCS=	m.common.expsym
 EXPSYM_SRCS+=	m.ieee754.expsym
 EXPSYM_SRCS+=	m.fenv.expsym
+EXPSYM_SRCS+=	${EXPSYM_SRC_MD:U}
+
 .if exists(${.CURDIR}/m.${LIBC_MACHINE_ARCH}.expsym)
-EXPSYM_SRCS+=	m.${LIBC_MACHINE_ARCH}.expsym
+EXPSYM_SRC_MD=	m.${LIBC_MACHINE_ARCH}.expsym
 .elif exists(${.CURDIR}/m.${LIBC_MACHINE_CPU}.expsym)
-EXPSYM_SRCS+=	m.${LIBC_MACHINE_CPU}.expsym
+EXPSYM_SRC_MD=	m.${LIBC_MACHINE_CPU}.expsym
 .endif
 
 # We will build m.expsym with a rule below, by merging all the files
@@ -111,7 +113,7 @@ EXPSYM_SRCS=	m.common.expsym m.ieee754.e
 .PATH.c: ${.CURDIR}/arch/arm
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS+= fenv.c
-LIB_EXPSYM=	${LIB}.armhf.expsym
+EXPSYM_SRC_MD=	${LIB}.armhf.expsym
 .endif
 .for f in fenv.c lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 COPTS.$f +=	-mfpu=vfp
@@ -249,15 +251,15 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 
 .  if ${MKSOFTFLOAT} == "no"
 .if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
-LIB_EXPSYM=	m.mips64hf.expsym
+EXPSYM_SRC_MD=	m.mips64hf.expsym
 .else
-LIB_EXPSYM=	m.mipshf.expsym
+EXPSYM_SRC_MD=	m.mipshf.expsym
 .endif
 .  else
 .if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
-LIB_EXPSYM=	m.mips64.expsym
+EXPSYM_SRC_MD=	m.mips64.expsym
 .else
-LIB_EXPSYM=	m.mips.expsym
+EXPSYM_SRC_MD=	m.mips.expsym
 .endif
 .  endif
 



CVS commit: src/lib/libm

2024-06-10 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jun 10 12:47:40 UTC 2024

Modified Files:
src/lib/libm: Makefile

Log Message:
libm: Fix mips and arm expected symbol lists.

Had forgotten that they were overriding LIB_EXPSYM.  Use a new
intermediate variable EXPSYM_SRC_MD for that.


To generate a diff of this commit:
cvs rdiff -u -r1.236 -r1.237 src/lib/libm/Makefile

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



CVS commit: src/lib/libc/gdtoa

2024-06-09 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  9 15:06:07 UTC 2024

Modified Files:
src/lib/libc/gdtoa: hdtoa.c

Log Message:
Fix hdtoa() for VAX D floating point


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/hdtoa.c

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



CVS commit: src/lib/libc/gdtoa

2024-06-09 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Jun  9 15:06:07 UTC 2024

Modified Files:
src/lib/libc/gdtoa: hdtoa.c

Log Message:
Fix hdtoa() for VAX D floating point


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/hdtoa.c

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

Modified files:

Index: src/lib/libc/gdtoa/hdtoa.c
diff -u src/lib/libc/gdtoa/hdtoa.c:1.13 src/lib/libc/gdtoa/hdtoa.c:1.14
--- src/lib/libc/gdtoa/hdtoa.c:1.13	Thu May  9 12:24:24 2024
+++ src/lib/libc/gdtoa/hdtoa.c	Sun Jun  9 15:06:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdtoa.c,v 1.13 2024/05/09 12:24:24 riastradh Exp $	*/
+/*	$NetBSD: hdtoa.c,v 1.14 2024/06/09 15:06:07 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005 David Schultz 
@@ -30,7 +30,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/lib/libc/gdtoa/_hdtoa.c,v 1.4 2007/01/03 04:57:58 das Exp $");
 #else
-__RCSID("$NetBSD: hdtoa.c,v 1.13 2024/05/09 12:24:24 riastradh Exp $");
+__RCSID("$NetBSD: hdtoa.c,v 1.14 2024/06/09 15:06:07 jakllsch Exp $");
 #endif
 
 #include 
@@ -59,8 +59,12 @@ __RCSID("$NetBSD: hdtoa.c,v 1.13 2024/05
 #define	INFSTR	"Infinity"
 #define	NANSTR	"NaN"
 
+#ifndef __vax__
 #define	DBL_ADJ		(DBL_MAX_EXP - 2 + ((DBL_MANT_DIG - 1) % 4))
 #define	LDBL_ADJ	(LDBL_MAX_EXP - 2 + ((LDBL_MANT_DIG - 1) % 4))
+#else /* __vax__ */
+#define	DBL_ADJ		(DBL_MAX_EXP + 4 + ((DBL_MANT_DIG) % 4))
+#endif
 
 /*
  * Round up the given digit string.  If the digit string is fff...f,
@@ -152,6 +156,11 @@ hdtoa(double d, const char *xdigs, int n
 
 	u.dblu_d = d;
 	*sign = u.dblu_dbl.dbl_sign;
+#ifdef __vax__
+	u.dfltu_dflt.dflt_fracl =
+	((u.dfltu_dflt.dflt_fracl >> 16) & 0x) |
+	((u.dfltu_dflt.dflt_fracl & 0x) << 16);
+#endif
 
 	switch (fpclassify(d)) {
 	case FP_NORMAL:
@@ -160,16 +169,11 @@ hdtoa(double d, const char *xdigs, int n
 	case FP_ZERO:
 		*decpt = 1;
 		return (nrv_alloc("0", rve, 1));
+#ifndef __vax__
 	case FP_SUBNORMAL:
-#ifdef __vax__
-		/* (DBL_MAX_EXP=127 / 2) + 2 = 65? */
-		u.dblu_d *= 0x1p65;
-		*decpt = u.dblu_dbl.dbl_exp - (65 + DBL_ADJ);
-#else
 		/* (DBL_MAX_EXP=1024 / 2) + 2 = 514? */
 		u.dblu_d *= 0x1p514;
 		*decpt = u.dblu_dbl.dbl_exp - (514 + DBL_ADJ);
-#endif
 		break;
 	case FP_INFINITE:
 		*decpt = INT_MAX;
@@ -177,6 +181,7 @@ hdtoa(double d, const char *xdigs, int n
 	case FP_NAN:
 		*decpt = INT_MAX;
 		return (nrv_alloc(NANSTR, rve, sizeof(NANSTR) - 1));
+#endif
 	default:
 		abort();
 	}
@@ -210,7 +215,8 @@ hdtoa(double d, const char *xdigs, int n
 		u.dblu_dbl.dbl_fracl >>= 4;
 	}
 #ifdef DBL_FRACMBITS
-	for (; s > s0; s--) {
+	for (; s > s0 + sigfigs - ((DBL_FRACLBITS + DBL_FRACMBITS) / 4) - 1
+&& s > s0; s--) {
 		*s = u.dblu_dbl.dbl_fracm & 0xf;
 		u.dblu_dbl.dbl_fracm >>= 4;
 	}



CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 14:10:06 UTC 2024

Modified Files:
src/lib/libm: Makefile m.aarch64.expsym m.alpha.expsym m.arm.expsym
m.armhf.expsym m.hppa.expsym m.i386.expsym m.ia64.expsym
m.m68k.expsym m.mips.expsym m.mips64.expsym m.mipshf.expsym
m.powerpc.expsym m.powerpc64.expsym m.riscv.expsym m.sh3.expsym
m.sparc.expsym m.sparc64.expsym m.vax.expsym m.x86_64.expsym
Added Files:
src/lib/libm: m.common.expsym m.fenv.expsym m.ieee754.expsym

Log Message:
libm: Factor out common expected symbol list.

Should substantially reduce the maintenance burden.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/lib/libm/Makefile
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.arm.expsym src/lib/libm/m.i386.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym \
src/lib/libm/m.x86_64.expsym
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.alpha.expsym \
src/lib/libm/m.hppa.expsym src/lib/libm/m.ia64.expsym \
src/lib/libm/m.powerpc.expsym src/lib/libm/m.sparc.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mips64.expsym src/lib/libm/m.mipshf.expsym \
src/lib/libm/m.powerpc64.expsym src/lib/libm/m.sh3.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.common.expsym \
src/lib/libm/m.fenv.expsym src/lib/libm/m.ieee754.expsym
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/m.m68k.expsym \
src/lib/libm/m.mips.expsym
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/m.vax.expsym

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.235 src/lib/libm/Makefile:1.236
--- src/lib/libm/Makefile:1.235	Tue May 14 14:34:35 2024
+++ src/lib/libm/Makefile	Sun Jun  9 14:10:05 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.235 2024/05/14 14:34:35 riastradh Exp $
+#  $NetBSD: Makefile,v 1.236 2024/06/09 14:10:05 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -59,6 +59,21 @@ LINTFLAGS.s_logl.c+=	-X 161	# constant i
 LINTFLAGS.s_logl.c+=	-X 193	# unreachable statement (due to 161)
 LINTFLAGS.s_logl.c+=	-X 177	# non-constant initializer
 
+EXPSYM_SRCS=	m.common.expsym
+EXPSYM_SRCS+=	m.ieee754.expsym
+EXPSYM_SRCS+=	m.fenv.expsym
+.if exists(${.CURDIR}/m.${LIBC_MACHINE_ARCH}.expsym)
+EXPSYM_SRCS+=	m.${LIBC_MACHINE_ARCH}.expsym
+.elif exists(${.CURDIR}/m.${LIBC_MACHINE_CPU}.expsym)
+EXPSYM_SRCS+=	m.${LIBC_MACHINE_CPU}.expsym
+.endif
+
+# We will build m.expsym with a rule below, by merging all the files
+# listed in EXPSYM_SRCS, which individual architectures can override.
+# (The rule has to be written below after EXPSYM_SRCS has been
+# determined.)
+LIB_EXPSYM=	m.expsym
+
 .if (${LIBC_MACHINE_CPU} == "aarch64")
 .PATH: ${.CURDIR}/arch/aarch64
 ARCH_SRCS = e_sqrt.S e_sqrtf.S s_fabsf.S
@@ -77,6 +92,21 @@ COMMON_SRCS+= fenv.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 
+# alpha doesn't have symbols for:
+#
+#	feclearexcept
+#	fegetexceptflag
+#	fegetround
+#	feraiseexcept
+#	fesetexceptflag
+#	fesetround
+#	fetestexcept
+#
+# Instead, they are static inlines in fenv.h.  So we won't use
+# m.fenv.expsym.
+#
+EXPSYM_SRCS=	m.common.expsym m.ieee754.expsym m.alpha.expsym
+
 .elif (${LIBC_MACHINE_CPU} == "arm")
 .PATH.c: ${.CURDIR}/arch/arm
 .if ${MKSOFTFLOAT} == "no"
@@ -179,6 +209,10 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 ARCH_SRCS = n_scalbn.S
 WARNS?=5
 
+# No IEEE 754 stuff.  Not all of it is actually specific to IEEE 754,
+# but it's missing anyway: PR port-vax/57881.
+EXPSYM_SRCS=	m.common.expsym m.vax.expsym
+
 .elif (${LIBC_MACHINE_CPU} == "riscv")
 .PATH:	${.CURDIR}/arch/riscv
 
@@ -242,6 +276,12 @@ WARNS?=5
 .PATH:	${.CURDIR}/src
 .PATH:	${.CURDIR}/noieee_src
 
+m.expsym: ${EXPSYM_SRCS}
+	${_MKTARGET_CREATE}
+	LC_ALL=C sort -m ${.ALLSRC} >${.TARGET}.tmp && \
+	${MV} ${.TARGET}.tmp ${.TARGET}
+CLEANFILES+=	m.expsym m.expsym.tmp
+
 .if (${LIBC_MACHINE_ARCH} == "alpha")
 COPTS+= -mfp-rounding-mode=d
 .endif

Index: src/lib/libm/m.aarch64.expsym
diff -u src/lib/libm/m.aarch64.expsym:1.4 src/lib/libm/m.aarch64.expsym:1.5
--- src/lib/libm/m.aarch64.expsym:1.4	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/m.aarch64.expsym	Sun Jun  9 14:10:05 2024
@@ -23,496 +23,25 @@ _ItL_qS8
 _ItL_qS9
 __bss_end__
 __bss_start__
-__c99_cabs
-__c99_cabsf
-__c99_cabsl
-__divdc3
-__divsc3
 __divtc3
 __divxc3
 __end__
-__exp__D
 __fe_dfl_env
-__ieee754_acos
-__ieee754_acosf
-__ieee754_acosh
-__ieee754_acoshf
-__ieee754_asin
-__ieee754_asinf
-__ieee754_atan2
-__ieee754_atan2f
-__ieee754_atanh
-__ieee754_atanhf
-__ieee754_cosh
-__ieee754_coshf
-__ieee754_exp
-__ieee754_expf
-__ieee754_fmod
-__ieee754_fmodf
-__ieee754_fmodl
-__ieee754_hypot
-__ieee754_hypotf
-__ieee754_j0
-__ieee754_j0f
-__ieee754_j1
-__ieee754_j1f
-__ieee754_jn
-__ieee754_jnf

CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 14:10:06 UTC 2024

Modified Files:
src/lib/libm: Makefile m.aarch64.expsym m.alpha.expsym m.arm.expsym
m.armhf.expsym m.hppa.expsym m.i386.expsym m.ia64.expsym
m.m68k.expsym m.mips.expsym m.mips64.expsym m.mipshf.expsym
m.powerpc.expsym m.powerpc64.expsym m.riscv.expsym m.sh3.expsym
m.sparc.expsym m.sparc64.expsym m.vax.expsym m.x86_64.expsym
Added Files:
src/lib/libm: m.common.expsym m.fenv.expsym m.ieee754.expsym

Log Message:
libm: Factor out common expected symbol list.

Should substantially reduce the maintenance burden.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/lib/libm/Makefile
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.arm.expsym src/lib/libm/m.i386.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym \
src/lib/libm/m.x86_64.expsym
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.alpha.expsym \
src/lib/libm/m.hppa.expsym src/lib/libm/m.ia64.expsym \
src/lib/libm/m.powerpc.expsym src/lib/libm/m.sparc.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mips64.expsym src/lib/libm/m.mipshf.expsym \
src/lib/libm/m.powerpc64.expsym src/lib/libm/m.sh3.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.common.expsym \
src/lib/libm/m.fenv.expsym src/lib/libm/m.ieee754.expsym
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/m.m68k.expsym \
src/lib/libm/m.mips.expsym
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/m.vax.expsym

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



CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 14:09:27 UTC 2024

Modified Files:
src/lib/libm: m.vax.expsym
src/lib/libm/noieee_src: n_lgamma.c

Log Message:
libm: Define lgamma_r, lgammal, lgammal_r on non-IEEE754.

Missing internal aliases _lgamma_r and _lgammal_r -- TBD.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_lgamma.c

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

Modified files:

Index: src/lib/libm/m.vax.expsym
diff -u src/lib/libm/m.vax.expsym:1.5 src/lib/libm/m.vax.expsym:1.6
--- src/lib/libm/m.vax.expsym:1.5	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/m.vax.expsym	Sun Jun  9 14:09:27 2024
@@ -210,6 +210,9 @@ ldexp
 ldexpf
 ldexpl
 lgamma
+lgamma_r
+lgammal
+lgammal_r
 llrint
 llrintf
 log

Index: src/lib/libm/noieee_src/n_lgamma.c
diff -u src/lib/libm/noieee_src/n_lgamma.c:1.7 src/lib/libm/noieee_src/n_lgamma.c:1.8
--- src/lib/libm/noieee_src/n_lgamma.c:1.7	Mon Feb  4 03:30:20 2019
+++ src/lib/libm/noieee_src/n_lgamma.c	Sun Jun  9 14:09:27 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: n_lgamma.c,v 1.7 2019/02/04 03:30:20 mrg Exp $ */
+/*  $NetBSD: n_lgamma.c,v 1.8 2024/06/09 14:09:27 riastradh Exp $ */
 /*-
  * Copyright (c) 1992, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -81,7 +81,7 @@ static int endian;
 
 static double small_lgam(double);
 static double large_lgam(double);
-static double neg_lgam(double);
+static double neg_lgam(double, int *);
 static const double one = 1.0;
 int signgam;
 
@@ -137,12 +137,22 @@ int signgam;
 #define pb6	 5.69394463439411649408050664078e-03
 #define pb7	-1.44705562421428915453880392761e-02
 
-__pure double
+__weak_alias(lgammal, lgamma)
+__weak_alias(lgammal_r, lgamma_r)
+
+double
 lgamma(double x)
 {
+
+	return lgamma_r(x, );
+}
+
+double
+lgamma_r(double x, int *signgamp)
+{
 	double r;
 
-	signgam = 1;
+	*signgamp = 1;
 #if _IEEE
 	endian = ((*(int *) )) ? 1 : 0;
 #endif
@@ -160,10 +170,10 @@ lgamma(double x)
 		return (small_lgam(x));
 	else if (x > -1e-16) {
 		if (x < 0)
-			signgam = -1, x = -x;
+			*signgamp = -1, x = -x;
 		return (-log(x));
 	} else
-		return (neg_lgam(x));
+		return (neg_lgam(x, signgamp));
 }
 
 static double
@@ -267,7 +277,7 @@ CONTINUE:
 }
 
 static double
-neg_lgam(double x)
+neg_lgam(double x, int *signgamp)
 {
 	int xi;
 	double y, z, zero = 0.0;
@@ -283,7 +293,7 @@ neg_lgam(double x)
 		}
 		y = gamma(x);
 		if (y < 0)
-			y = -y, signgam = -1;
+			y = -y, *signgamp = -1;
 		return (log(y));
 	}
 	z = floor(x + .5);
@@ -295,7 +305,7 @@ neg_lgam(double x)
 	}
 	y = .5*ceil(x);
 	if (y == ceil(y))
-		signgam = -1;
+		*signgamp = -1;
 	x = -x;
 	z = fabs(x + z);	/* 0 < z <= .5 */
 	if (z < .25)



CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 14:09:27 UTC 2024

Modified Files:
src/lib/libm: m.vax.expsym
src/lib/libm/noieee_src: n_lgamma.c

Log Message:
libm: Define lgamma_r, lgammal, lgammal_r on non-IEEE754.

Missing internal aliases _lgamma_r and _lgammal_r -- TBD.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_lgamma.c

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



CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:35:38 UTC 2024

Modified Files:
src/lib/libm/arch/i387: s_atan.S s_atanf.S
src/lib/libm/noieee_src: n_asincos.c n_atan.c
src/lib/libm/src: e_acosl.c e_asinl.c s_atan.c s_atanf.c s_atanl.c
w_acos.c w_acosf.c w_asin.c w_asinf.c

Log Message:
libm: Sprinkle whitespace fixes and rcsids on inverse trig functions.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/arch/i387/s_atan.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/i387/s_atanf.S
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/noieee_src/n_asincos.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_atan.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_atan.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libm/src/s_atanf.c \
src/lib/libm/src/w_asinf.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_atanl.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/w_acos.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/w_acosf.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/w_asin.c

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

Modified files:

Index: src/lib/libm/arch/i387/s_atan.S
diff -u src/lib/libm/arch/i387/s_atan.S:1.7 src/lib/libm/arch/i387/s_atan.S:1.8
--- src/lib/libm/arch/i387/s_atan.S:1.7	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/arch/i387/s_atan.S	Sun Jun  9 13:35:38 2024
@@ -1,3 +1,5 @@
+/*	$NetBSD: s_atan.S,v 1.8 2024/06/09 13:35:38 riastradh Exp $	*/
+
 /*
  * Written by J.T. Conklin .
  * Public domain.
@@ -7,7 +9,7 @@
 
 #include "abi.h"
 
-RCSID("$NetBSD: s_atan.S,v 1.7 2024/06/09 13:33:36 riastradh Exp $")
+RCSID("$NetBSD: s_atan.S,v 1.8 2024/06/09 13:35:38 riastradh Exp $")
 
 WEAK_ALIAS(atan, _atan)
 

Index: src/lib/libm/arch/i387/s_atanf.S
diff -u src/lib/libm/arch/i387/s_atanf.S:1.6 src/lib/libm/arch/i387/s_atanf.S:1.7
--- src/lib/libm/arch/i387/s_atanf.S:1.6	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/arch/i387/s_atanf.S	Sun Jun  9 13:35:38 2024
@@ -1,3 +1,5 @@
+/*	$NetBSD: s_atanf.S,v 1.7 2024/06/09 13:35:38 riastradh Exp $	*/
+
 /*
  * Written by J.T. Conklin .
  * Public domain.
@@ -7,7 +9,7 @@
 
 #include "abi.h"
 
-RCSID("$NetBSD: s_atanf.S,v 1.6 2024/06/09 13:33:36 riastradh Exp $")
+RCSID("$NetBSD: s_atanf.S,v 1.7 2024/06/09 13:35:38 riastradh Exp $")
 
 WEAK_ALIAS(atanf, _atanf)
 

Index: src/lib/libm/noieee_src/n_asincos.c
diff -u src/lib/libm/noieee_src/n_asincos.c:1.10 src/lib/libm/noieee_src/n_asincos.c:1.11
--- src/lib/libm/noieee_src/n_asincos.c:1.10	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/noieee_src/n_asincos.c	Sun Jun  9 13:35:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: n_asincos.c,v 1.10 2024/06/09 13:33:36 riastradh Exp $	*/
+/*	$NetBSD: n_asincos.c,v 1.11 2024/06/09 13:35:38 riastradh Exp $	*/
 /*
  * Copyright (c) 1985, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -27,8 +27,9 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+
 #include 
-__RCSID("$NetBSD: n_asincos.c,v 1.10 2024/06/09 13:33:36 riastradh Exp $");
+__RCSID("$NetBSD: n_asincos.c,v 1.11 2024/06/09 13:35:38 riastradh Exp $");
 
 #ifndef lint
 #if 0

Index: src/lib/libm/noieee_src/n_atan.c
diff -u src/lib/libm/noieee_src/n_atan.c:1.7 src/lib/libm/noieee_src/n_atan.c:1.8
--- src/lib/libm/noieee_src/n_atan.c:1.7	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/noieee_src/n_atan.c	Sun Jun  9 13:35:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: n_atan.c,v 1.7 2024/06/09 13:33:36 riastradh Exp $	*/
+/*	$NetBSD: n_atan.c,v 1.8 2024/06/09 13:35:38 riastradh Exp $	*/
 /*
  * Copyright (c) 1985, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -28,6 +28,9 @@
  * SUCH DAMAGE.
  */
 
+#include 
+__RCSID("$NetBSD: n_atan.c,v 1.8 2024/06/09 13:35:38 riastradh Exp $");
+
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)atan.c	8.1 (Berkeley) 6/4/93";

Index: src/lib/libm/src/e_acosl.c
diff -u src/lib/libm/src/e_acosl.c:1.4 src/lib/libm/src/e_acosl.c:1.5
--- src/lib/libm/src/e_acosl.c:1.4	Sun Jun  9 13:33:36 2024
+++ src/lib/libm/src/e_acosl.c	Sun Jun  9 13:35:38 2024
@@ -1,3 +1,4 @@
+/*	$NetBSD: e_acosl.c,v 1.5 2024/06/09 13:35:38 riastradh Exp $	*/
 
 /* FreeBSD: head/lib/msun/src/e_acos.c 176451 2008-02-22 02:30:36Z das */
 /*
@@ -6,16 +7,19 @@
  *
  * Developed at SunSoft, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
- * software is freely granted, provided that this notice 
+ * software is freely granted, provided that this notice
  * is preserved.
  * 
  */
 
 #include 
+__RCSID("$NetBSD: e_acosl.c,v 1.5 2024/06/09 13:35:38 riastradh Exp $");
+
 /*
  * See comments in e_acos.c.
  * Converted to long double by David Schultz .
  */
+
 #include "namespace.h"
 
 #include 
Index: 

CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:35:38 UTC 2024

Modified Files:
src/lib/libm/arch/i387: s_atan.S s_atanf.S
src/lib/libm/noieee_src: n_asincos.c n_atan.c
src/lib/libm/src: e_acosl.c e_asinl.c s_atan.c s_atanf.c s_atanl.c
w_acos.c w_acosf.c w_asin.c w_asinf.c

Log Message:
libm: Sprinkle whitespace fixes and rcsids on inverse trig functions.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/arch/i387/s_atan.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/i387/s_atanf.S
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/noieee_src/n_asincos.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/noieee_src/n_atan.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c
cvs rdiff -u -r1.12 -r1.13 src/lib/libm/src/s_atan.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libm/src/s_atanf.c \
src/lib/libm/src/w_asinf.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/s_atanl.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/w_acos.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/w_acosf.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/w_asin.c

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



CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:36 UTC 2024

Modified Files:
src/lib/libm: m.aarch64.expsym m.alpha.expsym m.arm.expsym
m.armhf.expsym m.hppa.expsym m.i386.expsym m.ia64.expsym
m.m68k.expsym m.mips.expsym m.mips64.expsym m.mipshf.expsym
m.powerpc.expsym m.powerpc64.expsym m.riscv.expsym m.sh3.expsym
m.sparc.expsym m.sparc64.expsym m.vax.expsym m.x86_64.expsym
src/lib/libm/arch/i387: s_atan.S s_atanf.S
src/lib/libm/arch/mc68881: s_atan.S
src/lib/libm/noieee_src: n_asincos.c n_atan.c
src/lib/libm/src: e_acosl.c e_asinl.c namespace.h s_atan.c s_atanf.c
s_atanl.c w_acos.c w_acosf.c w_asin.c w_asinf.c

Log Message:
libm: Do the weak alias dance for asin, acos, atan.

These are used internally by the complex trig functions, so they need
weak aliases.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.arm.expsym src/lib/libm/m.i386.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym \
src/lib/libm/m.x86_64.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.alpha.expsym \
src/lib/libm/m.hppa.expsym src/lib/libm/m.ia64.expsym \
src/lib/libm/m.powerpc.expsym src/lib/libm/m.sparc.expsym
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mips64.expsym src/lib/libm/m.mipshf.expsym \
src/lib/libm/m.powerpc64.expsym src/lib/libm/m.sh3.expsym
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/m.m68k.expsym \
src/lib/libm/m.mips.expsym src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/i387/s_atan.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/arch/i387/s_atanf.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/mc68881/s_atan.S
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/noieee_src/n_asincos.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_atan.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libm/src/namespace.h
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/s_atan.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_atanf.c \
src/lib/libm/src/w_asinf.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_atanl.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/w_acos.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/w_acosf.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/w_asin.c

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

Modified files:

Index: src/lib/libm/m.aarch64.expsym
diff -u src/lib/libm/m.aarch64.expsym:1.3 src/lib/libm/m.aarch64.expsym:1.4
--- src/lib/libm/m.aarch64.expsym:1.3	Wed May  8 01:42:23 2024
+++ src/lib/libm/m.aarch64.expsym	Sun Jun  9 13:33:36 2024
@@ -102,15 +102,19 @@ __muldc3
 __mulsc3
 __multc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 _atan2l
+_atanf
 _atanhl
 _atanl
 _bss_end__
Index: src/lib/libm/m.arm.expsym
diff -u src/lib/libm/m.arm.expsym:1.3 src/lib/libm/m.arm.expsym:1.4
--- src/lib/libm/m.arm.expsym:1.3	Wed May  8 23:28:07 2024
+++ src/lib/libm/m.arm.expsym	Sun Jun  9 13:33:36 2024
@@ -69,15 +69,19 @@ __log__D
 __muldc3
 __mulsc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 _atan2l
+_atanf
 _atanhl
 _atanl
 _casin
Index: src/lib/libm/m.i386.expsym
diff -u src/lib/libm/m.i386.expsym:1.3 src/lib/libm/m.i386.expsym:1.4
--- src/lib/libm/m.i386.expsym:1.3	Wed May  8 01:40:26 2024
+++ src/lib/libm/m.i386.expsym	Sun Jun  9 13:33:36 2024
@@ -90,15 +90,19 @@ __log__D
 __muldc3
 __mulsc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 _atan2l
+_atanf
 _atanhl
 _atanl
 _casin
Index: src/lib/libm/m.riscv.expsym
diff -u src/lib/libm/m.riscv.expsym:1.3 src/lib/libm/m.riscv.expsym:1.4
--- src/lib/libm/m.riscv.expsym:1.3	Wed May  8 01:42:23 2024
+++ src/lib/libm/m.riscv.expsym	Sun Jun  9 13:33:36 2024
@@ -97,15 +97,19 @@ __log__D
 __muldc3
 __mulsc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 _atan2l
+_atanf
 _atanhl
 _atanl
 _casin
Index: src/lib/libm/m.sparc64.expsym
diff -u src/lib/libm/m.sparc64.expsym:1.3 src/lib/libm/m.sparc64.expsym:1.4
--- src/lib/libm/m.sparc64.expsym:1.3	Wed May  8 01:42:23 2024
+++ src/lib/libm/m.sparc64.expsym	Sun Jun  9 13:33:36 2024
@@ -98,15 +98,19 @@ __muldc3
 __mulsc3
 __multc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 _atan2l
+_atanf
 _atanhl
 _atanl
 _casin
Index: src/lib/libm/m.x86_64.expsym
diff -u src/lib/libm/m.x86_64.expsym:1.3 src/lib/libm/m.x86_64.expsym:1.4
--- src/lib/libm/m.x86_64.expsym:1.3	Wed May  8 01:40:27 2024
+++ src/lib/libm/m.x86_64.expsym	Sun Jun  9 13:33:36 2024
@@ -90,15 +90,19 @@ __log__D
 __muldc3
 __mulsc3
 __mulxc3
+_acos
+_acosf
 _acoshl
 _acosl
 _asin
 _asinf
 _asinhl
 _asinl
+_atan
 _atan2
 _atan2f
 

CVS commit: src/lib/libm

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:36 UTC 2024

Modified Files:
src/lib/libm: m.aarch64.expsym m.alpha.expsym m.arm.expsym
m.armhf.expsym m.hppa.expsym m.i386.expsym m.ia64.expsym
m.m68k.expsym m.mips.expsym m.mips64.expsym m.mipshf.expsym
m.powerpc.expsym m.powerpc64.expsym m.riscv.expsym m.sh3.expsym
m.sparc.expsym m.sparc64.expsym m.vax.expsym m.x86_64.expsym
src/lib/libm/arch/i387: s_atan.S s_atanf.S
src/lib/libm/arch/mc68881: s_atan.S
src/lib/libm/noieee_src: n_asincos.c n_atan.c
src/lib/libm/src: e_acosl.c e_asinl.c namespace.h s_atan.c s_atanf.c
s_atanl.c w_acos.c w_acosf.c w_asin.c w_asinf.c

Log Message:
libm: Do the weak alias dance for asin, acos, atan.

These are used internally by the complex trig functions, so they need
weak aliases.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.arm.expsym src/lib/libm/m.i386.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym \
src/lib/libm/m.x86_64.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.alpha.expsym \
src/lib/libm/m.hppa.expsym src/lib/libm/m.ia64.expsym \
src/lib/libm/m.powerpc.expsym src/lib/libm/m.sparc.expsym
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mips64.expsym src/lib/libm/m.mipshf.expsym \
src/lib/libm/m.powerpc64.expsym src/lib/libm/m.sh3.expsym
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/m.m68k.expsym \
src/lib/libm/m.mips.expsym src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/i387/s_atan.S
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/arch/i387/s_atanf.S
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/arch/mc68881/s_atan.S
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/noieee_src/n_asincos.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/noieee_src/n_atan.c
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/src/e_acosl.c \
src/lib/libm/src/e_asinl.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libm/src/namespace.h
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/s_atan.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libm/src/s_atanf.c \
src/lib/libm/src/w_asinf.c
cvs rdiff -u -r1.5 -r1.6 src/lib/libm/src/s_atanl.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/w_acos.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libm/src/w_acosf.c
cvs rdiff -u -r1.10 -r1.11 src/lib/libm/src/w_asin.c

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



CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:11 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Delete duplicates.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libm/src/namespace.h

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

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.21 src/lib/libm/src/namespace.h:1.22
--- src/lib/libm/src/namespace.h:1.21	Sun Jun  9 13:33:03 2024
+++ src/lib/libm/src/namespace.h	Sun Jun  9 13:33:11 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: namespace.h,v 1.21 2024/06/09 13:33:03 riastradh Exp $ */
+/* $NetBSD: namespace.h,v 1.22 2024/06/09 13:33:11 riastradh Exp $ */
 
 #define acoshl _acoshl
 #define acosl _acosl
@@ -25,7 +25,6 @@
 #define cosh _cosh
 #define coshf _coshf
 #define coshl _coshl
-#define coshl _coshl
 #define cosl _cosl
 #define cospi _cospi
 #define cospif _cospif
@@ -86,7 +85,6 @@
 #define sinh _sinh
 #define sinhf _sinhf
 #define sinhl _sinhl
-#define sinhl _sinhl
 #define sinl _sinl
 #define sinpi _sinpi
 #define sinpif _sinpif



CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:11 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Delete duplicates.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libm/src/namespace.h

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



CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:03 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Sort.

No functional change intended.

Grouping vaguely by functionality makes this painful to update.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libm/src/namespace.h

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

Modified files:

Index: src/lib/libm/src/namespace.h
diff -u src/lib/libm/src/namespace.h:1.20 src/lib/libm/src/namespace.h:1.21
--- src/lib/libm/src/namespace.h:1.20	Wed May  8 01:40:27 2024
+++ src/lib/libm/src/namespace.h	Sun Jun  9 13:33:03 2024
@@ -1,109 +1,47 @@
-/* $NetBSD: namespace.h,v 1.20 2024/05/08 01:40:27 riastradh Exp $ */
+/* $NetBSD: namespace.h,v 1.21 2024/06/09 13:33:03 riastradh Exp $ */
 
-#define atan2 _atan2
-#define atan2f _atan2f
-#define atan2l _atan2l
-#define hypot _hypot
-#define hypotf _hypotf
-#define hypotl _hypotl
-
-#define exp _exp
-#define expf _expf
-#define expl _expl
-#define expm1l _expm1l
-#define log _log
-#define logf _logf
-#define logl _logl
-
-#define sin _sin
-#define sinf _sinf
-#define cos _cos
-#define cosf _cosf
-#define tan _tan
-#define tanf _tanf
-
-#define finite _finite
-#define finitef _finitef
-
-#define sincos _sincos
-#define sincosf _sincosf
-#define sincosl _sincosl
-#define sinh _sinh
-#define sinhf _sinhf
-#define sinhl _sinhl
-#define cosh _cosh
-#define coshf _coshf
-#define coshl _coshl
+#define acoshl _acoshl
+#define acosl _acosl
 #define asin _asin
 #define asinf _asinf
+#define asinhl _asinhl
 #define asinl _asinl
-
-#define remquo _remquo
-#define remquof _remquof
-#define remquol _remquol
-
+#define atan2 _atan2
+#define atan2f _atan2f
+#define atan2l _atan2l
+#define atanhl _atanhl
+#define atanl _atanl
 #define casin _casin
 #define casinf _casinf
 #define casinl _casinl
 #define catan _catan
 #define catanf _catanf
 #define catanl _catanl
-
-#define scalbn _scalbn
-#define scalbnf _scalbnf
-#define scalbnl _scalbnl
-#define scalbln _scalbln
-#define scalblnf _scalblnf
-#define scalblnl _scalblnl
-
-#define copysignl _copysignl
-#define sqrtl _sqrtl
 #define cbrtl _cbrtl
 #define ceill _ceill
-#define floorl _floorl
-#define roundl _roundl
-#define fmodl _fmodl
-#define modfl _modfl
-#define truncl _truncl
-
-#define exp2l _exp2l
-#define cosl _cosl
-#define sinl _sinl
-#define tanl _tanl
-#define powl _powl
+#define copysignl _copysignl
+#define cos _cos
+#define cosf _cosf
+#define cosh _cosh
+#define coshf _coshf
 #define coshl _coshl
-#define sinhl _sinhl
-#define acosl _acosl
-#define atanl _atanl
-#define asinhl _asinhl
-#define acoshl _acoshl
-#define tanhl _tanhl
-#define atanhl _atanhl
-#define log10l _log10l
-#define log1pl _log1pl
-#define log2l _log2l
-
+#define coshl _coshl
+#define cosl _cosl
 #define cospi _cospi
 #define cospif _cospif
 #define cospil _cospil
-
-#define sinpi _sinpi
-#define sinpif _sinpif
-#define sinpil _sinpil
-
-#define tanpi _tanpi
-#define tanpif _tanpif
-#define tanpil _tanpil
-
-#define erfl _erfl
 #define erfcl _erfcl
-
-#define lgammal _lgammal
-#define lgammal_r _lgammal_r
-#define tgammal _tgammal
-
+#define erfl _erfl
+#define exp _exp
+#define exp2l _exp2l
+#define expf _expf
+#define expl _expl
+#define expm1l _expm1l
 #define feclearexcept _feclearexcept
+#define fedisableexcept _fedisableexcept
+#define feenableexcept _feenableexcept
 #define fegetenv _fegetenv
+#define fegetexcept _fegetexcept
 #define fegetexceptflag _fegetexceptflag
 #define fegetround _fegetround
 #define feholdexcept _feholdexcept
@@ -113,7 +51,53 @@
 #define fesetround _fesetround
 #define fetestexcept _fetestexcept
 #define feupdateenv _feupdateenv
-
-#define fedisableexcept _fedisableexcept
-#define feenableexcept _feenableexcept
-#define fegetexcept _fegetexcept
+#define finite _finite
+#define finitef _finitef
+#define floorl _floorl
+#define fmodl _fmodl
+#define hypot _hypot
+#define hypotf _hypotf
+#define hypotl _hypotl
+#define lgammal _lgammal
+#define lgammal_r _lgammal_r
+#define log _log
+#define log10l _log10l
+#define log1pl _log1pl
+#define log2l _log2l
+#define logf _logf
+#define logl _logl
+#define modfl _modfl
+#define powl _powl
+#define remquo _remquo
+#define remquof _remquof
+#define remquol _remquol
+#define roundl _roundl
+#define scalbln _scalbln
+#define scalblnf _scalblnf
+#define scalblnl _scalblnl
+#define scalbn _scalbn
+#define scalbnf _scalbnf
+#define scalbnl _scalbnl
+#define sin _sin
+#define sincos _sincos
+#define sincosf _sincosf
+#define sincosl _sincosl
+#define sinf _sinf
+#define sinh _sinh
+#define sinhf _sinhf
+#define sinhl _sinhl
+#define sinhl _sinhl
+#define sinl _sinl
+#define sinpi _sinpi
+#define sinpif _sinpif
+#define sinpil _sinpil
+#define sqrtl _sqrtl
+#define tan _tan
+#define tanf _tanf
+#define tanhl _tanhl
+#define tanl _tanl
+#define tanpi _tanpi
+#define tanpif 

CVS commit: src/lib/libm/src

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 13:33:03 UTC 2024

Modified Files:
src/lib/libm/src: namespace.h

Log Message:
libm/src/namespace.h: Sort.

No functional change intended.

Grouping vaguely by functionality makes this painful to update.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/lib/libm/src/namespace.h

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



CVS commit: src/lib/libcurses

2024-06-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun  9 13:02:24 UTC 2024

Modified Files:
src/lib/libcurses: ctrace.c

Log Message:
libcurses: fix lint warning about function without header prototype


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/ctrace.c

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

Modified files:

Index: src/lib/libcurses/ctrace.c
diff -u src/lib/libcurses/ctrace.c:1.23 src/lib/libcurses/ctrace.c:1.24
--- src/lib/libcurses/ctrace.c:1.23	Mon Oct 29 00:31:57 2018
+++ src/lib/libcurses/ctrace.c	Sun Jun  9 13:02:24 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctrace.c,v 1.23 2018/10/29 00:31:57 uwe Exp $	*/
+/*	$NetBSD: ctrace.c,v 1.24 2024/06/09 13:02:24 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -30,13 +30,11 @@
  */
 
 #include 
-#ifndef lint
 #if 0
 static char sccsid[] = "@(#)ctrace.c	8.2 (Berkeley) 10/5/93";
 #else
-__RCSID("$NetBSD: ctrace.c,v 1.23 2018/10/29 00:31:57 uwe Exp $");
+__RCSID("$NetBSD: ctrace.c,v 1.24 2024/06/09 13:02:24 rillig Exp $");
 #endif
-#endif/* not lint */
 
 #ifdef DEBUG
 #include 
@@ -106,13 +104,6 @@ __CTRACE(int area, const char *fmt,...)
 	(void)fflush(tracefp);
 }
 #else
-/* this kills the empty translation unit message from lint... */
-void
-__cursesi_make_lint_shut_up_if_debug_not_defined(void);
-
-void
-__cursesi_make_lint_shut_up_if_debug_not_defined(void)
-{
-	return;
-}
+/* Prevent an 'empty translation unit' message from lint. */
+typedef int dummy;
 #endif



CVS commit: src/lib/libcurses

2024-06-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun  9 13:02:24 UTC 2024

Modified Files:
src/lib/libcurses: ctrace.c

Log Message:
libcurses: fix lint warning about function without header prototype


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libcurses/ctrace.c

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



CVS commit: src/lib/libc

2024-06-08 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun  8 21:35:18 UTC 2024

Modified Files:
src/lib/libc/locale: global_locale.c setlocale.c setlocale_local.h
src/lib/libc/string: Makefile.inc strerror_r.c

Log Message:
Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/locale/global_locale.c
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/locale/setlocale.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/setlocale_local.h
cvs rdiff -u -r1.89 -r1.90 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/string/strerror_r.c

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

Modified files:

Index: src/lib/libc/locale/global_locale.c
diff -u src/lib/libc/locale/global_locale.c:1.28 src/lib/libc/locale/global_locale.c:1.29
--- src/lib/libc/locale/global_locale.c:1.28	Fri Jun  7 13:53:23 2024
+++ src/lib/libc/locale/global_locale.c	Sat Jun  8 21:35:18 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.28 2024/06/07 13:53:23 riastradh Exp $ */
+/* $NetBSD: global_locale.c,v 1.29 2024/06/08 21:35:18 joerg Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,12 +28,15 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: global_locale.c,v 1.28 2024/06/07 13:53:23 riastradh Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.29 2024/06/08 21:35:18 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
+#include "namespace.h"
+
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #define __SETLOCALE_SOURCE__
@@ -137,6 +140,9 @@ __dso_hidden const struct _locale_cache_
 },
 .monetary_name = _lc_C_locale_name,
 .numeric_name = _lc_C_locale_name,
+.message_name = _lc_C_locale_name,
+.errlistp = _errlist,
+.errlist_prefix = "Unknown error: %d",
 };
 
 struct _locale _lc_global_locale = {

Index: src/lib/libc/locale/setlocale.c
diff -u src/lib/libc/locale/setlocale.c:1.65 src/lib/libc/locale/setlocale.c:1.66
--- src/lib/libc/locale/setlocale.c:1.65	Thu Jan  4 20:57:29 2018
+++ src/lib/libc/locale/setlocale.c	Sat Jun  8 21:35:18 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: setlocale.c,v 1.65 2018/01/04 20:57:29 kamil Exp $ */
+/* $NetBSD: setlocale.c,v 1.66 2024/06/08 21:35:18 joerg Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: setlocale.c,v 1.65 2018/01/04 20:57:29 kamil Exp $");
+__RCSID("$NetBSD: setlocale.c,v 1.66 2024/06/08 21:35:18 joerg Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -65,6 +65,7 @@ _setlocale_cache(locale_t loc, struct _l
 {
 	const char *monetary_name = loc->part_name[LC_MONETARY];
 	const char *numeric_name = loc->part_name[LC_NUMERIC];
+	const char *message_name = loc->part_name[LC_MESSAGES];
 	_NumericLocale *numeric = loc->part_impl[LC_NUMERIC];
 	_MonetaryLocale *monetary = loc->part_impl[LC_MONETARY];
 	struct lconv *ldata;
@@ -78,6 +79,9 @@ _setlocale_cache(locale_t loc, struct _l
 		if (numeric_name != old_cache->numeric_name &&
 		strcmp(numeric_name, old_cache->numeric_name) != 0)
 			continue;
+		if (message_name != old_cache->message_name &&
+		strcmp(message_name, old_cache->message_name) != 0)
+			continue;
 		loc->cache = old_cache;
 		free(cache);
 		return 0;
@@ -91,6 +95,10 @@ _setlocale_cache(locale_t loc, struct _l
 
 	cache->monetary_name = monetary_name;
 	cache->numeric_name = numeric_name;
+	cache->message_name = message_name;
+	cache->errlist = NULL;
+	cache->errlistp = >errlist;
+	cache->errlist_prefix = NULL;
 	ldata = >ldata;
 
 	ldata->decimal_point = __UNCONST(numeric->decimal_point);

Index: src/lib/libc/locale/setlocale_local.h
diff -u src/lib/libc/locale/setlocale_local.h:1.17 src/lib/libc/locale/setlocale_local.h:1.18
--- src/lib/libc/locale/setlocale_local.h:1.17	Fri Apr 29 16:26:48 2016
+++ src/lib/libc/locale/setlocale_local.h	Sat Jun  8 21:35:18 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: setlocale_local.h,v 1.17 2016/04/29 16:26:48 joerg Exp $ */
+/* $NetBSD: setlocale_local.h,v 1.18 2024/06/08 21:35:18 joerg Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -48,7 +48,11 @@ struct _locale_cache_t {
 	SLIST_ENTRY(_locale_cache_t) cache_link;
 	const char *monetary_name;
 	const char *numeric_name;
+	const char *message_name;
 	struct lconv ldata;
+	const char * errlist_prefix;
+	const char * const *errlist;
+	const char * const **errlistp;
 };
 
 struct _locale {

Index: src/lib/libc/string/Makefile.inc
diff -u src/lib/libc/string/Makefile.inc:1.89 

CVS commit: src/lib/libc

2024-06-08 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun  8 21:35:18 UTC 2024

Modified Files:
src/lib/libc/locale: global_locale.c setlocale.c setlocale_local.h
src/lib/libc/string: Makefile.inc strerror_r.c

Log Message:
Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/locale/global_locale.c
cvs rdiff -u -r1.65 -r1.66 src/lib/libc/locale/setlocale.c
cvs rdiff -u -r1.17 -r1.18 src/lib/libc/locale/setlocale_local.h
cvs rdiff -u -r1.89 -r1.90 src/lib/libc/string/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/string/strerror_r.c

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



Re: CVS commit: src/lib/libc

2024-06-08 Thread Taylor R Campbell
> Date: Sat, 8 Jun 2024 11:51:43 +0200
> From: Roland Illig 
> 
> Am 07.06.2024 um 22:50 schrieb Taylor R Campbell:
> > libc: Pacify lint on aarch64.
> >
> > +++ src/lib/libc/stdlib/Makefile.incFri Jun  7 20:50:13 2024
> > +# lint(1) spuriously complains about `*s == CHAR_MAX' even though *s
> > +# has type char.
> > +LINTFLAGS.strfmon.c += -X 230
> 
> I guess the "spuriously" here means "on platforms where 'char' is
> unsigned", not "sometimes on the same platform, unpredictably".

Correct.

> Lint does not warn if the constant is defined as a character constant,
> so '\xff' instead of 0xff would work, but I don't know what else would
> be affected if the definition of CHAR_MAX were changed.

Might work but I'm reluctant to try without extensive testing on a lot
of compilers in a lot of environments.  E.g., does that work in C89?

> Ideally, lint would not warn about this expression, but since lint only
> looks at the preprocessed translation unit, it cannot know that the 0xff
> comes from CHAR_MAX and thus is fine.  Practically, suppressing the
> warning in this particular case makes sense.
> 
> Any ideas how to resolve this situation?

No brilliant ideas, sorry, other than to teach lint to track
provenance of constants through macro expansion.  That's why I just
disabled the warning for this case.


Re: CVS commit: src/lib/libc

2024-06-08 Thread Roland Illig
Am 07.06.2024 um 22:50 schrieb Taylor R Campbell:
> libc: Pacify lint on aarch64.
>
> +++ src/lib/libc/stdlib/Makefile.inc  Fri Jun  7 20:50:13 2024
> +# lint(1) spuriously complains about `*s == CHAR_MAX' even though *s
> +# has type char.
> +LINTFLAGS.strfmon.c += -X 230

I guess the "spuriously" here means "on platforms where 'char' is
unsigned", not "sometimes on the same platform, unpredictably".

When CHAR_MAX is defined as 0xff, lint assumes that the same constant
with the same value is used on other platforms as well, thus the
warning.  This is due to lint's -p flag for portability checks.

Lint does not warn if the constant is defined as a character constant,
so '\xff' instead of 0xff would work, but I don't know what else would
be affected if the definition of CHAR_MAX were changed.

Ideally, lint would not warn about this expression, but since lint only
looks at the preprocessed translation unit, it cannot know that the 0xff
comes from CHAR_MAX and thus is fine.  Practically, suppressing the
warning in this particular case makes sense.

Any ideas how to resolve this situation?

Roland



CVS commit: src/lib/libpthread

2024-06-08 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jun  8 08:01:49 UTC 2024

Modified Files:
src/lib/libpthread: pthread.c

Log Message:
Fix resource leak in pthread_create().  Pthread field "pt_lwpctl"
must not be accessed after _lwp_exit() as the kernel may free
it, attach it to another thread and change its "lc_curcpu".

The "pthread__deadqueue" will fill up with pthreads with
an invalid "pt_lwpctl" and allocated stack that never get
reused.

Replace the test "lc_curcpu == LWPCTL_CPU_EXITED" with
test "_lwp_kill(newthread->pt_lid, 0) == -1 && errno == ESRCH"
to make sure this thread has finished its _lwp_exit().

PR lib/57831 "Memory leaks in libpthread/libc"


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/lib/libpthread/pthread.c

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

Modified files:

Index: src/lib/libpthread/pthread.c
diff -u src/lib/libpthread/pthread.c:1.184 src/lib/libpthread/pthread.c:1.185
--- src/lib/libpthread/pthread.c:1.184	Tue Nov 28 02:54:33 2023
+++ src/lib/libpthread/pthread.c	Sat Jun  8 08:01:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pthread.c,v 1.184 2023/11/28 02:54:33 riastradh Exp $	*/
+/*	$NetBSD: pthread.c,v 1.185 2024/06/08 08:01:49 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008, 2020
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: pthread.c,v 1.184 2023/11/28 02:54:33 riastradh Exp $");
+__RCSID("$NetBSD: pthread.c,v 1.185 2024/06/08 08:01:49 hannken Exp $");
 
 #define	__EXPOSE_STACK	1
 
@@ -462,9 +462,9 @@ pthread_create(pthread_t *thread, const 
 	if (!PTQ_EMPTY(__deadqueue)) {
 		pthread_mutex_lock(__deadqueue_lock);
 		PTQ_FOREACH(newthread, __deadqueue, pt_deadq) {
-			/* Still busily exiting, or finished? */
-			if (newthread->pt_lwpctl->lc_curcpu ==
-			LWPCTL_CPU_EXITED)
+			/* Still running? */
+			if (_lwp_kill(newthread->pt_lid, 0) == -1 &&
+			errno == ESRCH)
 break;
 		}
 		if (newthread)



CVS commit: src/lib/libpthread

2024-06-08 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jun  8 08:01:49 UTC 2024

Modified Files:
src/lib/libpthread: pthread.c

Log Message:
Fix resource leak in pthread_create().  Pthread field "pt_lwpctl"
must not be accessed after _lwp_exit() as the kernel may free
it, attach it to another thread and change its "lc_curcpu".

The "pthread__deadqueue" will fill up with pthreads with
an invalid "pt_lwpctl" and allocated stack that never get
reused.

Replace the test "lc_curcpu == LWPCTL_CPU_EXITED" with
test "_lwp_kill(newthread->pt_lid, 0) == -1 && errno == ESRCH"
to make sure this thread has finished its _lwp_exit().

PR lib/57831 "Memory leaks in libpthread/libc"


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/lib/libpthread/pthread.c

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



CVS commit: src/lib/libc/compiler_rt

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 20:50:27 UTC 2024

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
lib/libc/compiler_rt/Makefile.inc: Sort LINTFLAGS lines.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/compiler_rt/Makefile.inc

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



CVS commit: src/lib/libc/compiler_rt

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 20:50:27 UTC 2024

Modified Files:
src/lib/libc/compiler_rt: Makefile.inc

Log Message:
lib/libc/compiler_rt/Makefile.inc: Sort LINTFLAGS lines.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/lib/libc/compiler_rt/Makefile.inc

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

Modified files:

Index: src/lib/libc/compiler_rt/Makefile.inc
diff -u src/lib/libc/compiler_rt/Makefile.inc:1.49 src/lib/libc/compiler_rt/Makefile.inc:1.50
--- src/lib/libc/compiler_rt/Makefile.inc:1.49	Fri Jun  7 20:50:13 2024
+++ src/lib/libc/compiler_rt/Makefile.inc	Fri Jun  7 20:50:27 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.49 2024/06/07 20:50:13 riastradh Exp $
+# $NetBSD: Makefile.inc,v 1.50 2024/06/07 20:50:27 riastradh Exp $
 
 COMPILER_RT_DIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt
 COMPILER_RT_SRCDIR=	${COMPILER_RT_DIR}/dist
@@ -334,8 +334,8 @@ COPTS.${src}+=	-D__SOFT_FP__
 
 LINTFLAGS.GCDAProfiling.c += -X 123,132,351 # Ok, this is just sloppy
 LINTFLAGS.GCDAProfiling.c += -X 298 # vax
-LINTFLAGS.InstrProfiling.c += -X 351
 LINTFLAGS.InstrProfiling.c += -X 298 # vax
+LINTFLAGS.InstrProfiling.c += -X 351
 LINTFLAGS.InstrProfilingFile.c += -X 351
 LINTFLAGS.InstrProfilingPlatformLinux.c += -X 190,351
 LINTFLAGS.InstrProfilingValue.c += -X 132,231,275,351
@@ -349,8 +349,8 @@ LINTFLAGS.addvdi3.c += -X 351
 LINTFLAGS.addvsi3.c += -X 351
 LINTFLAGS.addvti3.c += -X 351
 LINTFLAGS.ashlti3.c += -X 351
-LINTFLAGS.ashrti3.c += -X 117,351
 LINTFLAGS.ashrdi3.c += -X 117 # vax
+LINTFLAGS.ashrti3.c += -X 117,351
 LINTFLAGS.clzdi2.c += -X 351
 LINTFLAGS.clzsi2.c += -X 351
 LINTFLAGS.cmpti2.c += -X 351
@@ -362,8 +362,8 @@ LINTFLAGS.ctzti2.c += -X 351
 LINTFLAGS.divdi3.c += -X 117 # vax
 LINTFLAGS.divmodsi4.c += -X 351
 LINTFLAGS.divsi3.c += -X 117
-LINTFLAGS.divti3.c += -X 117,351
 LINTFLAGS.divtc3.c += -X 351	# ppc
+LINTFLAGS.divti3.c += -X 117,351
 LINTFLAGS.dlfcn_elf.c += -X 351
 LINTFLAGS.ffsdi2.c += -X 132,351
 LINTFLAGS.ffsti2.c += -X 132,351
@@ -381,12 +381,12 @@ LINTFLAGS.fixunsxfsi.c += -X 132,309,351
 LINTFLAGS.fixunsxfti.c += -X 132,351
 LINTFLAGS.fixxfdi.c += -X 351
 LINTFLAGS.fixxfti.c += -X 117,132,351
-LINTFLAGS.floatdidf.c += -X 351
 LINTFLAGS.floatdidf.c += -X 117	# alpha
-LINTFLAGS.floatdisf.c += -X 351
+LINTFLAGS.floatdidf.c += -X 351
 LINTFLAGS.floatdisf.c += -X 117	# alpha
-LINTFLAGS.floatdixf.c += -X 351
+LINTFLAGS.floatdisf.c += -X 351
 LINTFLAGS.floatdixf.c += -X 117	# alpha
+LINTFLAGS.floatdixf.c += -X 351
 LINTFLAGS.floattidf.c += -X 117,122,141,267,351
 LINTFLAGS.floattisf.c += -X 117,351
 LINTFLAGS.floattisf.c += -X 117,351



CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 20:50:13 UTC 2024

Modified Files:
src/lib/libc/arch/aarch64/gen: Makefile.inc fpgetmask.c fpgetround.c
fpsetmask.c fpsetround.c
src/lib/libc/compat/net: Makefile.inc
src/lib/libc/compiler_rt: Makefile.inc
src/lib/libc/gdtoa: Makefile.inc
src/lib/libc/nameser: Makefile.inc
src/lib/libc/stdlib: Makefile.inc

Log Message:
libc: Pacify lint on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/Makefile.inc \
src/lib/libc/arch/aarch64/gen/fpgetmask.c \
src/lib/libc/arch/aarch64/gen/fpgetround.c \
src/lib/libc/arch/aarch64/gen/fpsetmask.c \
src/lib/libc/arch/aarch64/gen/fpsetround.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/net/Makefile.inc
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/compiler_rt/Makefile.inc
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/gdtoa/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/nameser/Makefile.inc
cvs rdiff -u -r1.98 -r1.99 src/lib/libc/stdlib/Makefile.inc

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

Modified files:

Index: src/lib/libc/arch/aarch64/gen/Makefile.inc
diff -u src/lib/libc/arch/aarch64/gen/Makefile.inc:1.2 src/lib/libc/arch/aarch64/gen/Makefile.inc:1.3
--- src/lib/libc/arch/aarch64/gen/Makefile.inc:1.2	Tue Jul  7 21:40:19 2015
+++ src/lib/libc/arch/aarch64/gen/Makefile.inc	Fri Jun  7 20:50:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.2 2015/07/07 21:40:19 matt Exp $
+# $NetBSD: Makefile.inc,v 1.3 2024/06/07 20:50:13 riastradh Exp $
 
 SRCS+=	byte_swap_2.S byte_swap_4.S byte_swap_8.S
 SRCS+=	flt_rounds.c
@@ -27,6 +27,20 @@ SRCS+=	makecontext.c resumecontext.c swa
 
 SRCS+=	_lwp.c
 
+LINTFLAGS.fpclassifyl_ieee754.c+=	-X 132
+LINTFLAGS.isfinitel_ieee754.c+=		-X 132
+LINTFLAGS.isinfl_ieee754.c+=		-X 132
+LINTFLAGS.fixunstfdi_ieee754.c+=	-X 132
+LINTFLAGS.fixunstfsi_ieee754.c+=	-X 132
+LINTFLAGS.fpsetround.c+=		-X 132
+LINTFLAGS.isnanl_ieee754.c+=		-X 132
+LINTFLAGS.signbitl_ieee754.c+=		-X 132
+LINTFLAGS.fpgetmask.c+=			-X 132
+LINTFLAGS.fpgetround.c+=		-X 132
+LINTFLAGS.fpgetsticky.c+=		-X 132
+LINTFLAGS.fpsetmask.c+=			-X 132
+LINTFLAGS.fpsetsticky.c+=		-X 132
+
 #LSRCS.arm.gen=	Lint_bswap16.c Lint_bswap32.c Lint_swapcontext.c
 #LSRCS+=		${LSRCS.arm.gen}
 #DPSRCS+=	${LSRCS.arm.gen}
Index: src/lib/libc/arch/aarch64/gen/fpgetmask.c
diff -u src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.2 src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.3
--- src/lib/libc/arch/aarch64/gen/fpgetmask.c:1.2	Sat Dec 24 15:23:06 2016
+++ src/lib/libc/arch/aarch64/gen/fpgetmask.c	Fri Jun  7 20:50:13 2024
@@ -29,7 +29,7 @@
 
 #include 
 
-__RCSID("$NetBSD: fpgetmask.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
+__RCSID("$NetBSD: fpgetmask.c,v 1.3 2024/06/07 20:50:13 riastradh Exp $");
 
 #include 
 #include 
@@ -40,7 +40,7 @@ __RCSID("$NetBSD: fpgetmask.c,v 1.2 2016
 
 #include 
 
-__weak_alias(fpgetmask,_fpgetmask);
+__weak_alias(fpgetmask,_fpgetmask)
 
 fp_except_t
 fpgetmask(void)
Index: src/lib/libc/arch/aarch64/gen/fpgetround.c
diff -u src/lib/libc/arch/aarch64/gen/fpgetround.c:1.2 src/lib/libc/arch/aarch64/gen/fpgetround.c:1.3
--- src/lib/libc/arch/aarch64/gen/fpgetround.c:1.2	Sat Dec 24 15:23:06 2016
+++ src/lib/libc/arch/aarch64/gen/fpgetround.c	Fri Jun  7 20:50:13 2024
@@ -29,7 +29,7 @@
 
 #include 
 
-__RCSID("$NetBSD: fpgetround.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
+__RCSID("$NetBSD: fpgetround.c,v 1.3 2024/06/07 20:50:13 riastradh Exp $");
 
 #include 
 #include 
@@ -40,7 +40,7 @@ __RCSID("$NetBSD: fpgetround.c,v 1.2 201
 
 #include 
 
-__weak_alias(fpgetround,_fpgetround);
+__weak_alias(fpgetround,_fpgetround)
 
 fp_rnd_t
 fpgetround(void)
Index: src/lib/libc/arch/aarch64/gen/fpsetmask.c
diff -u src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.2 src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.3
--- src/lib/libc/arch/aarch64/gen/fpsetmask.c:1.2	Sat Dec 24 15:23:06 2016
+++ src/lib/libc/arch/aarch64/gen/fpsetmask.c	Fri Jun  7 20:50:13 2024
@@ -29,7 +29,7 @@
 
 #include 
 
-__RCSID("$NetBSD: fpsetmask.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.3 2024/06/07 20:50:13 riastradh Exp $");
 
 #include 
 #include 
@@ -40,7 +40,7 @@ __RCSID("$NetBSD: fpsetmask.c,v 1.2 2016
 
 #include 
 
-__weak_alias(fpsetmask,_fpsetmask);
+__weak_alias(fpsetmask,_fpsetmask)
 
 fp_except_t
 fpsetmask(fp_except_t mask)
Index: src/lib/libc/arch/aarch64/gen/fpsetround.c
diff -u src/lib/libc/arch/aarch64/gen/fpsetround.c:1.2 src/lib/libc/arch/aarch64/gen/fpsetround.c:1.3
--- src/lib/libc/arch/aarch64/gen/fpsetround.c:1.2	Sat Dec 24 15:23:06 2016
+++ src/lib/libc/arch/aarch64/gen/fpsetround.c	Fri Jun  7 20:50:13 2024
@@ -29,7 +29,7 @@
 
 #include 
 
-__RCSID("$NetBSD: fpsetround.c,v 1.2 2016/12/24 15:23:06 maya Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.3 2024/06/07 20:50:13 riastradh Exp $");
 
 #include 
 #include 
@@ -40,7 

CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 20:50:13 UTC 2024

Modified Files:
src/lib/libc/arch/aarch64/gen: Makefile.inc fpgetmask.c fpgetround.c
fpsetmask.c fpsetround.c
src/lib/libc/compat/net: Makefile.inc
src/lib/libc/compiler_rt: Makefile.inc
src/lib/libc/gdtoa: Makefile.inc
src/lib/libc/nameser: Makefile.inc
src/lib/libc/stdlib: Makefile.inc

Log Message:
libc: Pacify lint on aarch64.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/aarch64/gen/Makefile.inc \
src/lib/libc/arch/aarch64/gen/fpgetmask.c \
src/lib/libc/arch/aarch64/gen/fpgetround.c \
src/lib/libc/arch/aarch64/gen/fpsetmask.c \
src/lib/libc/arch/aarch64/gen/fpsetround.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/compat/net/Makefile.inc
cvs rdiff -u -r1.48 -r1.49 src/lib/libc/compiler_rt/Makefile.inc
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/gdtoa/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/nameser/Makefile.inc
cvs rdiff -u -r1.98 -r1.99 src/lib/libc/stdlib/Makefile.inc

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



CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:23 UTC 2024

Modified Files:
src/lib/libc/gen: isctype.c
src/lib/libc/locale: global_locale.c iswctype_mb.c multibyte.h
src/lib/libc/time: strftime.c strptime.c

Log Message:
libc/locale: Nix needless size_t casts.

No functional change intended.  No binary change to aarch64 libc.

Prompted by code inspection around PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/isctype.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/locale/global_locale.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/iswctype_mb.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte.h
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/time/strftime.c
cvs rdiff -u -r1.66 -r1.67 src/lib/libc/time/strptime.c

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

Modified files:

Index: src/lib/libc/gen/isctype.c
diff -u src/lib/libc/gen/isctype.c:1.25 src/lib/libc/gen/isctype.c:1.26
--- src/lib/libc/gen/isctype.c:1.25	Mon Aug 19 22:43:28 2013
+++ src/lib/libc/gen/isctype.c	Fri Jun  7 13:53:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: isctype.c,v 1.25 2013/08/19 22:43:28 joerg Exp $ */
+/* $NetBSD: isctype.c,v 1.26 2024/06/07 13:53:22 riastradh Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: isctype.c,v 1.25 2013/08/19 22:43:28 joerg Exp $");
+__RCSID("$NetBSD: isctype.c,v 1.26 2024/06/07 13:53:22 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -48,7 +48,7 @@ __RCSID("$NetBSD: isctype.c,v 1.25 2013/
 #include "setlocale_local.h"
 
 #define _RUNE_LOCALE(loc) \
-((_RuneLocale *)((loc)->part_impl[(size_t)LC_CTYPE]))
+((_RuneLocale *)((loc)->part_impl[LC_CTYPE]))
 
 #define _ISCTYPE_FUNC(name, bit) \
 int \

Index: src/lib/libc/locale/global_locale.c
diff -u src/lib/libc/locale/global_locale.c:1.27 src/lib/libc/locale/global_locale.c:1.28
--- src/lib/libc/locale/global_locale.c:1.27	Fri Jun  7 13:53:12 2024
+++ src/lib/libc/locale/global_locale.c	Fri Jun  7 13:53:23 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.27 2024/06/07 13:53:12 riastradh Exp $ */
+/* $NetBSD: global_locale.c,v 1.28 2024/06/07 13:53:23 riastradh Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: global_locale.c,v 1.27 2024/06/07 13:53:12 riastradh Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.28 2024/06/07 13:53:23 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -143,26 +143,26 @@ struct _locale _lc_global_locale = {
 .cache = &_C_cache,
 .query = { _C_LOCALE },
 .part_name = {
-	[(size_t)LC_ALL ] = _lc_C_locale_name,
-	[(size_t)LC_COLLATE ] = _lc_C_locale_name,
-	[(size_t)LC_CTYPE   ] = _lc_C_locale_name,
-	[(size_t)LC_MONETARY] = _lc_C_locale_name,
-	[(size_t)LC_NUMERIC ] = _lc_C_locale_name,
-	[(size_t)LC_TIME] = _lc_C_locale_name,
-	[(size_t)LC_MESSAGES] = _lc_C_locale_name,
+	[LC_ALL ] = _lc_C_locale_name,
+	[LC_COLLATE ] = _lc_C_locale_name,
+	[LC_CTYPE   ] = _lc_C_locale_name,
+	[LC_MONETARY] = _lc_C_locale_name,
+	[LC_NUMERIC ] = _lc_C_locale_name,
+	[LC_TIME] = _lc_C_locale_name,
+	[LC_MESSAGES] = _lc_C_locale_name,
 },
 .part_impl = {
-	[(size_t)LC_ALL ] = (_locale_part_t)NULL,
-	[(size_t)LC_COLLATE ] = (_locale_part_t)NULL,
-	[(size_t)LC_CTYPE   ] = (_locale_part_t)
+	[LC_ALL ] = (_locale_part_t)NULL,
+	[LC_COLLATE ] = (_locale_part_t)NULL,
+	[LC_CTYPE   ] = (_locale_part_t)
 	__UNCONST(&_DefaultRuneLocale),
-	[(size_t)LC_MONETARY] = (_locale_part_t)
+	[LC_MONETARY] = (_locale_part_t)
 	__UNCONST(&_DefaultMonetaryLocale),
-	[(size_t)LC_NUMERIC ] = (_locale_part_t)
+	[LC_NUMERIC ] = (_locale_part_t)
 	__UNCONST(&_DefaultNumericLocale),
-	[(size_t)LC_MESSAGES] = (_locale_part_t)
+	[LC_MESSAGES] = (_locale_part_t)
 	__UNCONST(&_DefaultMessagesLocale),
-	[(size_t)LC_TIME] = (_locale_part_t)
+	[LC_TIME] = (_locale_part_t)
 	__UNCONST(&_DefaultTimeLocale),
 },
 };
@@ -171,26 +171,26 @@ const struct _locale _lc_C_locale = {
 .cache = &_C_cache,
 .query = { _C_LOCALE },
 .part_name = {
-	[(size_t)LC_ALL ] = _lc_C_locale_name,
-	[(size_t)LC_COLLATE ] = _lc_C_locale_name,
-	[(size_t)LC_CTYPE   ] = _lc_C_locale_name,
-	[(size_t)LC_MONETARY] = _lc_C_locale_name,
-	[(size_t)LC_NUMERIC ] = _lc_C_locale_name,
-	[(size_t)LC_TIME] = _lc_C_locale_name,
-	[(size_t)LC_MESSAGES] = _lc_C_locale_name,
+	[LC_ALL ] = _lc_C_locale_name,
+	[LC_COLLATE ] = _lc_C_locale_name,
+	[LC_CTYPE   ] = _lc_C_locale_name,
+	[LC_MONETARY] = _lc_C_locale_name,
+	[LC_NUMERIC ] = _lc_C_locale_name,
+	[LC_TIME] = _lc_C_locale_name,
+	[LC_MESSAGES] = _lc_C_locale_name,
 },
 .part_impl = {
-	[(size_t)LC_ALL ] = (_locale_part_t)NULL,
-	

CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:12 UTC 2024

Modified Files:
src/lib/libc/citrus: citrus_fix_grouping.h
src/lib/libc/locale: fix_grouping.c global_locale.c

Log Message:
libc/locale: Nix needless char casts.

These appear to have been added to pacify a spurious warning by lint,
which no longer warns about it anyway.

No functional change intended.  No binary change to aarch64 libc.

Prompted by code inspection around PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_fix_grouping.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/fix_grouping.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/locale/global_locale.c

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

Modified files:

Index: src/lib/libc/citrus/citrus_fix_grouping.h
diff -u src/lib/libc/citrus/citrus_fix_grouping.h:1.2 src/lib/libc/citrus/citrus_fix_grouping.h:1.3
--- src/lib/libc/citrus/citrus_fix_grouping.h:1.2	Sun Jan 11 02:46:24 2009
+++ src/lib/libc/citrus/citrus_fix_grouping.h	Fri Jun  7 13:53:12 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_fix_grouping.h,v 1.2 2009/01/11 02:46:24 christos Exp $ */
+/* $NetBSD: citrus_fix_grouping.h,v 1.3 2024/06/07 13:53:12 riastradh Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -43,7 +43,7 @@ _citrus_fixup_char_max_md(char *grouping
 
 	for (p = grouping; *p != '\0'; ++p) {
 		if (*p == _CITRUS_LC_GROUPING_VALUE_NO_FUTHER)
-			*p = (char)CHAR_MAX;
+			*p = CHAR_MAX;
 	}
 }
 #define _CITRUS_FIXUP_CHAR_MAX_MD(grouping) \

Index: src/lib/libc/locale/fix_grouping.c
diff -u src/lib/libc/locale/fix_grouping.c:1.6 src/lib/libc/locale/fix_grouping.c:1.7
--- src/lib/libc/locale/fix_grouping.c:1.6	Wed Mar 21 14:11:24 2012
+++ src/lib/libc/locale/fix_grouping.c	Fri Jun  7 13:53:12 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: fix_grouping.c,v 1.6 2012/03/21 14:11:24 christos Exp $ */
+/* $NetBSD: fix_grouping.c,v 1.7 2024/06/07 13:53:12 riastradh Exp $ */
 
 /*
  * Copyright (c) 2001 Alexey Zelkin 
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fix_grouping.c,v 1.6 2012/03/21 14:11:24 christos Exp $");
+__RCSID("$NetBSD: fix_grouping.c,v 1.7 2024/06/07 13:53:12 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -44,7 +44,7 @@ __RCSID("$NetBSD: fix_grouping.c,v 1.6 2
 #include "fix_grouping.h"
 
 #ifndef NBCHAR_MAX
-#define NBCHAR_MAX	(char)CHAR_MAX
+#define NBCHAR_MAX	CHAR_MAX
 #endif
 
 #ifndef __UNCONST

Index: src/lib/libc/locale/global_locale.c
diff -u src/lib/libc/locale/global_locale.c:1.26 src/lib/libc/locale/global_locale.c:1.27
--- src/lib/libc/locale/global_locale.c:1.26	Fri Jun  7 13:53:02 2024
+++ src/lib/libc/locale/global_locale.c	Fri Jun  7 13:53:12 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $ */
+/* $NetBSD: global_locale.c,v 1.27 2024/06/07 13:53:12 riastradh Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.27 2024/06/07 13:53:12 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -58,20 +58,20 @@ static const _MonetaryLocale _DefaultMon
 	"",
 	"",
 	"",
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX,
-	(char)CHAR_MAX
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX,
+	CHAR_MAX
 };
 
 static const _NumericLocale _DefaultNumericLocale = {



CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:23 UTC 2024

Modified Files:
src/lib/libc/gen: isctype.c
src/lib/libc/locale: global_locale.c iswctype_mb.c multibyte.h
src/lib/libc/time: strftime.c strptime.c

Log Message:
libc/locale: Nix needless size_t casts.

No functional change intended.  No binary change to aarch64 libc.

Prompted by code inspection around PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/gen/isctype.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/locale/global_locale.c
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/locale/iswctype_mb.c
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/locale/multibyte.h
cvs rdiff -u -r1.55 -r1.56 src/lib/libc/time/strftime.c
cvs rdiff -u -r1.66 -r1.67 src/lib/libc/time/strptime.c

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



CVS commit: src/lib/libc/locale

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:02 UTC 2024

Modified Files:
src/lib/libc/locale: global_locale.c

Log Message:
libc/locale/global_locale.c: Nix confusing NBCHAR_MAX.

NBCHAR_MAX is used only in the usr.bin/mklocale build, but that
doesn't use global_locale.c.  This was added when inserting char
casts, but using the mklocale's hook just to insert a char cast is
unnecessarily confusing -- and the char casts are unnecessary anyway.

No functional change intended.  No binary change to aarch64 libc.

Raised in PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/locale/global_locale.c

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

Modified files:

Index: src/lib/libc/locale/global_locale.c
diff -u src/lib/libc/locale/global_locale.c:1.25 src/lib/libc/locale/global_locale.c:1.26
--- src/lib/libc/locale/global_locale.c:1.25	Fri Apr 29 16:26:48 2016
+++ src/lib/libc/locale/global_locale.c	Fri Jun  7 13:53:02 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: global_locale.c,v 1.25 2016/04/29 16:26:48 joerg Exp $ */
+/* $NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: global_locale.c,v 1.25 2016/04/29 16:26:48 joerg Exp $");
+__RCSID("$NetBSD: global_locale.c,v 1.26 2024/06/07 13:53:02 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include 
@@ -43,10 +43,6 @@ __RCSID("$NetBSD: global_locale.c,v 1.25
 #include "runetype_local.h"
 #include "setlocale_local.h"
 
-#ifndef NBCHAR_MAX
-#define NBCHAR_MAX (char)CHAR_MAX
-#endif
-
 static const _MessagesLocale _DefaultMessagesLocale = {
 	"^[Yy]",
 	"^[Nn]",
@@ -124,20 +120,20 @@ __dso_hidden const struct _locale_cache_
 	.mon_grouping		= __UNCONST(""),
 	.positive_sign		= __UNCONST(""),
 	.negative_sign		= __UNCONST(""),
-	.int_frac_digits	= NBCHAR_MAX,
-	.frac_digits		= NBCHAR_MAX,
-	.p_cs_precedes		= NBCHAR_MAX,
-	.p_sep_by_space		= NBCHAR_MAX,
-	.n_cs_precedes		= NBCHAR_MAX,
-	.n_sep_by_space		= NBCHAR_MAX,
-	.p_sign_posn		= NBCHAR_MAX,
-	.n_sign_posn		= NBCHAR_MAX,
-	.int_p_cs_precedes	= NBCHAR_MAX,
-	.int_n_cs_precedes	= NBCHAR_MAX,
-	.int_p_sep_by_space	= NBCHAR_MAX,
-	.int_n_sep_by_space	= NBCHAR_MAX,
-	.int_p_sign_posn	= NBCHAR_MAX,
-	.int_n_sign_posn	= NBCHAR_MAX,
+	.int_frac_digits	= CHAR_MAX,
+	.frac_digits		= CHAR_MAX,
+	.p_cs_precedes		= CHAR_MAX,
+	.p_sep_by_space		= CHAR_MAX,
+	.n_cs_precedes		= CHAR_MAX,
+	.n_sep_by_space		= CHAR_MAX,
+	.p_sign_posn		= CHAR_MAX,
+	.n_sign_posn		= CHAR_MAX,
+	.int_p_cs_precedes	= CHAR_MAX,
+	.int_n_cs_precedes	= CHAR_MAX,
+	.int_p_sep_by_space	= CHAR_MAX,
+	.int_n_sep_by_space	= CHAR_MAX,
+	.int_p_sign_posn	= CHAR_MAX,
+	.int_n_sign_posn	= CHAR_MAX,
 },
 .monetary_name = _lc_C_locale_name,
 .numeric_name = _lc_C_locale_name,



CVS commit: src/lib/libc

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:12 UTC 2024

Modified Files:
src/lib/libc/citrus: citrus_fix_grouping.h
src/lib/libc/locale: fix_grouping.c global_locale.c

Log Message:
libc/locale: Nix needless char casts.

These appear to have been added to pacify a spurious warning by lint,
which no longer warns about it anyway.

No functional change intended.  No binary change to aarch64 libc.

Prompted by code inspection around PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/citrus/citrus_fix_grouping.h
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/fix_grouping.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libc/locale/global_locale.c

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



CVS commit: src/lib/libc/locale

2024-06-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jun  7 13:53:02 UTC 2024

Modified Files:
src/lib/libc/locale: global_locale.c

Log Message:
libc/locale/global_locale.c: Nix confusing NBCHAR_MAX.

NBCHAR_MAX is used only in the usr.bin/mklocale build, but that
doesn't use global_locale.c.  This was added when inserting char
casts, but using the mklocale's hook just to insert a char cast is
unnecessarily confusing -- and the char casts are unnecessary anyway.

No functional change intended.  No binary change to aarch64 libc.

Raised in PR lib/58319.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/lib/libc/locale/global_locale.c

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



CVS commit: src/lib/libc/compat/sys

2024-06-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jun  1 13:33:46 UTC 2024

Modified Files:
src/lib/libc/compat/sys: compat__lwp_park.c

Log Message:
Don't include both  and .


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

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

Modified files:

Index: src/lib/libc/compat/sys/compat__lwp_park.c
diff -u src/lib/libc/compat/sys/compat__lwp_park.c:1.2 src/lib/libc/compat/sys/compat__lwp_park.c:1.3
--- src/lib/libc/compat/sys/compat__lwp_park.c:1.2	Sun Jan 11 02:46:26 2009
+++ src/lib/libc/compat/sys/compat__lwp_park.c	Sat Jun  1 13:33:46 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat__lwp_park.c,v 1.2 2009/01/11 02:46:26 christos Exp $ */
+/*	$NetBSD: compat__lwp_park.c,v 1.3 2024/06/01 13:33:46 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,14 +37,13 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat__lwp_park.c,v 1.2 2009/01/11 02:46:26 christos Exp $");
+__RCSID("$NetBSD: compat__lwp_park.c,v 1.3 2024/06/01 13:33:46 thorpej Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
 #define __LIBC12_SOURCE__
 #include 
 #include 
-#include 
 #include 
 
 __warn_references(_lwp_park,



CVS commit: src/lib/libc/compat/sys

2024-06-01 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jun  1 13:33:46 UTC 2024

Modified Files:
src/lib/libc/compat/sys: compat__lwp_park.c

Log Message:
Don't include both  and .


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

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



CVS commit: src/lib/libc/arch/riscv

2024-05-30 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu May 30 15:56:43 UTC 2024

Modified Files:
src/lib/libc/arch/riscv: genassym.cf
src/lib/libc/arch/riscv/sys: __sigtramp2.S

Log Message:
Annotate the RISC-V signal trampoline with CFI attributes.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/genassym.cf
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/riscv/sys/__sigtramp2.S

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



CVS commit: src/lib

2024-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 13:35:12 UTC 2024

Modified Files:
src/lib: checkoldver

Log Message:
Improve robustness (from kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/checkoldver

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



CVS commit: src/lib

2024-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May 29 13:35:12 UTC 2024

Modified Files:
src/lib: checkoldver

Log Message:
Improve robustness (from kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/checkoldver

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

Modified files:

Index: src/lib/checkoldver
diff -u src/lib/checkoldver:1.4 src/lib/checkoldver:1.5
--- src/lib/checkoldver:1.4	Tue May 28 12:20:34 2024
+++ src/lib/checkoldver	Wed May 29 09:35:12 2024
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: checkoldver,v 1.4 2024/05/28 16:20:34 christos Exp $
+#	$NetBSD: checkoldver,v 1.5 2024/05/29 13:35:12 christos Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -47,16 +47,14 @@ delete() {
 	then
 		obsol="$obsol.$4"
 	fi
-	echo $PWD/$obsol
+	printf "${PWD}/${obsol}\n"
 }
 
 comparelib() {
 	local name="${1%.so.*}"
-	local version=${1#*.so.}
-	OIFS="$IFS"
-	IFS="$IFS."
+	local version="${1#"${name}"*.so.}"
+	local IFS=.
 	set -- $version
-	IFS="$OIFS"
 
 	if [ -z "$libmajor" ]
 	then



CVS commit: src/lib

2024-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 28 16:20:34 UTC 2024

Modified Files:
src/lib: checkoldver

Log Message:
handle library names that contain a period.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/checkoldver

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



CVS commit: src/lib

2024-05-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 28 16:20:34 UTC 2024

Modified Files:
src/lib: checkoldver

Log Message:
handle library names that contain a period.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/checkoldver

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

Modified files:

Index: src/lib/checkoldver
diff -u src/lib/checkoldver:1.3 src/lib/checkoldver:1.4
--- src/lib/checkoldver:1.3	Wed Apr 30 09:10:50 2008
+++ src/lib/checkoldver	Tue May 28 12:20:34 2024
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: checkoldver,v 1.3 2008/04/30 13:10:50 martin Exp $
+#	$NetBSD: checkoldver,v 1.4 2024/05/28 16:20:34 christos Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -51,33 +51,31 @@ delete() {
 }
 
 comparelib() {
+	local name="${1%.so.*}"
+	local version=${1#*.so.}
 	OIFS="$IFS"
 	IFS="$IFS."
-	set -- $1
+	set -- $version
 	IFS="$OIFS"
-	if [ "$3" = "[0-9]*" ]
-	then
-		return
-	fi
 
 	if [ -z "$libmajor" ]
 	then
-		libname="$1"
-		libmajor="$3"
-		libminor="$4"
-		libtiny="$5"
+		libname="$name"
+		libmajor="$1"
+		libminor="$2"
+		libtiny="$3"
 		return
 	fi
-	if [ "$libmajor" -lt "$3" ]
+	if [ "$libmajor" -lt "$1" ]
 	then
 		delete "$libname" "$libmajor" "$libminor" "$libtiny"
-		libmajor="$3"
-		libminor="$4"
-		libtiny="$5"
+		libmajor="$1"
+		libminor="$2"
+		libtiny="$3"
 		return
-	elif [ "$3" -lt "$libmajor" ]
+	elif [ "$1" -lt "$libmajor" ]
 	then
-		delete "$libname" "$3" "$4" "$5"
+		delete "$libname" "$1" "$2" "$3"
 		return
 	fi
 
@@ -85,16 +83,16 @@ comparelib() {
 	then
 		return
 	fi
-	if [ "$libminor" -lt "$4" ]
+	if [ "$libminor" -lt "$2" ]
 	then
 		delete "$libname" "$libmajor" "$libminor" "$libtiny"
-		libmajor="$3"
-		libminor="$4"
-		libtiny="$5"
+		libmajor="$1"
+		libminor="$2"
+		libtiny="$3"
 		return
-	elif [ "$4" -lt "$libminor" ]
+	elif [ "$2" -lt "$libminor" ]
 	then
-		delete "$libname" "$3" "$4" "$5"
+		delete "$libname" "$1" "$2" "$3"
 		return
 	fi
 
@@ -102,16 +100,16 @@ comparelib() {
 	then
 		return
 	fi
-	if [ "$libtiny" -lt "$5" ]
+	if [ "$libtiny" -lt "$3" ]
 	then
 		delete "$libname" "$libmajor" "$libminor" "$libtiny"
-		libmajor="$3"
-		libminor="$4"
-		libtiny="$5"
+		libmajor="$1"
+		libminor="$2"
+		libtiny="$3"
 		return
 	elif [ "$5" -lt "$libminor" ]
 	then
-		delete "$libname" "$3" "$4" "$5"
+		delete "$libname" "$1" "$2" "$3"
 		return
 	fi
 }



CVS commit: src/lib/libc/arch/riscv/sys

2024-05-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 28 06:57:17 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/sys: __sigtramp2.S

Log Message:
Change MIPS to RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/sys/__sigtramp2.S

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

Modified files:

Index: src/lib/libc/arch/riscv/sys/__sigtramp2.S
diff -u src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.3 src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.4
--- src/lib/libc/arch/riscv/sys/__sigtramp2.S:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/sys/__sigtramp2.S	Tue May 28 06:57:17 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: __sigtramp2.S,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: __sigtramp2.S,v 1.4 2024/05/28 06:57:17 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,12 +33,12 @@
 #include "assym.h"
 
 #if defined(SYSLIBC_SCCS) && !defined(lint)
-	RCSID("$NetBSD: __sigtramp2.S,v 1.3 2023/05/07 12:41:47 skrll Exp $")
+	RCSID("$NetBSD: __sigtramp2.S,v 1.4 2024/05/28 06:57:17 skrll Exp $")
 #endif /* SYSLIBC_SCCS and not lint */
 
 
 /*
- * The MIPS signal trampoline is invoked only to return from
+ * The RISC-V signal trampoline is invoked only to return from
  * the signal; the kernel calls the signal handler directly.
  *
  * On entry, stack looks like:



CVS commit: src/lib/libc/arch/riscv/sys

2024-05-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue May 28 06:57:17 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/sys: __sigtramp2.S

Log Message:
Change MIPS to RISC-V.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/sys/__sigtramp2.S

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



CVS commit: src/lib/libcurses

2024-05-27 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon May 27 14:30:43 UTC 2024

Modified Files:
src/lib/libcurses: screen.c

Log Message:
curses: init old_mode to 1 (normal visible cursor)

PR bin/58090: Ctrl-Z, fg makes blinking cursor in vi
ok blymn@


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libcurses/screen.c

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

Modified files:

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.38 src/lib/libcurses/screen.c:1.39
--- src/lib/libcurses/screen.c:1.38	Fri May 17 23:32:50 2024
+++ src/lib/libcurses/screen.c	Mon May 27 14:30:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.38 2024/05/17 23:32:50 uwe Exp $	*/
+/*	$NetBSD: screen.c,v 1.39 2024/05/27 14:30:43 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.38 2024/05/17 23:32:50 uwe Exp $");
+__RCSID("$NetBSD: screen.c,v 1.39 2024/05/27 14:30:43 uwe Exp $");
 #endif
 #endif	/* not lint */
 
@@ -156,7 +156,7 @@ newterm(const char *type, FILE *outfd, F
 	new_screen->nca = A_NORMAL;
 	new_screen->color_type = COLOR_NONE;
 	new_screen->COLOR_PAIRS = 0;
-	new_screen->old_mode = 2;
+	new_screen->old_mode = 1;
 	new_screen->stdbuf = NULL;
 	new_screen->stdscr = NULL;
 	new_screen->curscr = NULL;



CVS commit: src/lib/libcurses

2024-05-27 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon May 27 14:30:43 UTC 2024

Modified Files:
src/lib/libcurses: screen.c

Log Message:
curses: init old_mode to 1 (normal visible cursor)

PR bin/58090: Ctrl-Z, fg makes blinking cursor in vi
ok blymn@


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/lib/libcurses/screen.c

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



CVS commit: src/lib/libterminfo

2024-05-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 20 09:48:42 UTC 2024

Modified Files:
src/lib/libterminfo: Makefile

Log Message:
Use double quotes to include the local ./Makefile.hash


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libterminfo/Makefile

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

Modified files:

Index: src/lib/libterminfo/Makefile
diff -u src/lib/libterminfo/Makefile:1.23 src/lib/libterminfo/Makefile:1.24
--- src/lib/libterminfo/Makefile:1.23	Sun Apr  5 12:31:02 2020
+++ src/lib/libterminfo/Makefile	Mon May 20 09:48:42 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.23 2020/04/05 12:31:02 roy Exp $
+#	$NetBSD: Makefile,v 1.24 2024/05/20 09:48:42 martin Exp $
 
 .include 
 
@@ -47,7 +47,7 @@ MLINKS+=	termcap.3 tgetent.3 termcap.3 t
 
 CPPFLAGS+=	-I${.OBJDIR}
 
-.include 
+.include "Makefile.hash"
 
 # Generate our man pages
 terminfo.5: genman terminfo.5.in term.h termcap_map.c



CVS commit: src/lib/libterminfo

2024-05-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 20 09:48:42 UTC 2024

Modified Files:
src/lib/libterminfo: Makefile

Log Message:
Use double quotes to include the local ./Makefile.hash


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libterminfo/Makefile

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



CVS commit: src/lib/libc/compat

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 01:33:40 UTC 2024

Modified Files:
src/lib/libc/compat/include: unistd.h
src/lib/libc/compat/sys: compat_dup3.c

Log Message:
finish renaming __dup3110 to __dup3100


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/unistd.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/sys/compat_dup3.c

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

Modified files:

Index: src/lib/libc/compat/include/unistd.h
diff -u src/lib/libc/compat/include/unistd.h:1.4 src/lib/libc/compat/include/unistd.h:1.5
--- src/lib/libc/compat/include/unistd.h:1.4	Sun May 19 18:25:47 2024
+++ src/lib/libc/compat/include/unistd.h	Sun May 19 21:33:39 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.4 2024/05/19 22:25:47 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.5 2024/05/20 01:33:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __BEGIN_DECLS
 pid_t	vfork(void) __returns_twice;
 pid_t	__vfork14(void) __returns_twice;
 int	dup3(int, int, int);
-int	__dup3110(int, int, int);
+int	__dup3100(int, int, int);
 
 __END_DECLS
 

Index: src/lib/libc/compat/sys/compat_dup3.c
diff -u src/lib/libc/compat/sys/compat_dup3.c:1.1 src/lib/libc/compat/sys/compat_dup3.c:1.2
--- src/lib/libc/compat/sys/compat_dup3.c:1.1	Sun May 19 18:25:48 2024
+++ src/lib/libc/compat/sys/compat_dup3.c	Sun May 19 21:33:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $ */
+/*	$NetBSD: compat_dup3.c,v 1.2 2024/05/20 01:33:40 christos Exp $ */
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_dup3.c,v 1.1 2024/05/19 22:25:48 christos Exp $");
+__RCSID("$NetBSD: compat_dup3.c,v 1.2 2024/05/20 01:33:40 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -45,7 +45,7 @@ int
 dup3(int oldfd, int newfd, int flags)
 {
 	if (oldfd != newfd) {
-		return __dup3110(oldfd, newfd, flags);
+		return __dup3100(oldfd, newfd, flags);
 	}
 	if (flags & (O_NONBLOCK|O_NOSIGPIPE)) {
 		int e = fcntl(newfd, F_GETFL, 0);



CVS commit: src/lib/libc/compat

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May 20 01:33:40 UTC 2024

Modified Files:
src/lib/libc/compat/include: unistd.h
src/lib/libc/compat/sys: compat_dup3.c

Log Message:
finish renaming __dup3110 to __dup3100


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/include/unistd.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/sys/compat_dup3.c

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



CVS commit: src/lib/libc/sys

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 19 16:04:46 UTC 2024

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

Log Message:
Amend for oldfd == newfd returning EINVAL in dup3


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/dup.2

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

Modified files:

Index: src/lib/libc/sys/dup.2
diff -u src/lib/libc/sys/dup.2:1.33 src/lib/libc/sys/dup.2:1.34
--- src/lib/libc/sys/dup.2:1.33	Mon Jul  3 17:32:50 2017
+++ src/lib/libc/sys/dup.2	Sun May 19 12:04:46 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dup.2,v 1.33 2017/07/03 21:32:50 wiz Exp $
+.\"	$NetBSD: dup.2,v 1.34 2024/05/19 16:04:46 christos Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\" @(#)dup.2	8.1 (Berkeley) 6/4/93
 .\"
-.Dd December 24, 2013
+.Dd May 19, 2024
 .Dt DUP 2
 .Os
 .Sh NAME
@@ -117,7 +117,14 @@ and can to some extent be adjusted with
 .Pp
 The
 .Fn dup3
-call includes an additional
+call fails and returns 
+.Er EINVAL
+if the numeric value in the
+.Ar oldfd 
+argument is equal to the one in the
+.Ar newfd
+argument.
+It also includes an additional
 .Fa flags
 argument supporting a subset of the
 .Xr open 2
@@ -207,11 +214,15 @@ and
 .Fa newfd
 is not in the range of valid file descriptors.
 .It Bq Er EINVAL
-.Fa flags
-contained an invalid value.
-Only
+In the
 .Fn dup3
-can generate this error.
+call either the
+.Fa flags
+argument contained an invalid value or the
+.Ar oldfd
+argument is equal to the
+.Ar newfd
+argument.
 .It Bq Er EMFILE
 Too many descriptors are active.
 Only



CVS commit: src/lib/libc/sys

2024-05-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 19 16:04:46 UTC 2024

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

Log Message:
Amend for oldfd == newfd returning EINVAL in dup3


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/dup.2

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



CVS commit: src/lib/libcurses

2024-05-17 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri May 17 23:32:51 UTC 2024

Modified Files:
src/lib/libcurses: curses.h curses_private.h curses_screen.3 screen.c
setterm.c

Log Message:
curses: constify newterm() and setterm() arguments

newterm() argument is const in the spec, so this fixes our
conformance.

setterm() is not in the spec, but it's natural and in ncurses its
argument is const too, so follow suit.

Doesn't change the ABI, so no bump required.

ok blymn@


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/lib/libcurses/curses.h
cvs rdiff -u -r1.80 -r1.81 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/curses_screen.3
cvs rdiff -u -r1.37 -r1.38 src/lib/libcurses/screen.c
cvs rdiff -u -r1.71 -r1.72 src/lib/libcurses/setterm.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

2024-05-17 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri May 17 23:32:51 UTC 2024

Modified Files:
src/lib/libcurses: curses.h curses_private.h curses_screen.3 screen.c
setterm.c

Log Message:
curses: constify newterm() and setterm() arguments

newterm() argument is const in the spec, so this fixes our
conformance.

setterm() is not in the spec, but it's natural and in ncurses its
argument is const too, so follow suit.

Doesn't change the ABI, so no bump required.

ok blymn@


To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/lib/libcurses/curses.h
cvs rdiff -u -r1.80 -r1.81 src/lib/libcurses/curses_private.h
cvs rdiff -u -r1.28 -r1.29 src/lib/libcurses/curses_screen.3
cvs rdiff -u -r1.37 -r1.38 src/lib/libcurses/screen.c
cvs rdiff -u -r1.71 -r1.72 src/lib/libcurses/setterm.c

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

Modified files:

Index: src/lib/libcurses/curses.h
diff -u src/lib/libcurses/curses.h:1.131 src/lib/libcurses/curses.h:1.132
--- src/lib/libcurses/curses.h:1.131	Tue May 14 10:22:48 2024
+++ src/lib/libcurses/curses.h	Fri May 17 23:32:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses.h,v 1.131 2024/05/14 10:22:48 uwe Exp $	*/
+/*	$NetBSD: curses.h,v 1.132 2024/05/17 23:32:50 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -719,7 +719,7 @@ int	 mvwprintw(WINDOW *, int, int, const
 int	 mvwscanw(WINDOW *, int, int, const char *, ...) __scanflike(4, 5);
 int	 napms(int);
 WINDOW	*newpad(int, int);
-SCREEN  *newterm(char *, FILE *, FILE *);
+SCREEN  *newterm(const char *, FILE *, FILE *);
 WINDOW	*newwin(int, int, int, int);
 int	 nl(void);
 attr_t	 no_color_attributes(void);
@@ -751,7 +751,7 @@ int	 savetty(void);
 int	 scanw(const char *, ...) __scanflike(1, 2);
 int	 scroll(WINDOW *);
 int	 scrollok(WINDOW *, bool);
-int	 setterm(char *);
+int	 setterm(const char *);
 int	 set_escdelay(int);
 int	 set_tabsize(int);
 SCREEN  *set_term(SCREEN *);

Index: src/lib/libcurses/curses_private.h
diff -u src/lib/libcurses/curses_private.h:1.80 src/lib/libcurses/curses_private.h:1.81
--- src/lib/libcurses/curses_private.h:1.80	Tue May  3 07:25:34 2022
+++ src/lib/libcurses/curses_private.h	Fri May 17 23:32:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses_private.h,v 1.80 2022/05/03 07:25:34 blymn Exp $	*/
+/*	$NetBSD: curses_private.h,v 1.81 2024/05/17 23:32:50 uwe Exp $	*/
 
 /*-
  * Copyright (c) 1998-2000 Brett Lymn
@@ -355,7 +355,7 @@ int	_cursesi_waddbytes(WINDOW *, const c
 void _cursesi_reset_wacs(SCREEN *);
 #endif /* HAVE_WCHAR */
 void _cursesi_resetterm(SCREEN *);
-int  _cursesi_setterm(char *, SCREEN *);
+int  _cursesi_setterm(const char *, SCREEN *);
 int	 __delay(void);
 unsigned int	 __hash_more(const void *, size_t, unsigned int);
 unsigned int	 __hash_line(const __LDATA *, int);

Index: src/lib/libcurses/curses_screen.3
diff -u src/lib/libcurses/curses_screen.3:1.28 src/lib/libcurses/curses_screen.3:1.29
--- src/lib/libcurses/curses_screen.3:1.28	Sun Feb  7 23:00:57 2021
+++ src/lib/libcurses/curses_screen.3	Fri May 17 23:32:50 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_screen.3,v 1.28 2021/02/07 23:00:57 rillig Exp $
+.\"	$NetBSD: curses_screen.3,v 1.29 2024/05/17 23:32:50 uwe Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd March 12, 2020
+.Dd May 16, 2024
 .Dt CURSES_SCREEN 3
 .Os
 .Sh NAME
@@ -61,7 +61,7 @@
 .Ft void
 .Fn use_env "bool value"
 .Ft SCREEN *
-.Fn newterm "char *type" "FILE *outfd" "FILE *infd"
+.Fn newterm "const char *type" "FILE *outfd" "FILE *infd"
 .Ft SCREEN *
 .Fn set_term "SCREEN *screen"
 .Ft void
@@ -79,7 +79,7 @@
 .Ft int
 .Fn resizeterm "int lines" "int cols"
 .Ft int
-.Fn setterm "char *name"
+.Fn setterm "const char *name"
 .Ft int
 .Fn set_tabsize "int value"
 .Pp
@@ -99,7 +99,9 @@ argument points to a
 .Xr terminfo 5
 entry, or it may be
 .Dv NULL
-in which case the TERM environment variable is used.
+in which case the
+.Ev TERM
+environment variable is used.
 The
 .Fa outfd
 and

Index: src/lib/libcurses/screen.c
diff -u src/lib/libcurses/screen.c:1.37 src/lib/libcurses/screen.c:1.38
--- src/lib/libcurses/screen.c:1.37	Fri Apr  8 10:17:52 2022
+++ src/lib/libcurses/screen.c	Fri May 17 23:32:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: screen.c,v 1.37 2022/04/08 10:17:52 andvar Exp $	*/
+/*	$NetBSD: screen.c,v 1.38 2024/05/17 23:32:50 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)screen.c	8.2 (blymn) 11/27/2001";
 #else
-__RCSID("$NetBSD: screen.c,v 1.37 2022/04/08 10:17:52 andvar Exp $");
+__RCSID("$NetBSD: screen.c,v 1.38 2024/05/17 23:32:50 uwe Exp $");
 #endif
 #endif	/* not lint */
 
@@ -124,10 +124,10 @@ set_term(SCREEN *new)
  *
  */
 SCREEN *
-newterm(char *type, FILE *outfd, FILE *infd)
+newterm(const char *type, FILE *outfd, FILE *infd)
 {
 	SCREEN *new_screen;
-	char 

CVS commit: src/lib/libedit

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 17 02:59:09 UTC 2024

Modified Files:
src/lib/libedit: el.h eln.c

Log Message:
When calling el_line make sure that we call the resizing function
callback because el_line updates the legacy LineInfo structure and
we need to notify that the cached copy of the the buffer has changed.
Of course the resizing function can call el_line itself to update
the buffer, so prevent recursion. Bug found by Peter Rufer at Arista.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/el.h
cvs rdiff -u -r1.37 -r1.38 src/lib/libedit/eln.c

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

Modified files:

Index: src/lib/libedit/el.h
diff -u src/lib/libedit/el.h:1.46 src/lib/libedit/el.h:1.47
--- src/lib/libedit/el.h:1.46	Sun Aug 15 06:08:41 2021
+++ src/lib/libedit/el.h	Thu May 16 22:59:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.h,v 1.46 2021/08/15 10:08:41 christos Exp $	*/
+/*	$NetBSD: el.h,v 1.47 2024/05/17 02:59:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -58,6 +58,7 @@
 #define	NARROW_HISTORY	0x040
 #define	NO_RESET	0x080
 #define	FIXIO		0x100
+#define	FROM_ELLINE	0x200
 
 typedef unsigned char el_action_t;	/* Index to command array	*/
 

Index: src/lib/libedit/eln.c
diff -u src/lib/libedit/eln.c:1.37 src/lib/libedit/eln.c:1.38
--- src/lib/libedit/eln.c:1.37	Tue Jan 11 13:30:15 2022
+++ src/lib/libedit/eln.c	Thu May 16 22:59:08 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $	*/
+/*	$NetBSD: eln.c,v 1.38 2024/05/17 02:59:08 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.37 2022/01/11 18:30:15 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.38 2024/05/17 02:59:08 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include 
@@ -365,6 +365,10 @@ el_line(EditLine *el)
 	size_t offset;
 	const wchar_t *p;
 
+	if (el->el_flags & FROM_ELLINE)
+		return info;
+
+	el->el_flags |= FROM_ELLINE;
 	info->buffer   = ct_encode_string(winfo->buffer, >el_lgcyconv);
 
 	offset = 0;
@@ -377,6 +381,10 @@ el_line(EditLine *el)
 		offset += ct_enc_width(*p);
 	info->lastchar = info->buffer + offset;
 
+	if (el->el_chared.c_resizefun)  
+		(*el->el_chared.c_resizefun)(el, el->el_chared.c_resizearg);
+	el->el_flags &= ~FROM_ELLINE;
+
 	return info;
 }
 



CVS commit: src/lib/libedit

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 17 02:59:09 UTC 2024

Modified Files:
src/lib/libedit: el.h eln.c

Log Message:
When calling el_line make sure that we call the resizing function
callback because el_line updates the legacy LineInfo structure and
we need to notify that the cached copy of the the buffer has changed.
Of course the resizing function can call el_line itself to update
the buffer, so prevent recursion. Bug found by Peter Rufer at Arista.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libedit/el.h
cvs rdiff -u -r1.37 -r1.38 src/lib/libedit/eln.c

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



CVS commit: src/lib/libm/arch/riscv

2024-05-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 17 02:11:07 UTC 2024

Modified Files:
src/lib/libm/arch/riscv: fenv.c

Log Message:
riscv: Make feraiseexcept actually raise the given exceptions.

Doing

fexcept_t ex = 0;
fesetexceptflag(, excepts);

has the effect of _clearing_ all the exceptions in excepts.  Using
fesetexceptflag doesn't make this easier, because we would have to
record which exceptions were already raised.  So just set the fflags
bits in the fcsr register directly.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/arch/riscv/fenv.c

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

Modified files:

Index: src/lib/libm/arch/riscv/fenv.c
diff -u src/lib/libm/arch/riscv/fenv.c:1.4 src/lib/libm/arch/riscv/fenv.c:1.5
--- src/lib/libm/arch/riscv/fenv.c:1.4	Sun May  7 12:41:47 2023
+++ src/lib/libm/arch/riscv/fenv.c	Fri May 17 02:11:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: fenv.c,v 1.4 2023/05/07 12:41:47 skrll Exp $ */
+/* $NetBSD: fenv.c,v 1.5 2024/05/17 02:11:07 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: fenv.c,v 1.4 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.5 2024/05/17 02:11:07 riastradh Exp $");
 
 #include "namespace.h"
 
@@ -114,19 +114,15 @@ fegetexceptflag(fexcept_t *flagp, int ex
  * The standard explicitly allows us to execute an instruction that has the
  * exception as a side effect, but we choose to manipulate the status register
  * directly.
- *
- * The validation of input is being deferred to fesetexceptflag().
  */
 int
 feraiseexcept(int excepts)
 {
-	fexcept_t ex = 0;
 
 	_DIAGASSERT((excepts & ~FE_ALL_EXCEPT) == 0);
 
 	excepts &= FE_ALL_EXCEPT;
-	fesetexceptflag(, excepts);
-	/* XXX exception magic XXX */
+	fcsr_fflags_write(fcsr_fflags_read() | excepts);
 
 	/* Success */
 	return 0;



CVS commit: src/lib/libm/arch/riscv

2024-05-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May 17 02:11:07 UTC 2024

Modified Files:
src/lib/libm/arch/riscv: fenv.c

Log Message:
riscv: Make feraiseexcept actually raise the given exceptions.

Doing

fexcept_t ex = 0;
fesetexceptflag(, excepts);

has the effect of _clearing_ all the exceptions in excepts.  Using
fesetexceptflag doesn't make this easier, because we would have to
record which exceptions were already raised.  So just set the fflags
bits in the fcsr register directly.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libm/arch/riscv/fenv.c

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



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 01:02:35 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpgetsticky.c fpsetsticky.c

Log Message:
riscv: More shiftiness reduction around FCSR in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.c

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



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 01:02:35 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpgetsticky.c fpsetsticky.c

Log Message:
riscv: More shiftiness reduction around FCSR in libc.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetsticky.c \
src/lib/libc/arch/riscv/gen/fpsetsticky.c

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

Modified files:

Index: src/lib/libc/arch/riscv/gen/fpgetsticky.c
diff -u src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.3 src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.4
--- src/lib/libc/arch/riscv/gen/fpgetsticky.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpgetsticky.c	Thu May 16 01:02:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpgetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpgetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpgetsticky,_fpgetsticky)
 fp_except
 fpgetsticky(void)
 {
-	return __SHIFTOUT(fcsr_read(), FCSR_FFLAGS);
+	return fcsr_fflags_read();
 }
Index: src/lib/libc/arch/riscv/gen/fpsetsticky.c
diff -u src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.3 src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetsticky.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetsticky.c	Thu May 16 01:02:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetsticky.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetsticky.c,v 1.4 2024/05/16 01:02:35 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -48,5 +48,5 @@ __weak_alias(fpsetsticky,_fpsetsticky)
 fp_except
 fpsetsticky(fp_except mask)
 {
-	return __SHIFTOUT(fcsr_fflags_write(__SHIFTIN(mask, FCSR_FFLAGS)), FCSR_FFLAGS);
+	return fcsr_fflags_write(mask);
 }



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 00:56:11 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpgetround.c fpsetround.c

Log Message:
riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/gen/fpsetround.c

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

Modified files:

Index: src/lib/libc/arch/riscv/gen/fpgetround.c
diff -u src/lib/libc/arch/riscv/gen/fpgetround.c:1.3 src/lib/libc/arch/riscv/gen/fpgetround.c:1.4
--- src/lib/libc/arch/riscv/gen/fpgetround.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpgetround.c	Thu May 16 00:56:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpgetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpgetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpgetround,_fpgetround)
 fp_rnd
 fpgetround(void)
 {
-	return __SHIFTOUT(fcsr_read(), FCSR_FRM);
+	return fcsr_frm_read();
 }
Index: src/lib/libc/arch/riscv/gen/fpsetround.c
diff -u src/lib/libc/arch/riscv/gen/fpsetround.c:1.3 src/lib/libc/arch/riscv/gen/fpsetround.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetround.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetround.c	Thu May 16 00:56:11 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetround.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetround.c,v 1.4 2024/05/16 00:56:11 riastradh Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,5 +47,5 @@ __weak_alias(fpsetround,_fpsetround)
 fp_rnd
 fpsetround(fp_rnd rnd_dir)
 {
-	return __SHIFTOUT(fcsr_frm_write(__SHIFTIN(rnd_dir, FCSR_FRM)), FCSR_FRM);
+	return fcsr_frm_write(rnd_dir);
 }



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May 16 00:56:11 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpgetround.c fpsetround.c

Log Message:
riscv: Nix shifting around FRRM and FSRM in libc too.

These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpgetround.c \
src/lib/libc/arch/riscv/gen/fpsetround.c

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



CVS commit: src/lib/libc/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 15 13:12:04 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3

Log Message:
usleep(3): Note the historical rake that was stepped upon.

PR 58184


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/usleep.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/libc/gen/usleep.3
diff -u src/lib/libc/gen/usleep.3:1.21 src/lib/libc/gen/usleep.3:1.22
--- src/lib/libc/gen/usleep.3:1.21	Mon Apr 22 21:25:29 2024
+++ src/lib/libc/gen/usleep.3	Wed May 15 13:12:04 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usleep.3,v 1.21 2024/04/22 21:25:29 jdolecek Exp $
+.\"	$NetBSD: usleep.3,v 1.22 2024/05/15 13:12:04 riastradh Exp $
 .\"
 .\" Copyright (c) 1986, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -99,3 +99,17 @@ The
 .Fn usleep
 function appeared in
 .Bx 4.3 .
+.Sh CAVEATS
+In
+.St -p1003.1-2004 ,
+.Nm
+was limited to values of
+.Fa microseconds
+less than one million.
+Some implementations, including
+.Nx
+before 10.1, fail immediately with
+.Er EINVAL
+\(em and don't sleep at all \(em if
+.Fa microseconds
+is one million or greater.



CVS commit: src/lib/libc/gen

2024-05-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May 15 13:12:04 UTC 2024

Modified Files:
src/lib/libc/gen: usleep.3

Log Message:
usleep(3): Note the historical rake that was stepped upon.

PR 58184


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libc/gen/usleep.3

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



CVS commit: src/lib/libm

2024-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May 14 14:34:35 UTC 2024

Modified Files:
src/lib/libm: Makefile
Added Files:
src/lib/libm: m.powerpc64.expsym

Log Message:
libm: Fix powerpc64 build.

- Include fenv.c and fma(3) symbols (which just use the FMADD
  instruction).
- Note the .FN symbols in libm for the asm functions.  The FN symbols
  point at the function _descriptors_; the .FN symbols point at the
  first instruction of the function.

XXX Unclear why we have the .FN symbols for asm functions but not for
C functions.  I'm not sure we should be exporting them.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/lib/libm/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.powerpc64.expsym

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.234 src/lib/libm/Makefile:1.235
--- src/lib/libm/Makefile:1.234	Thu May  9 14:42:09 2024
+++ src/lib/libm/Makefile	Tue May 14 14:34:35 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.234 2024/05/09 14:42:09 riastradh Exp $
+#  $NetBSD: Makefile,v 1.235 2024/05/14 14:34:35 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -194,7 +194,7 @@ ARCH_SRCS += s_fmax.S s_fmaxf.S
 ARCH_SRCS += s_fmin.S s_fminf.S
 .endif
 
-.elif (${LIBC_MACHINE_ARCH} == "powerpc")
+.elif (${LIBC_MACHINE_CPU} == "powerpc")
 .PATH:	${.CURDIR}/arch/powerpc
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c

Added files:

Index: src/lib/libm/m.powerpc64.expsym
diff -u /dev/null src/lib/libm/m.powerpc64.expsym:1.1
--- /dev/null	Tue May 14 14:34:35 2024
+++ src/lib/libm/m.powerpc64.expsym	Tue May 14 14:34:35 2024
@@ -0,0 +1,479 @@
+._fini
+._init
+.fma
+.fmaf
+__c99_cabs
+__c99_cabsf
+__c99_cabsl
+__divdc3
+__divsc3
+__divtc3
+__exp__D
+__fe_dfl_env
+__ieee754_acos
+__ieee754_acosf
+__ieee754_acosh
+__ieee754_acoshf
+__ieee754_asin
+__ieee754_asinf
+__ieee754_atan2
+__ieee754_atan2f
+__ieee754_atanh
+__ieee754_atanhf
+__ieee754_cosh
+__ieee754_coshf
+__ieee754_exp
+__ieee754_expf
+__ieee754_fmod
+__ieee754_fmodf
+__ieee754_fmodl
+__ieee754_hypot
+__ieee754_hypotf
+__ieee754_j0
+__ieee754_j0f
+__ieee754_j1
+__ieee754_j1f
+__ieee754_jn
+__ieee754_jnf
+__ieee754_lgamma_r
+__ieee754_lgammaf_r
+__ieee754_log
+__ieee754_log10
+__ieee754_log10f
+__ieee754_log2
+__ieee754_log2f
+__ieee754_logf
+__ieee754_pow
+__ieee754_powf
+__ieee754_rem_pio2
+__ieee754_rem_pio2f
+__ieee754_remainder
+__ieee754_remainderf
+__ieee754_scalb
+__ieee754_scalbf
+__ieee754_sinh
+__ieee754_sinhf
+__ieee754_sqrt
+__ieee754_sqrtf
+__ieee754_y0
+__ieee754_y0f
+__ieee754_y1
+__ieee754_y1f
+__ieee754_yn
+__ieee754_ynf
+__kernel_cos
+__kernel_cosf
+__kernel_rem_pio2
+__kernel_rem_pio2f
+__kernel_sin
+__kernel_sinf
+__kernel_standard
+__kernel_tan
+__kernel_tanf
+__log__D
+__muldc3
+__mulsc3
+__multc3
+_acoshl
+_acosl
+_asin
+_asinf
+_asinhl
+_asinl
+_atan2
+_atan2f
+_atan2l
+_atanhl
+_atanl
+_casin
+_casinf
+_casinl
+_catan
+_catanf
+_catanl
+_cbrtl
+_cchsh
+_cchshf
+_cchshl
+_ceill
+_copysignl
+_cos
+_cosf
+_cosh
+_coshf
+_coshl
+_cosl
+_cospi
+_cospif
+_cospil
+_ctans
+_ctansf
+_ctansl
+_end
+_erfcl
+_erfl
+_exp
+_exp2l
+_expf
+_expl
+_expm1l
+_fdlib_version
+_feclearexcept
+_fedisableexcept
+_feenableexcept
+_fegetenv
+_fegetexcept
+_fegetexceptflag
+_fegetround
+_feholdexcept
+_feraiseexcept
+_fesetenv
+_fesetexceptflag
+_fesetround
+_fetestexcept
+_feupdateenv
+_fini
+_finite
+_finitef
+_floorl
+_fmodl
+_hypot
+_hypotf
+_hypotl
+_init
+_lgammal
+_lgammal_r
+_log
+_log10l
+_log1pl
+_log2l
+_logf
+_logl
+_modfl
+_powl
+_redupi
+_redupif
+_redupil
+_remquo
+_remquof
+_remquol
+_roundl
+_scalbln
+_scalblnf
+_scalblnl
+_scalbn
+_scalbnf
+_scalbnl
+_sin
+_sincos
+_sincosf
+_sincosl
+_sinf
+_sinh
+_sinhf
+_sinhl
+_sinl
+_sinpi
+_sinpif
+_sinpil
+_sqrtl
+_tan
+_tanf
+_tanhl
+_tanl
+_tanpi
+_tanpif
+_tanpil
+_tgammal
+_truncl
+acos
+acosf
+acosh
+acoshf
+acoshl
+acosl
+asin
+asinf
+asinh
+asinhf
+asinhl
+asinl
+atan
+atan2
+atan2f
+atan2l
+atanf
+atanh
+atanhf
+atanhl
+atanl
+cabs
+cabsf
+cacos
+cacosf
+cacosh
+cacoshf
+cacoshl
+cacosl
+carg
+cargf
+cargl
+casin
+casinf
+casinh
+casinhf
+casinhl
+casinl
+catan
+catanf
+catanh
+catanhf
+catanhl
+catanl
+cbrt
+cbrtf
+cbrtl
+ccos
+ccosf
+ccosh
+ccoshf
+ccoshl
+ccosl
+ceil
+ceilf
+ceill
+cexp
+cexpf
+cexpl
+cimag
+cimagf
+cimagl
+clog
+clogf
+clogl
+conj
+conjf
+conjl
+copysign
+copysignf
+copysignl
+cos
+cosf
+cosh
+coshf
+coshl
+cosl
+cospi
+cospif
+cospil
+cpow
+cpowf
+cpowl
+cproj
+cprojf
+cprojl
+creal
+crealf
+creall
+csin
+csinf
+csinh
+csinhf
+csinhl
+csinl
+csqrt
+csqrtf
+csqrtl
+ctan
+ctanf
+ctanh
+ctanhf
+ctanhl
+ctanl
+drem
+dremf
+erf
+erfc
+erfcf
+erfcl
+erff
+erfl
+exp
+exp2
+exp2f
+exp2l
+expf
+expl
+expm1
+expm1f
+expm1l
+fabsf
+fdim
+fdimf
+fdiml
+feclearexcept
+fedisableexcept
+feenableexcept
+fegetenv
+fegetexcept
+fegetexceptflag
+fegetround
+feholdexcept
+feraiseexcept

CVS commit: src/lib/libm

2024-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue May 14 14:34:35 UTC 2024

Modified Files:
src/lib/libm: Makefile
Added Files:
src/lib/libm: m.powerpc64.expsym

Log Message:
libm: Fix powerpc64 build.

- Include fenv.c and fma(3) symbols (which just use the FMADD
  instruction).
- Note the .FN symbols in libm for the asm functions.  The FN symbols
  point at the function _descriptors_; the .FN symbols point at the
  first instruction of the function.

XXX Unclear why we have the .FN symbols for asm functions but not for
C functions.  I'm not sure we should be exporting them.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/lib/libm/Makefile
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.powerpc64.expsym

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



CVS commit: src/lib/libcurses

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:40:41 UTC 2024

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

Log Message:
curses_input(3): bump date for define_key() change


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.31 src/lib/libcurses/curses_input.3:1.32
--- src/lib/libcurses/curses_input.3:1.31	Tue May 14 10:22:48 2024
+++ src/lib/libcurses/curses_input.3	Tue May 14 10:40:41 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_input.3,v 1.31 2024/05/14 10:22:48 uwe Exp $
+.\"	$NetBSD: curses_input.3,v 1.32 2024/05/14 10:40:41 uwe Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd May 16, 2022
+.Dd May 14, 2024
 .Dt CURSES_INPUT 3
 .Os
 .Sh NAME



CVS commit: src/lib/libcurses

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:40:41 UTC 2024

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

Log Message:
curses_input(3): bump date for define_key() change


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:38:16 UTC 2024

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

Log Message:
curses_termcap(3): fullname() termbuf argument is const


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/curses_termcap.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_termcap.3
diff -u src/lib/libcurses/curses_termcap.3:1.6 src/lib/libcurses/curses_termcap.3:1.7
--- src/lib/libcurses/curses_termcap.3:1.6	Sat Apr 21 12:27:28 2012
+++ src/lib/libcurses/curses_termcap.3	Tue May 14 10:38:16 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_termcap.3,v 1.6 2012/04/21 12:27:28 roy Exp $
+.\"	$NetBSD: curses_termcap.3,v 1.7 2024/05/14 10:38:16 uwe Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd October 4, 2011
+.Dd May 14, 2024
 .Dt CURSES_TERMCAP 3
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Sh SYNOPSIS
 .In curses.h
 .Ft char *
-.Fn fullname "char *termbuf" "char *name"
+.Fn fullname "const char *termbuf" "char *name"
 .Sh DESCRIPTION
 The
 .Fn fullname



CVS commit: src/lib/libcurses

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:38:16 UTC 2024

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

Log Message:
curses_termcap(3): fullname() termbuf argument is const


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libcurses/curses_termcap.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

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:22:48 UTC 2024

Modified Files:
src/lib/libcurses: curses.h curses_input.3 getch.c

Log Message:
curse: constify define_key() argument

define_key() is ncurses extension and ncurses defines its first
argument as "const char *".  Follow suit.

PR lib/58254


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/lib/libcurses/curses.h
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/curses_input.3
cvs rdiff -u -r1.78 -r1.79 src/lib/libcurses/getch.c

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

Modified files:

Index: src/lib/libcurses/curses.h
diff -u src/lib/libcurses/curses.h:1.130 src/lib/libcurses/curses.h:1.131
--- src/lib/libcurses/curses.h:1.130	Sat Feb 13 10:37:00 2021
+++ src/lib/libcurses/curses.h	Tue May 14 10:22:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: curses.h,v 1.130 2021/02/13 10:37:00 rillig Exp $	*/
+/*	$NetBSD: curses.h,v 1.131 2024/05/14 10:22:48 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -652,7 +652,7 @@ int	 copywin(const WINDOW *, WINDOW *, i
 int	 curs_set(int);
 int	 def_prog_mode(void);
 int	 def_shell_mode(void);
-int  define_key(char *, int);
+int  define_key(const char *, int);
 int	 delay_output(int);
 void delscreen(SCREEN *);
 int	 delwin(WINDOW *);

Index: src/lib/libcurses/curses_input.3
diff -u src/lib/libcurses/curses_input.3:1.30 src/lib/libcurses/curses_input.3:1.31
--- src/lib/libcurses/curses_input.3:1.30	Sat May 21 12:34:44 2022
+++ src/lib/libcurses/curses_input.3	Tue May 14 10:22:48 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: curses_input.3,v 1.30 2022/05/21 12:34:44 uwe Exp $
+.\"	$NetBSD: curses_input.3,v 1.31 2024/05/14 10:22:48 uwe Exp $
 .\"
 .\" Copyright (c) 2002
 .\"	Brett Lymn (bl...@netbsd.org, brett_l...@yahoo.com.au)
@@ -76,7 +76,7 @@
 .Ft int
 .Fn has_key "int key_symbol"
 .Ft int
-.Fn define_key "char *sequence" "int key_symbol"
+.Fn define_key "const char *sequence" "int key_symbol"
 .Ft int
 .Fn getnstr "char *str" "int limit"
 .Ft int

Index: src/lib/libcurses/getch.c
diff -u src/lib/libcurses/getch.c:1.78 src/lib/libcurses/getch.c:1.79
--- src/lib/libcurses/getch.c:1.78	Tue Oct 19 06:37:29 2021
+++ src/lib/libcurses/getch.c	Tue May 14 10:22:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: getch.c,v 1.78 2021/10/19 06:37:29 blymn Exp $	*/
+/*	$NetBSD: getch.c,v 1.79 2024/05/14 10:22:48 uwe Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)getch.c	8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: getch.c,v 1.78 2021/10/19 06:37:29 blymn Exp $");
+__RCSID("$NetBSD: getch.c,v 1.79 2024/05/14 10:22:48 uwe Exp $");
 #endif
 #endif	/* not lint */
 
@@ -211,7 +211,7 @@ static wchar_t	inbuf[INBUF_SZ];
 static int	start, end, working; /* pointers for manipulating inbuf data */
 
 /* prototypes for private functions */
-static void add_key_sequence(SCREEN *screen, char *sequence, int key_type);
+static void add_key_sequence(SCREEN *screen, const char *sequence, int key_type);
 static key_entry_t *add_new_key(keymap_t *current, char ch, int key_type,
 int symbol);
 static void delete_key_sequence(keymap_t *current, int key_type);
@@ -370,7 +370,7 @@ delete_key_sequence(keymap_t *current, i
  * for the given key symbol.
  */
 static void
-add_key_sequence(SCREEN *screen, char *sequence, int key_type)
+add_key_sequence(SCREEN *screen, const char *sequence, int key_type)
 {
 	key_entry_t *tmp_key;
 	keymap_t *current;
@@ -762,7 +762,7 @@ do_keyok(keymap_t *current, int key_type
  *
  */
 int
-define_key(char *sequence, int symbol)
+define_key(const char *sequence, int symbol)
 {
 
 	if (symbol <= 0 || _cursesi_screen == NULL)



CVS commit: src/lib/libcurses

2024-05-14 Thread Valery Ushakov
Module Name:src
Committed By:   uwe
Date:   Tue May 14 10:22:48 UTC 2024

Modified Files:
src/lib/libcurses: curses.h curses_input.3 getch.c

Log Message:
curse: constify define_key() argument

define_key() is ncurses extension and ncurses defines its first
argument as "const char *".  Follow suit.

PR lib/58254


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/lib/libcurses/curses.h
cvs rdiff -u -r1.30 -r1.31 src/lib/libcurses/curses_input.3
cvs rdiff -u -r1.78 -r1.79 src/lib/libcurses/getch.c

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



CVS commit: src/lib/libc/gdtoa

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 21:17:24 UTC 2024

Modified Files:
src/lib/libc/gdtoa: Makefile.inc

Log Message:
libc/hdtoa: suppress lint warning about possible accuracy loss

on sparc64: hdtoa.c(340): warning: conversion from 'unsigned long'
to 'char' may lose accuracy [132]


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/Makefile.inc

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

Modified files:

Index: src/lib/libc/gdtoa/Makefile.inc
diff -u src/lib/libc/gdtoa/Makefile.inc:1.13 src/lib/libc/gdtoa/Makefile.inc:1.14
--- src/lib/libc/gdtoa/Makefile.inc:1.13	Sat Oct  7 12:15:53 2023
+++ src/lib/libc/gdtoa/Makefile.inc	Mon May 13 21:17:24 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.13 2023/10/07 12:15:53 rin Exp $
+#	$NetBSD: Makefile.inc,v 1.14 2024/05/13 21:17:24 rillig Exp $
 
 # gdtoa sources
 .PATH: ${.CURDIR}/gdtoa
@@ -44,3 +44,5 @@ SRCS+=	dmisc.c \
 .if ${MACHINE_ARCH} != "vax"
 SRCS+=	strtord.c
 .endif
+
+LINTFLAGS.hdtoa.c+=	-X 132	# conversion may lose accuracy



CVS commit: src/lib/libc/gdtoa

2024-05-13 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon May 13 21:17:24 UTC 2024

Modified Files:
src/lib/libc/gdtoa: Makefile.inc

Log Message:
libc/hdtoa: suppress lint warning about possible accuracy loss

on sparc64: hdtoa.c(340): warning: conversion from 'unsigned long'
to 'char' may lose accuracy [132]


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/gdtoa/Makefile.inc

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



CVS commit: src/lib/libc/inet

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:58:18 UTC 2024

Modified Files:
src/lib/libc/inet: inet_net_pton.c

Log Message:
s/Firey/Fiery/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/inet/inet_net_pton.c

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

Modified files:

Index: src/lib/libc/inet/inet_net_pton.c
diff -u src/lib/libc/inet/inet_net_pton.c:1.6 src/lib/libc/inet/inet_net_pton.c:1.7
--- src/lib/libc/inet/inet_net_pton.c:1.6	Mon Feb  5 21:46:05 2024
+++ src/lib/libc/inet/inet_net_pton.c	Sun May 12 23:58:18 2024
@@ -20,7 +20,7 @@
 #if 0
 static const char rcsid[] = "Id: inet_net_pton.c,v 1.4.2.1 2002/08/02 02:17:21 marka Exp ";
 #else
-__RCSID("$NetBSD: inet_net_pton.c,v 1.6 2024/02/05 21:46:05 andvar Exp $");
+__RCSID("$NetBSD: inet_net_pton.c,v 1.7 2024/05/12 23:58:18 msaitoh Exp $");
 #endif
 #endif
 
@@ -150,7 +150,7 @@ inet_net_pton_ipv4(const char *src, u_ch
 			goto enoent;
 	}
 
-	/* Firey death and destruction unless we prefetched EOS. */
+	/* Fiery death and destruction unless we prefetched EOS. */
 	if (ch != '\0')
 		goto enoent;
 



CVS commit: src/lib/libc/inet

2024-05-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sun May 12 23:58:18 UTC 2024

Modified Files:
src/lib/libc/inet: inet_net_pton.c

Log Message:
s/Firey/Fiery/ in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/inet/inet_net_pton.c

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



CVS commit: src/lib/libc/gen

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:58:58 UTC 2024

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

Log Message:
libc/pwcache.c: remove stray semicolon from do-while-0 macro


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/gen/pwcache.c

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



CVS commit: src/lib/libc/gen

2024-05-12 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun May 12 10:58:58 UTC 2024

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

Log Message:
libc/pwcache.c: remove stray semicolon from do-while-0 macro


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libc/gen/pwcache.c

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

Modified files:

Index: src/lib/libc/gen/pwcache.c
diff -u src/lib/libc/gen/pwcache.c:1.34 src/lib/libc/gen/pwcache.c:1.35
--- src/lib/libc/gen/pwcache.c:1.34	Tue Apr 19 20:32:15 2022
+++ src/lib/libc/gen/pwcache.c	Sun May 12 10:58:58 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: pwcache.c,v 1.34 2022/04/19 20:32:15 rillig Exp $	*/
+/*	$NetBSD: pwcache.c,v 1.35 2024/05/12 10:58:58 rillig Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -74,7 +74,7 @@
 #if 0
 static char sccsid[] = "@(#)cache.c	8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: pwcache.c,v 1.34 2022/04/19 20:32:15 rillig Exp $");
+__RCSID("$NetBSD: pwcache.c,v 1.35 2024/05/12 10:58:58 rillig Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -524,7 +524,7 @@ gid_from_group(const char *name, gid_t *
 			arr = NULL;			\
 		}	\
 		fail = 0;\
-	} while (0);
+	} while (0)
 
 int
 pwcache_userdb(



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 07:40:18 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpsetmask.c

Log Message:
Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpsetmask.c

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



CVS commit: src/lib/libc/arch/riscv/gen

2024-05-11 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat May 11 07:40:18 UTC 2024

Modified Files:
src/lib/libc/arch/riscv/gen: fpsetmask.c

Log Message:
Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/arch/riscv/gen/fpsetmask.c

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

Modified files:

Index: src/lib/libc/arch/riscv/gen/fpsetmask.c
diff -u src/lib/libc/arch/riscv/gen/fpsetmask.c:1.3 src/lib/libc/arch/riscv/gen/fpsetmask.c:1.4
--- src/lib/libc/arch/riscv/gen/fpsetmask.c:1.3	Sun May  7 12:41:47 2023
+++ src/lib/libc/arch/riscv/gen/fpsetmask.c	Sat May 11 07:40:18 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpsetmask.c,v 1.3 2023/05/07 12:41:47 skrll Exp $	*/
+/*	$NetBSD: fpsetmask.c,v 1.4 2024/05/11 07:40:18 skrll Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fpsetmask.c,v 1.3 2023/05/07 12:41:47 skrll Exp $");
+__RCSID("$NetBSD: fpsetmask.c,v 1.4 2024/05/11 07:40:18 skrll Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -47,9 +47,9 @@ __weak_alias(fpsetmask,_fpsetmask)
 fp_except
 fpsetmask(fp_except mask)
 {
-#if 0
-	return __SHIFTOUT(fcsr_fmask_write(__SHIFTIN(mask, FCSR_MASK)), FCSR_FMASK);
-#else
+#if FCSR_FMASK == 0
 	return 0;
+#else
+	return __SHIFTOUT(fcsr_fmask_write(__SHIFTIN(mask, FCSR_MASK)), FCSR_FMASK);
 #endif
 }



CVS commit: src/lib/libc/net

2024-05-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu May  9 21:28:00 UTC 2024

Modified Files:
src/lib/libc/net: getaddrinfo.3

Log Message:
Document that freeaddrinfo(NULL) dumps core.

A source code comment already said this, but it's easier to
find in a man page.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/net/getaddrinfo.3

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



CVS commit: src/lib/libm/compiler_rt

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 19:54:38 UTC 2024

Modified Files:
src/lib/libm/compiler_rt: Makefile.inc

Log Message:
libm: No divtc3.c or multc3.c in sparc64's compat sparc library.

compat/sparc64/sparc/bsd.sparc.mk doesn't define LIBC_MACHINE_CPU,
only LIBC_MACHINE_ARCH, so when the compat build gets to this
conditional, LIBC_MACHINE_CPU is just MACHINE_CPU, i.e., sparc64.

Since there's no `sparc64el' or `sparc64hf-el' that we need to
canonicalize by MACHINE_ARCH -> MACHINE_CPU, just use
LIBC_MACHINE_ARCH here.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/compiler_rt/Makefile.inc

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

Modified files:

Index: src/lib/libm/compiler_rt/Makefile.inc
diff -u src/lib/libm/compiler_rt/Makefile.inc:1.11 src/lib/libm/compiler_rt/Makefile.inc:1.12
--- src/lib/libm/compiler_rt/Makefile.inc:1.11	Wed Jun 16 05:21:08 2021
+++ src/lib/libm/compiler_rt/Makefile.inc	Thu May  9 19:54:38 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.11 2021/06/16 05:21:08 rin Exp $
+# $NetBSD: Makefile.inc,v 1.12 2024/05/09 19:54:38 riastradh Exp $
 
 COMPILER_RT_DIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt
 COMPILER_RT_SRCDIR=	${COMPILER_RT_DIR}/dist
@@ -24,7 +24,7 @@ GENERIC_SRCS+= \
 	divsc3.c \
 	divxc3.c
 
-.if ${MACHINE_CPU} == "powerpc" || ${LIBC_MACHINE_CPU:U} == "sparc64" || ${LIBC_MACHINE_CPU:U} == "aarch64"
+.if ${MACHINE_CPU} == "powerpc" || ${LIBC_MACHINE_ARCH:U} == "sparc64" || ${LIBC_MACHINE_CPU:U} == "aarch64"
 GENERIC_SRCS+= \
 	divtc3.c \
 	multc3.c



CVS commit: src/lib/libm/compiler_rt

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 19:54:38 UTC 2024

Modified Files:
src/lib/libm/compiler_rt: Makefile.inc

Log Message:
libm: No divtc3.c or multc3.c in sparc64's compat sparc library.

compat/sparc64/sparc/bsd.sparc.mk doesn't define LIBC_MACHINE_CPU,
only LIBC_MACHINE_ARCH, so when the compat build gets to this
conditional, LIBC_MACHINE_CPU is just MACHINE_CPU, i.e., sparc64.

Since there's no `sparc64el' or `sparc64hf-el' that we need to
canonicalize by MACHINE_ARCH -> MACHINE_CPU, just use
LIBC_MACHINE_ARCH here.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/compiler_rt/Makefile.inc

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



CVS commit: src/lib/libm

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 14:42:10 UTC 2024

Modified Files:
src/lib/libm: Makefile m.vax.expsym
Added Files:
src/lib/libm/noieee_src: n_frexpf.c n_frexpl.c

Log Message:
libm: Add frexpf and frexpl on VAX.

These are trivial subroutines, not symbol aliases, for separate
reasons:

- frexpf has a different ABI from frexp (float vs double argument)

- frexp is defined in libc, not libm, so although long double is the
  same as double, frexpl can't be an alias in libm of a symbol
  defined in libc


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/lib/libm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.vax.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/noieee_src/n_frexpf.c \
src/lib/libm/noieee_src/n_frexpl.c

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.233 src/lib/libm/Makefile:1.234
--- src/lib/libm/Makefile:1.233	Thu May  9 00:04:23 2024
+++ src/lib/libm/Makefile	Thu May  9 14:42:09 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.233 2024/05/09 00:04:23 riastradh Exp $
+#  $NetBSD: Makefile,v 1.234 2024/05/09 14:42:09 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -359,8 +359,9 @@ COPTS.compat_cabsf.c=	${${ACTIVE_CC} == 
 # math routines for non-IEEE architectures.
 NOIEEE_SRCS = n_asincos.c n_acosh.c n_asinh.c n_atan.c n_atanh.c n_atanhf.c \
 	n_cosh.c \
-	n_erf.c n_exp.c n_exp2.c n_exp2f.c n_exp__E.c n_expm1.c n_floor.c \
-	n_fmod.c n_gamma.c n_ilogb.c \
+	n_erf.c n_exp.c n_exp2.c n_exp2f.c n_exp__E.c n_expm1.c \
+	n_floor.c n_fmod.c n_frexpf.c n_frexpl.c \
+	n_gamma.c n_ilogb.c \
 	n_lgamma.c n_j0.c n_j1.c n_jn.c n_log.c n_log10.c n_log1p.c \
 	n_log2.c n_log__L.c n_pow.c n_sinh.c n_tanh.c \
 	n_sincos.c n_sincos1.c n_tan.c \

Index: src/lib/libm/m.vax.expsym
diff -u src/lib/libm/m.vax.expsym:1.3 src/lib/libm/m.vax.expsym:1.4
--- src/lib/libm/m.vax.expsym:1.3	Wed May  8 02:08:11 2024
+++ src/lib/libm/m.vax.expsym	Thu May  9 14:42:09 2024
@@ -188,6 +188,8 @@ fminf
 fmod
 fmodf
 fmodl
+frexpf
+frexpl
 gamma
 hypot
 hypotf

Added files:

Index: src/lib/libm/noieee_src/n_frexpf.c
diff -u /dev/null src/lib/libm/noieee_src/n_frexpf.c:1.1
--- /dev/null	Thu May  9 14:42:10 2024
+++ src/lib/libm/noieee_src/n_frexpf.c	Thu May  9 14:42:10 2024
@@ -0,0 +1,52 @@
+/*	$NetBSD: n_frexpf.c,v 1.1 2024/05/09 14:42:10 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__RCSID("$NetBSD: n_frexpf.c,v 1.1 2024/05/09 14:42:10 riastradh Exp $");
+
+#include "namespace.h"
+
+#include 
+
+float
+frexpf(float x, int *e)
+{
+
+	/*
+	 * We assume every value representable by float is also
+	 * representable by double.  The normalized result of frexp
+	 * differs only by the exponent, which is set to -1 (result
+	 * lies in [1/2, 1) or is zero), so it is also still
+	 * representable by float.
+	 *
+	 * This can't simply be a symbol alias, however, because the
+	 * ABI of float frexpf(float, int *) is different from the ABI
+	 * of double frexp(double, int *).
+	 */
+	return frexp(x, e);
+}
Index: src/lib/libm/noieee_src/n_frexpl.c
diff -u /dev/null src/lib/libm/noieee_src/n_frexpl.c:1.1
--- /dev/null	Thu May  9 14:42:10 2024
+++ src/lib/libm/noieee_src/n_frexpl.c	Thu May  9 14:42:10 2024
@@ -0,0 +1,50 @@
+/*	$NetBSD: n_frexpl.c,v 1.1 2024/05/09 14:42:10 riastradh Exp $	*/
+
+/*-
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or 

CVS commit: src/lib/libm

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 14:42:10 UTC 2024

Modified Files:
src/lib/libm: Makefile m.vax.expsym
Added Files:
src/lib/libm/noieee_src: n_frexpf.c n_frexpl.c

Log Message:
libm: Add frexpf and frexpl on VAX.

These are trivial subroutines, not symbol aliases, for separate
reasons:

- frexpf has a different ABI from frexp (float vs double argument)

- frexp is defined in libc, not libm, so although long double is the
  same as double, frexpl can't be an alias in libm of a symbol
  defined in libc


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/lib/libm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.vax.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/noieee_src/n_frexpf.c \
src/lib/libm/noieee_src/n_frexpl.c

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



CVS commit: src/lib/libm/noieee_src

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 12:18:48 UTC 2024

Modified Files:
src/lib/libm/noieee_src: n_ilogb.c

Log Message:
libm: Define ilogbl as alias for ilogb on vax.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_ilogb.c

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



CVS commit: src/lib/libm/noieee_src

2024-05-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 12:18:48 UTC 2024

Modified Files:
src/lib/libm/noieee_src: n_ilogb.c

Log Message:
libm: Define ilogbl as alias for ilogb on vax.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libm/noieee_src/n_ilogb.c

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

Modified files:

Index: src/lib/libm/noieee_src/n_ilogb.c
diff -u src/lib/libm/noieee_src/n_ilogb.c:1.1 src/lib/libm/noieee_src/n_ilogb.c:1.2
--- src/lib/libm/noieee_src/n_ilogb.c:1.1	Wed Aug 24 09:08:50 2016
+++ src/lib/libm/noieee_src/n_ilogb.c	Thu May  9 12:18:48 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: n_ilogb.c,v 1.1 2016/08/24 09:08:50 christos Exp $	*/
+/*	$NetBSD: n_ilogb.c,v 1.2 2024/05/09 12:18:48 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,11 +30,15 @@
  */
 #include 
 #if defined(LIBM_SCCS) && !defined(lint)
-__RCSID("$NetBSD: n_ilogb.c,v 1.1 2016/08/24 09:08:50 christos Exp $");
+__RCSID("$NetBSD: n_ilogb.c,v 1.2 2024/05/09 12:18:48 riastradh Exp $");
 #endif
 
 #include "math.h"
 
+#ifndef __HAVE_LONG_DOUBLE
+__strong_alias(ilogbl,ilogb)
+#endif
+
 int
 ilogb(double x)
 {



CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 00:04:23 UTC 2024

Modified Files:
src/lib/libm: Makefile m.mips.expsym
Added Files:
src/lib/libm: m.mips64.expsym

Log Message:
libm: Split expected symbols in mips further by 32-bit vs 64-bit.

32-bit has binary64 long double, same as double; 64-bit has binary128
long double, which is implemented with a few more symbols in libm
(which should maybe be hidden internal symbols, but let's get this
diagnostic measure in the build working before we think about
possibly deleting private symbols).


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/lib/libm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.mips.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.mips64.expsym

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



CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Thu May  9 00:04:23 UTC 2024

Modified Files:
src/lib/libm: Makefile m.mips.expsym
Added Files:
src/lib/libm: m.mips64.expsym

Log Message:
libm: Split expected symbols in mips further by 32-bit vs 64-bit.

32-bit has binary64 long double, same as double; 64-bit has binary128
long double, which is implemented with a few more symbols in libm
(which should maybe be hidden internal symbols, but let's get this
diagnostic measure in the build working before we think about
possibly deleting private symbols).


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/lib/libm/Makefile
cvs rdiff -u -r1.3 -r1.4 src/lib/libm/m.mips.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.mips64.expsym

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.232 src/lib/libm/Makefile:1.233
--- src/lib/libm/Makefile:1.232	Wed May  8 23:28:07 2024
+++ src/lib/libm/Makefile	Thu May  9 00:04:23 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.232 2024/05/08 23:28:07 riastradh Exp $
+#  $NetBSD: Makefile,v 1.233 2024/05/09 00:04:23 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -206,7 +206,6 @@ ARCH_SRCS += s_fma.S s_fmaf.S
 .PATH:	${.CURDIR}/arch/mips
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
-LIB_EXPSYM=	${LIB}.mipshf.expsym
 .endif
 .if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
 COMMON_SRCS+= s_nexttoward.c
@@ -214,6 +213,20 @@ COMMON_SRCS+= s_rintl.c
 .endif
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 
+.  if ${MKSOFTFLOAT} == "no"
+.if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
+LIB_EXPSYM=	m.mips64hf.expsym
+.else
+LIB_EXPSYM=	m.mipshf.expsym
+.endif
+.  else
+.if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
+LIB_EXPSYM=	m.mips64.expsym
+.else
+LIB_EXPSYM=	m.mips.expsym
+.endif
+.  endif
+
 .elif (${LIBC_MACHINE_CPU} == "sh3")
 .PATH:	${.CURDIR}/arch/sh3
 .if ${MKSOFTFLOAT} == "no"

Index: src/lib/libm/m.mips.expsym
diff -u src/lib/libm/m.mips.expsym:1.3 src/lib/libm/m.mips.expsym:1.4
--- src/lib/libm/m.mips.expsym:1.3	Wed May  8 23:28:07 2024
+++ src/lib/libm/m.mips.expsym	Thu May  9 00:04:23 2024
@@ -1,26 +1,3 @@
-_ItL_aT
-_ItL_atanhi
-_ItL_atanlo
-_ItL_pS0
-_ItL_pS1
-_ItL_pS2
-_ItL_pS3
-_ItL_pS4
-_ItL_pS5
-_ItL_pS6
-_ItL_pS7
-_ItL_pS8
-_ItL_pS9
-_ItL_pi_lo
-_ItL_qS1
-_ItL_qS2
-_ItL_qS3
-_ItL_qS4
-_ItL_qS5
-_ItL_qS6
-_ItL_qS7
-_ItL_qS8
-_ItL_qS9
 __c99_cabs
 __c99_cabsf
 __c99_cabsl
@@ -73,7 +50,6 @@ __ieee754_sinh
 __ieee754_sinhf
 __ieee754_sqrt
 __ieee754_sqrtf
-__ieee754_sqrtl
 __ieee754_y0
 __ieee754_y0f
 __ieee754_y1
@@ -82,16 +58,13 @@ __ieee754_yn
 __ieee754_ynf
 __kernel_cos
 __kernel_cosf
-__kernel_cosl
 __kernel_rem_pio2
 __kernel_rem_pio2f
 __kernel_sin
 __kernel_sinf
-__kernel_sinl
 __kernel_standard
 __kernel_tan
 __kernel_tanf
-__kernel_tanl
 __log__D
 __muldc3
 __mulsc3
@@ -330,7 +303,6 @@ expm1
 expm1f
 expm1l
 fabsf
-fabsl
 fdim
 fdimf
 fdiml
@@ -378,7 +350,6 @@ hypotl
 ilogb
 ilogbf
 ilogbl
-imprecise_tgammal
 isinff
 isnanf
 j0

Added files:

Index: src/lib/libm/m.mips64.expsym
diff -u /dev/null src/lib/libm/m.mips64.expsym:1.1
--- /dev/null	Thu May  9 00:04:23 2024
+++ src/lib/libm/m.mips64.expsym	Thu May  9 00:04:23 2024
@@ -0,0 +1,503 @@
+_ItL_aT
+_ItL_atanhi
+_ItL_atanlo
+_ItL_pS0
+_ItL_pS1
+_ItL_pS2
+_ItL_pS3
+_ItL_pS4
+_ItL_pS5
+_ItL_pS6
+_ItL_pS7
+_ItL_pS8
+_ItL_pS9
+_ItL_pi_lo
+_ItL_qS1
+_ItL_qS2
+_ItL_qS3
+_ItL_qS4
+_ItL_qS5
+_ItL_qS6
+_ItL_qS7
+_ItL_qS8
+_ItL_qS9
+__c99_cabs
+__c99_cabsf
+__c99_cabsl
+__divdc3
+__divsc3
+__divxc3
+__exp__D
+__ieee754_acos
+__ieee754_acosf
+__ieee754_acosh
+__ieee754_acoshf
+__ieee754_asin
+__ieee754_asinf
+__ieee754_atan2
+__ieee754_atan2f
+__ieee754_atanh
+__ieee754_atanhf
+__ieee754_cosh
+__ieee754_coshf
+__ieee754_exp
+__ieee754_expf
+__ieee754_fmod
+__ieee754_fmodf
+__ieee754_fmodl
+__ieee754_hypot
+__ieee754_hypotf
+__ieee754_j0
+__ieee754_j0f
+__ieee754_j1
+__ieee754_j1f
+__ieee754_jn
+__ieee754_jnf
+__ieee754_lgamma_r
+__ieee754_lgammaf_r
+__ieee754_log
+__ieee754_log10
+__ieee754_log10f
+__ieee754_log2
+__ieee754_log2f
+__ieee754_logf
+__ieee754_pow
+__ieee754_powf
+__ieee754_rem_pio2
+__ieee754_rem_pio2f
+__ieee754_remainder
+__ieee754_remainderf
+__ieee754_scalb
+__ieee754_scalbf
+__ieee754_sinh
+__ieee754_sinhf
+__ieee754_sqrt
+__ieee754_sqrtf
+__ieee754_sqrtl
+__ieee754_y0
+__ieee754_y0f
+__ieee754_y1
+__ieee754_y1f
+__ieee754_yn
+__ieee754_ynf
+__kernel_cos
+__kernel_cosf
+__kernel_cosl
+__kernel_rem_pio2
+__kernel_rem_pio2f
+__kernel_sin
+__kernel_sinf
+__kernel_sinl
+__kernel_standard
+__kernel_tan
+__kernel_tanf
+__kernel_tanl
+__log__D
+__muldc3
+__mulsc3
+__mulxc3
+_acoshl
+_acosl
+_asin
+_asinf
+_asinhl
+_asinl
+_atan2
+_atan2f
+_atan2l
+_atanhl
+_atanl
+_casin
+_casinf
+_casinl
+_catan
+_catanf

CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 23:28:31 UTC 2024

Added Files:
src/lib/libm: m.sh3.expsym

Log Message:
libm: Record expected symbols for sh3.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.sh3.expsym

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

Added files:

Index: src/lib/libm/m.sh3.expsym
diff -u /dev/null src/lib/libm/m.sh3.expsym:1.1
--- /dev/null	Wed May  8 23:28:31 2024
+++ src/lib/libm/m.sh3.expsym	Wed May  8 23:28:31 2024
@@ -0,0 +1,478 @@
+___ctors
+___ctors_end
+___dtors
+___dtors_end
+__c99_cabs
+__c99_cabsf
+__c99_cabsl
+__divdc3
+__divsc3
+__divxc3
+__exp__D
+__ieee754_acos
+__ieee754_acosf
+__ieee754_acosh
+__ieee754_acoshf
+__ieee754_asin
+__ieee754_asinf
+__ieee754_atan2
+__ieee754_atan2f
+__ieee754_atanh
+__ieee754_atanhf
+__ieee754_cosh
+__ieee754_coshf
+__ieee754_exp
+__ieee754_expf
+__ieee754_fmod
+__ieee754_fmodf
+__ieee754_fmodl
+__ieee754_hypot
+__ieee754_hypotf
+__ieee754_j0
+__ieee754_j0f
+__ieee754_j1
+__ieee754_j1f
+__ieee754_jn
+__ieee754_jnf
+__ieee754_lgamma_r
+__ieee754_lgammaf_r
+__ieee754_log
+__ieee754_log10
+__ieee754_log10f
+__ieee754_log2
+__ieee754_log2f
+__ieee754_logf
+__ieee754_pow
+__ieee754_powf
+__ieee754_rem_pio2
+__ieee754_rem_pio2f
+__ieee754_remainder
+__ieee754_remainderf
+__ieee754_scalb
+__ieee754_scalbf
+__ieee754_sinh
+__ieee754_sinhf
+__ieee754_sqrt
+__ieee754_sqrtf
+__ieee754_y0
+__ieee754_y0f
+__ieee754_y1
+__ieee754_y1f
+__ieee754_yn
+__ieee754_ynf
+__kernel_cos
+__kernel_cosf
+__kernel_rem_pio2
+__kernel_rem_pio2f
+__kernel_sin
+__kernel_sinf
+__kernel_standard
+__kernel_tan
+__kernel_tanf
+__log__D
+__muldc3
+__mulsc3
+__mulxc3
+_acoshl
+_acosl
+_asin
+_asinf
+_asinhl
+_asinl
+_atan2
+_atan2f
+_atan2l
+_atanhl
+_atanl
+_casin
+_casinf
+_casinl
+_catan
+_catanf
+_catanl
+_cbrtl
+_cchsh
+_cchshf
+_cchshl
+_ceill
+_copysignl
+_cos
+_cosf
+_cosh
+_coshf
+_coshl
+_cosl
+_cospi
+_cospif
+_cospil
+_ctans
+_ctansf
+_ctansl
+_end
+_erfcl
+_erfl
+_exp
+_exp2l
+_expf
+_expl
+_expm1l
+_fdlib_version
+_feclearexcept
+_fedisableexcept
+_feenableexcept
+_fegetenv
+_fegetexcept
+_fegetexceptflag
+_fegetround
+_feholdexcept
+_feraiseexcept
+_fesetenv
+_fesetexceptflag
+_fesetround
+_fetestexcept
+_feupdateenv
+_fini
+_finite
+_finitef
+_floorl
+_fmodl
+_hypot
+_hypotf
+_hypotl
+_init
+_lgammal
+_lgammal_r
+_log
+_log10l
+_log1pl
+_log2l
+_logf
+_logl
+_modfl
+_powl
+_redupi
+_redupif
+_redupil
+_remquo
+_remquof
+_remquol
+_roundl
+_scalbln
+_scalblnf
+_scalblnl
+_scalbn
+_scalbnf
+_scalbnl
+_sin
+_sincos
+_sincosf
+_sincosl
+_sinf
+_sinh
+_sinhf
+_sinhl
+_sinl
+_sinpi
+_sinpif
+_sinpil
+_sqrtl
+_tan
+_tanf
+_tanhl
+_tanl
+_tanpi
+_tanpif
+_tanpil
+_tgammal
+_truncl
+acos
+acosf
+acosh
+acoshf
+acoshl
+acosl
+asin
+asinf
+asinh
+asinhf
+asinhl
+asinl
+atan
+atan2
+atan2f
+atan2l
+atanf
+atanh
+atanhf
+atanhl
+atanl
+cabs
+cabsf
+cacos
+cacosf
+cacosh
+cacoshf
+cacoshl
+cacosl
+carg
+cargf
+cargl
+casin
+casinf
+casinh
+casinhf
+casinhl
+casinl
+catan
+catanf
+catanh
+catanhf
+catanhl
+catanl
+cbrt
+cbrtf
+cbrtl
+ccos
+ccosf
+ccosh
+ccoshf
+ccoshl
+ccosl
+ceil
+ceilf
+ceill
+cexp
+cexpf
+cexpl
+cimag
+cimagf
+cimagl
+clog
+clogf
+clogl
+conj
+conjf
+conjl
+copysign
+copysignf
+copysignl
+cos
+cosf
+cosh
+coshf
+coshl
+cosl
+cospi
+cospif
+cospil
+cpow
+cpowf
+cpowl
+cproj
+cprojf
+cprojl
+creal
+crealf
+creall
+csin
+csinf
+csinh
+csinhf
+csinhl
+csinl
+csqrt
+csqrtf
+csqrtl
+ctan
+ctanf
+ctanh
+ctanhf
+ctanhl
+ctanl
+drem
+dremf
+erf
+erfc
+erfcf
+erfcl
+erff
+erfl
+exp
+exp2
+exp2f
+exp2l
+expf
+expl
+expm1
+expm1f
+expm1l
+fabsf
+fdim
+fdimf
+fdiml
+feclearexcept
+fedisableexcept
+feenableexcept
+fegetenv
+fegetexcept
+fegetexceptflag
+fegetround
+feholdexcept
+feraiseexcept
+fesetenv
+fesetexceptflag
+fesetround
+fetestexcept
+feupdateenv
+finite
+finitef
+floor
+floorf
+floorl
+fma
+fmaf
+fmal
+fmax
+fmaxf
+fmaxl
+fmin
+fminf
+fminl
+fmod
+fmodf
+fmodl
+frexp
+frexpf
+frexpl
+gamma
+gamma_r
+gammaf
+gammaf_r
+hypot
+hypotf
+hypotl
+ilogb
+ilogbf
+ilogbl
+isinff
+isnanf
+j0
+j0f
+j1
+j1f
+jn
+jnf
+ldexp
+ldexpf
+ldexpl
+lgamma
+lgamma_r
+lgammaf
+lgammaf_r
+lgammal
+lgammal_r
+llrint
+llrintf
+llrintl
+llround
+llroundf
+llroundl
+log
+log10
+log10f
+log10l
+log1p
+log1pf
+log1pl
+log2
+log2f
+log2l
+logb
+logbf
+logbl
+logf
+logl
+lrint
+lrintf
+lrintl
+lround
+lroundf
+lroundl
+matherr
+modf
+modff
+modfl
+nan
+nanf
+nanl
+nearbyint
+nearbyintf
+nearbyintl
+nextafter
+nextafterf
+nextafterl
+nexttoward
+nexttowardf
+nexttowardl
+pow
+powf
+powl
+remainder
+remainderf
+remainderl
+remquo
+remquof
+remquol
+rint
+rintf
+rintl
+round
+roundf
+roundl
+scalb
+scalbf
+scalbln
+scalblnf
+scalblnl
+scalbn
+scalbnf
+scalbnl
+signgam
+significand
+significandf
+sin
+sincos
+sincosf
+sincosl
+sinf
+sinh
+sinhf
+sinhl
+sinl
+sinpi
+sinpif
+sinpil
+sqrt
+sqrtf
+sqrtl
+tan
+tanf
+tanh
+tanhf
+tanhl
+tanl
+tanpi
+tanpif
+tanpil

CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 23:28:31 UTC 2024

Added Files:
src/lib/libm: m.sh3.expsym

Log Message:
libm: Record expected symbols for sh3.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.sh3.expsym

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



CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 23:28:07 UTC 2024

Modified Files:
src/lib/libm: Makefile m.arm.expsym m.mips.expsym
Added Files:
src/lib/libm: m.armhf.expsym m.mipshf.expsym

Log Message:
libm: Split expected symbols on arm and mips by hard/soft float.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/lib/libm/Makefile
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.arm.expsym src/lib/libm/m.mips.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mipshf.expsym

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



CVS commit: src/lib/libm

2024-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 23:28:07 UTC 2024

Modified Files:
src/lib/libm: Makefile m.arm.expsym m.mips.expsym
Added Files:
src/lib/libm: m.armhf.expsym m.mipshf.expsym

Log Message:
libm: Split expected symbols on arm and mips by hard/soft float.


To generate a diff of this commit:
cvs rdiff -u -r1.231 -r1.232 src/lib/libm/Makefile
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.arm.expsym src/lib/libm/m.mips.expsym
cvs rdiff -u -r0 -r1.1 src/lib/libm/m.armhf.expsym \
src/lib/libm/m.mipshf.expsym

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

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.231 src/lib/libm/Makefile:1.232
--- src/lib/libm/Makefile:1.231	Sun May  5 22:52:19 2024
+++ src/lib/libm/Makefile	Wed May  8 23:28:07 2024
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.231 2024/05/05 22:52:19 riastradh Exp $
+#  $NetBSD: Makefile,v 1.232 2024/05/08 23:28:07 riastradh Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -81,6 +81,7 @@ COPTS+=	-mfloat-ieee -mieee-with-inexact
 .PATH.c: ${.CURDIR}/arch/arm
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS+= fenv.c
+LIB_EXPSYM=	${LIB}.armhf.expsym
 .endif
 .for f in fenv.c lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 COPTS.$f +=	-mfpu=vfp
@@ -205,6 +206,7 @@ ARCH_SRCS += s_fma.S s_fmaf.S
 .PATH:	${.CURDIR}/arch/mips
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS += fenv.c
+LIB_EXPSYM=	${LIB}.mipshf.expsym
 .endif
 .if ${MACHINE_MIPS64} && (!defined(CPUFLAGS) || empty(CPUFLAGS:M-mabi=32))
 COMMON_SRCS+= s_nexttoward.c

Index: src/lib/libm/m.arm.expsym
diff -u src/lib/libm/m.arm.expsym:1.2 src/lib/libm/m.arm.expsym:1.3
--- src/lib/libm/m.arm.expsym:1.2	Wed May  8 01:40:26 2024
+++ src/lib/libm/m.arm.expsym	Wed May  8 23:28:07 2024
@@ -5,7 +5,6 @@ __divdc3
 __divsc3
 __divxc3
 __exp__D
-__fe_dfl_env
 __ieee754_acos
 __ieee754_acosf
 __ieee754_acosh
@@ -131,9 +130,6 @@ _feupdateenv
 _finite
 _finitef
 _floorl
-_fma
-_fmaf
-_fmal
 _fmodl
 _hypot
 _hypotf
Index: src/lib/libm/m.mips.expsym
diff -u src/lib/libm/m.mips.expsym:1.2 src/lib/libm/m.mips.expsym:1.3
--- src/lib/libm/m.mips.expsym:1.2	Wed May  8 01:40:26 2024
+++ src/lib/libm/m.mips.expsym	Wed May  8 23:28:07 2024
@@ -1,3 +1,26 @@
+_ItL_aT
+_ItL_atanhi
+_ItL_atanlo
+_ItL_pS0
+_ItL_pS1
+_ItL_pS2
+_ItL_pS3
+_ItL_pS4
+_ItL_pS5
+_ItL_pS6
+_ItL_pS7
+_ItL_pS8
+_ItL_pS9
+_ItL_pi_lo
+_ItL_qS1
+_ItL_qS2
+_ItL_qS3
+_ItL_qS4
+_ItL_qS5
+_ItL_qS6
+_ItL_qS7
+_ItL_qS8
+_ItL_qS9
 __c99_cabs
 __c99_cabsf
 __c99_cabsl
@@ -5,7 +28,6 @@ __divdc3
 __divsc3
 __divxc3
 __exp__D
-__fe_dfl_env
 __ieee754_acos
 __ieee754_acosf
 __ieee754_acosh
@@ -51,6 +73,7 @@ __ieee754_sinh
 __ieee754_sinhf
 __ieee754_sqrt
 __ieee754_sqrtf
+__ieee754_sqrtl
 __ieee754_y0
 __ieee754_y0f
 __ieee754_y1
@@ -59,13 +82,16 @@ __ieee754_yn
 __ieee754_ynf
 __kernel_cos
 __kernel_cosf
+__kernel_cosl
 __kernel_rem_pio2
 __kernel_rem_pio2f
 __kernel_sin
 __kernel_sinf
+__kernel_sinl
 __kernel_standard
 __kernel_tan
 __kernel_tanf
+__kernel_tanl
 __log__D
 __muldc3
 __mulsc3
@@ -304,6 +330,7 @@ expm1
 expm1f
 expm1l
 fabsf
+fabsl
 fdim
 fdimf
 fdiml
@@ -351,6 +378,7 @@ hypotl
 ilogb
 ilogbf
 ilogbl
+imprecise_tgammal
 isinff
 isnanf
 j0

Added files:

Index: src/lib/libm/m.armhf.expsym
diff -u /dev/null src/lib/libm/m.armhf.expsym:1.1
--- /dev/null	Wed May  8 23:28:07 2024
+++ src/lib/libm/m.armhf.expsym	Wed May  8 23:28:07 2024
@@ -0,0 +1,476 @@
+__c99_cabs
+__c99_cabsf
+__c99_cabsl
+__divdc3
+__divsc3
+__divxc3
+__exp__D
+__fe_dfl_env
+__ieee754_acos
+__ieee754_acosf
+__ieee754_acosh
+__ieee754_acoshf
+__ieee754_asin
+__ieee754_asinf
+__ieee754_atan2
+__ieee754_atan2f
+__ieee754_atanh
+__ieee754_atanhf
+__ieee754_cosh
+__ieee754_coshf
+__ieee754_exp
+__ieee754_expf
+__ieee754_fmod
+__ieee754_fmodf
+__ieee754_fmodl
+__ieee754_hypot
+__ieee754_hypotf
+__ieee754_j0
+__ieee754_j0f
+__ieee754_j1
+__ieee754_j1f
+__ieee754_jn
+__ieee754_jnf
+__ieee754_lgamma_r
+__ieee754_lgammaf_r
+__ieee754_log
+__ieee754_log10
+__ieee754_log10f
+__ieee754_log2
+__ieee754_log2f
+__ieee754_logf
+__ieee754_pow
+__ieee754_powf
+__ieee754_rem_pio2
+__ieee754_rem_pio2f
+__ieee754_remainder
+__ieee754_remainderf
+__ieee754_scalb
+__ieee754_scalbf
+__ieee754_sinh
+__ieee754_sinhf
+__ieee754_sqrt
+__ieee754_sqrtf
+__ieee754_y0
+__ieee754_y0f
+__ieee754_y1
+__ieee754_y1f
+__ieee754_yn
+__ieee754_ynf
+__kernel_cos
+__kernel_cosf
+__kernel_rem_pio2
+__kernel_rem_pio2f
+__kernel_sin
+__kernel_sinf
+__kernel_standard
+__kernel_tan
+__kernel_tanf
+__log__D
+__muldc3
+__mulsc3
+__mulxc3
+_acoshl
+_acosl
+_asin
+_asinf
+_asinhl
+_asinl
+_atan2
+_atan2f
+_atan2l
+_atanhl
+_atanl
+_casin
+_casinf
+_casinl
+_catan
+_catanf
+_catanl
+_cbrtl
+_cchsh
+_cchshf
+_cchshl
+_ceill
+_copysignl
+_cos
+_cosf
+_cosh
+_coshf
+_coshl
+_cosl
+_cospi
+_cospif
+_cospil
+_ctans
+_ctansf
+_ctansl
+_end
+_erfcl
+_erfl
+_exp
+_exp2l
+_expf
+_expl
+_expm1l
+_fdlib_version
+_feclearexcept

CVS commit: src/lib/libm

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 02:08:11 UTC 2024

Modified Files:
src/lib/libm: m.vax.expsym
src/lib/libm/noieee_src: n_floor.c

Log Message:
libm: Add rintl, rintf to non-IEEE754 architectures.

While here, delete #ifdef to handle ns32k -- I don't think that's
gonna be relevant any time soon; in case you hadn't noticed, the
world has moved on from ns32k to vax by now.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.8 -r1.9 src/lib/libm/noieee_src/n_floor.c

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

Modified files:

Index: src/lib/libm/m.vax.expsym
diff -u src/lib/libm/m.vax.expsym:1.2 src/lib/libm/m.vax.expsym:1.3
--- src/lib/libm/m.vax.expsym:1.2	Wed May  8 01:04:24 2024
+++ src/lib/libm/m.vax.expsym	Wed May  8 02:08:11 2024
@@ -229,6 +229,8 @@ pow
 powf
 powl
 rint
+rintf
+rintl
 round
 roundf
 roundl

Index: src/lib/libm/noieee_src/n_floor.c
diff -u src/lib/libm/noieee_src/n_floor.c:1.8 src/lib/libm/noieee_src/n_floor.c:1.9
--- src/lib/libm/noieee_src/n_floor.c:1.8	Sun Mar 16 09:51:39 2014
+++ src/lib/libm/noieee_src/n_floor.c	Wed May  8 02:08:11 2024
@@ -1,4 +1,4 @@
-/*  $NetBSD: n_floor.c,v 1.8 2014/03/16 09:51:39 martin Exp $ */
+/*  $NetBSD: n_floor.c,v 1.9 2024/05/08 02:08:11 riastradh Exp $ */
 /*
  * Copyright (c) 1985, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -45,11 +45,10 @@ ic(L, 4503599627370496.0E0, 52, 1.0)			 
 #define	L	vccast(L)
 #endif
 
-#ifdef __weak_alias
-__weak_alias(ceill, ceil);
-__weak_alias(floorl, floor);
-__weak_alias(truncl, trunc);
-#endif
+__weak_alias(ceill, ceil)
+__weak_alias(floorl, floor)
+__weak_alias(truncl, trunc)
+__weak_alias(rintl, rint)
 
 /*
  * floor(x) := the largest integer no larger than x;
@@ -110,7 +109,6 @@ ceilf(float x)
 	return ceil((double)x);
 }
 
-#ifndef ns32000			/* rint() is in ./NATIONAL/support.s */
 /*
  * algorithm for rint(x) in pseudo-pascal form ...
  *
@@ -149,7 +147,12 @@ rint(double x)
 	t = x + s;/* x+s rounded to integer */
 	return (t - s);
 }
-#endif	/* not national */
+
+float
+rintf(float x)
+{
+	return rint((double)x);
+}
 
 long
 lrint(double x)



CVS commit: src/lib/libm

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 02:08:11 UTC 2024

Modified Files:
src/lib/libm: m.vax.expsym
src/lib/libm/noieee_src: n_floor.c

Log Message:
libm: Add rintl, rintf to non-IEEE754 architectures.

While here, delete #ifdef to handle ns32k -- I don't think that's
gonna be relevant any time soon; in case you hadn't noticed, the
world has moved on from ns32k to vax by now.

PR 57881


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.vax.expsym
cvs rdiff -u -r1.8 -r1.9 src/lib/libm/noieee_src/n_floor.c

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



CVS commit: src/lib/libm/src

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:58:52 UTC 2024

Removed Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: ldbl_dummy.c is no longer needed -- nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/lib/libm/src/ldbl_dummy.c

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



CVS commit: src/lib/libm/src

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:58:52 UTC 2024

Removed Files:
src/lib/libm/src: ldbl_dummy.c

Log Message:
libm: ldbl_dummy.c is no longer needed -- nix it.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 src/lib/libm/src/ldbl_dummy.c

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



CVS commit: src/lib/libm

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:42:23 UTC 2024

Modified Files:
src/lib/libm: m.aarch64.expsym m.riscv.expsym m.sparc64.expsym
src/lib/libm/src: s_cosl.c

Log Message:
libm: Don't export symbol `pio4' from s_cosl.c.

This appears to have been added unintentionally in the recent FreeBSD
long double update, and never went out in a release.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cosl.c

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

Modified files:

Index: src/lib/libm/m.aarch64.expsym
diff -u src/lib/libm/m.aarch64.expsym:1.2 src/lib/libm/m.aarch64.expsym:1.3
--- src/lib/libm/m.aarch64.expsym:1.2	Wed May  8 01:40:26 2024
+++ src/lib/libm/m.aarch64.expsym	Wed May  8 01:42:23 2024
@@ -450,7 +450,6 @@ nextafterl
 nexttoward
 nexttowardf
 nexttowardl
-pio4
 pow
 powf
 powl
Index: src/lib/libm/m.riscv.expsym
diff -u src/lib/libm/m.riscv.expsym:1.2 src/lib/libm/m.riscv.expsym:1.3
--- src/lib/libm/m.riscv.expsym:1.2	Wed May  8 01:40:27 2024
+++ src/lib/libm/m.riscv.expsym	Wed May  8 01:42:23 2024
@@ -435,7 +435,6 @@ nextafterl
 nexttoward
 nexttowardf
 nexttowardl
-pio4
 pow
 powf
 powl
Index: src/lib/libm/m.sparc64.expsym
diff -u src/lib/libm/m.sparc64.expsym:1.2 src/lib/libm/m.sparc64.expsym:1.3
--- src/lib/libm/m.sparc64.expsym:1.2	Wed May  8 01:40:27 2024
+++ src/lib/libm/m.sparc64.expsym	Wed May  8 01:42:23 2024
@@ -441,7 +441,6 @@ nextafterl
 nexttoward
 nexttowardf
 nexttowardl
-pio4
 pow
 powf
 powl

Index: src/lib/libm/src/s_cosl.c
diff -u src/lib/libm/src/s_cosl.c:1.2 src/lib/libm/src/s_cosl.c:1.3
--- src/lib/libm/src/s_cosl.c:1.2	Wed Apr  3 18:53:42 2024
+++ src/lib/libm/src/s_cosl.c	Wed May  8 01:42:23 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: s_cosl.c,v 1.2 2024/04/03 18:53:42 christos Exp $	*/
+/*	$NetBSD: s_cosl.c,v 1.3 2024/05/08 01:42:23 riastradh Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause
@@ -29,7 +29,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: s_cosl.c,v 1.2 2024/04/03 18:53:42 christos Exp $");
+__RCSID("$NetBSD: s_cosl.c,v 1.3 2024/05/08 01:42:23 riastradh Exp $");
 
 /*
  * Limited testing on pseudorandom numbers drawn within [-2e8:4e8] shows
@@ -62,7 +62,7 @@ pio4u = LD80C(0xc90fdaa22168c235, -1
 #elif LDBL_MANT_DIG == 113
 #include "../ld128/e_rem_pio2l.h"
 #include "../ld128/k_cosl.c"
-long double pio4 =  7.85398163397448309615660845819875721e-1L;
+static long double pio4 =  7.85398163397448309615660845819875721e-1L;
 #else
 #error "Unsupported long double format"
 #endif



CVS commit: src/lib/libm

2024-05-07 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed May  8 01:42:23 UTC 2024

Modified Files:
src/lib/libm: m.aarch64.expsym m.riscv.expsym m.sparc64.expsym
src/lib/libm/src: s_cosl.c

Log Message:
libm: Don't export symbol `pio4' from s_cosl.c.

This appears to have been added unintentionally in the recent FreeBSD
long double update, and never went out in a release.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/m.aarch64.expsym \
src/lib/libm/m.riscv.expsym src/lib/libm/m.sparc64.expsym
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/s_cosl.c

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



  1   2   3   4   5   6   7   8   9   10   >