Module Name: src Committed By: riastradh Date: Sun May 12 20:04:12 UTC 2024
Modified Files: src/sys/arch/riscv/include: fenv.h Log Message: riscv fenv.h: Make sure FE_* exception constants have type int. This may not be formally required by the standard, but the values must be representable by int since that's the type that functions like fetestexcept and feclearexcept traffic in. And this is less work than changing all the printf %d users in tree. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/riscv/include/fenv.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/riscv/include/fenv.h diff -u src/sys/arch/riscv/include/fenv.h:1.4 src/sys/arch/riscv/include/fenv.h:1.5 --- src/sys/arch/riscv/include/fenv.h:1.4 Fri May 10 08:20:37 2024 +++ src/sys/arch/riscv/include/fenv.h Sun May 12 20:04:12 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: fenv.h,v 1.4 2024/05/10 08:20:37 skrll Exp $ */ +/* $NetBSD: fenv.h,v 1.5 2024/05/12 20:04:12 riastradh Exp $ */ /* * Based on ieeefp.h written by J.T. Conklin, Apr 28, 1995 @@ -11,11 +11,11 @@ typedef int fenv_t; /* FPSCR */ typedef int fexcept_t; -#define FE_INEXACT __BIT(0) /* Result inexact */ -#define FE_UNDERFLOW __BIT(1) /* Result underflowed */ -#define FE_OVERFLOW __BIT(2) /* Result overflowed */ -#define FE_DIVBYZERO __BIT(3) /* divide-by-zero */ -#define FE_INVALID __BIT(4) /* Result invalid */ +#define FE_INEXACT ((int)__BIT(0)) /* Result inexact */ +#define FE_UNDERFLOW ((int)__BIT(1)) /* Result underflowed */ +#define FE_OVERFLOW ((int)__BIT(2)) /* Result overflowed */ +#define FE_DIVBYZERO ((int)__BIT(3)) /* divide-by-zero */ +#define FE_INVALID ((int)__BIT(4)) /* Result invalid */ #define FE_ALL_EXCEPT \ (FE_INEXACT | FE_UNDERFLOW | FE_OVERFLOW | FE_DIVBYZERO | FE_INVALID)