]> Savannah Git Hosting - gnulib.git/commitdiff
signed-nan: New module, renamed from qnan.
authorBruno Haible <bruno@clisp.org>
Fri, 13 Oct 2023 11:05:06 +0000 (13:05 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 13 Oct 2023 11:59:50 +0000 (13:59 +0200)
* lib/signed-nan.h: Renamed from lib/qnan.h. Update double-inclusion
guard.
* modules/signed-nan: Renamed from modules/qnan. Update.
* tests/test-signbit.c: Update.
* tests/test-stdio.c: Likewise.
* tests/test-totalorder.c: Likewise.
* modules/*-tests: Update.

13 files changed:
ChangeLog
lib/qnan.h [deleted file]
lib/signed-nan.h [new file with mode: 0644]
modules/qnan [deleted file]
modules/signbit-tests
modules/signed-nan [new file with mode: 0644]
modules/stdio-tests
modules/totalorder-tests
modules/totalorderf-tests
modules/totalorderl-tests
tests/test-signbit.c
tests/test-stdio.c
tests/test-totalorder.c

index 0a4be95ecfcf671e5541cf876a42f8d24dc80b50..7a06938f21fe1256643a06ca705e8ff45cbbce9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-10-13  Bruno Haible  <bruno@clisp.org>
+
+       signed-nan: New module, renamed from qnan.
+       * lib/signed-nan.h: Renamed from lib/qnan.h. Update double-inclusion
+       guard.
+       * modules/signed-nan: Renamed from modules/qnan. Update.
+       * tests/test-signbit.c: Update.
+       * tests/test-stdio.c: Likewise.
+       * tests/test-totalorder.c: Likewise.
+       * modules/*-tests: Update.
+
 2023-10-13  Bruno Haible  <bruno@clisp.org>
 
        access: Fix test failure on native Windows.
diff --git a/lib/qnan.h b/lib/qnan.h
deleted file mode 100644 (file)
index e6538c2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Macros for quiet not-a-number.
-   Copyright (C) 2023 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
-
-#ifndef _QNAN_H
-#define _QNAN_H
-
-#include <math.h>
-
-#include "nan.h"
-
-
-/* Returns a quiet 'float' NaN with sign bit == 0.  */
-_GL_UNUSED static float
-positive_NaNf ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  float volatile nan = NaNf ();
-  return (signbit (nan) ? - nan : nan);
-}
-
-/* Returns a quiet 'float' NaN with sign bit == 1.  */
-_GL_UNUSED static float
-negative_NaNf ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  float volatile nan = NaNf ();
-  return (signbit (nan) ? nan : - nan);
-}
-
-
-/* Returns a quiet 'double' NaN with sign bit == 0.  */
-_GL_UNUSED static double
-positive_NaNd ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  double volatile nan = NaNd ();
-  return (signbit (nan) ? - nan : nan);
-}
-
-/* Returns a quiet 'double' NaN with sign bit == 1.  */
-_GL_UNUSED static double
-negative_NaNd ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  double volatile nan = NaNd ();
-  return (signbit (nan) ? nan : - nan);
-}
-
-
-/* Returns a quiet 'long double' NaN with sign bit == 0.  */
-_GL_UNUSED static long double
-positive_NaNl ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  long double volatile nan = NaNl ();
-  return (signbit (nan) ? - nan : nan);
-}
-
-/* Returns a quiet 'long double' NaN with sign bit == 1.  */
-_GL_UNUSED static long double
-negative_NaNl ()
-{
-  /* 'volatile' works around a GCC bug:
-     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
-  long double volatile nan = NaNl ();
-  return (signbit (nan) ? nan : - nan);
-}
-
-
-#endif /* _QNAN_H */
diff --git a/lib/signed-nan.h b/lib/signed-nan.h
new file mode 100644 (file)
index 0000000..1018b58
--- /dev/null
@@ -0,0 +1,88 @@
+/* Macros for quiet not-a-number.
+   Copyright (C) 2023 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SIGNED_NAN_H
+#define _SIGNED_NAN_H
+
+#include <math.h>
+
+#include "nan.h"
+
+
+/* Returns a quiet 'float' NaN with sign bit == 0.  */
+_GL_UNUSED static float
+positive_NaNf ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  float volatile nan = NaNf ();
+  return (signbit (nan) ? - nan : nan);
+}
+
+/* Returns a quiet 'float' NaN with sign bit == 1.  */
+_GL_UNUSED static float
+negative_NaNf ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  float volatile nan = NaNf ();
+  return (signbit (nan) ? nan : - nan);
+}
+
+
+/* Returns a quiet 'double' NaN with sign bit == 0.  */
+_GL_UNUSED static double
+positive_NaNd ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  double volatile nan = NaNd ();
+  return (signbit (nan) ? - nan : nan);
+}
+
+/* Returns a quiet 'double' NaN with sign bit == 1.  */
+_GL_UNUSED static double
+negative_NaNd ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  double volatile nan = NaNd ();
+  return (signbit (nan) ? nan : - nan);
+}
+
+
+/* Returns a quiet 'long double' NaN with sign bit == 0.  */
+_GL_UNUSED static long double
+positive_NaNl ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  long double volatile nan = NaNl ();
+  return (signbit (nan) ? - nan : nan);
+}
+
+/* Returns a quiet 'long double' NaN with sign bit == 1.  */
+_GL_UNUSED static long double
+negative_NaNl ()
+{
+  /* 'volatile' works around a GCC bug:
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111655>  */
+  long double volatile nan = NaNl ();
+  return (signbit (nan) ? nan : - nan);
+}
+
+
+#endif /* _SIGNED_NAN_H */
diff --git a/modules/qnan b/modules/qnan
deleted file mode 100644 (file)
index fd3cbb5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Description:
-Macros for quiet not-a-number.
-
-Files:
-lib/qnan.h
-
-Depends-on:
-nan
-signbit
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += qnan.h
-
-Include:
-"qnan.h"
-
-Link:
-
-License:
-GPL
-
-Maintainer:
-all
index c491d7c8851c3377f957eee30517ae55bdce8e49..20b18efdf02a93b03aa0e1b169b717f54a9fffbe 100644 (file)
@@ -6,7 +6,7 @@ tests/macros.h
 
 Depends-on:
 float
-qnan
+signed-nan
 snan
 
 configure.ac:
diff --git a/modules/signed-nan b/modules/signed-nan
new file mode 100644 (file)
index 0000000..f544a6c
--- /dev/null
@@ -0,0 +1,25 @@
+Description:
+Macros for quiet not-a-number.
+
+Files:
+lib/signed-nan.h
+
+Depends-on:
+nan
+signbit
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += signed-nan.h
+
+Include:
+"signed-nan.h"
+
+Link:
+
+License:
+GPL
+
+Maintainer:
+all
index 5f94d3961d81da8124b19b876785b1e0f71ed714..a24433f511d69eb6f50c20e951dc80b636d6bca5 100644 (file)
@@ -5,7 +5,7 @@ m4/exponentd.m4
 
 Depends-on:
 assert-h
-qnan
+signed-nan
 snan
 stdio-c++-tests
 fgetc-tests
index 5ff4c752f0f47471788ccd23f7a28a0da60947fc..3741b88d4c108378470efb6564a990b2a488f185 100644 (file)
@@ -5,7 +5,7 @@ tests/infinity.h
 tests/macros.h
 
 Depends-on:
-qnan
+signed-nan
 
 configure.ac:
 
index 7e2e7938f651c5feee25cd7d44ca2672713e9ccd..f2801f496f272bcaa0efce4c137b79fd929f8c0b 100644 (file)
@@ -6,7 +6,7 @@ tests/infinity.h
 tests/macros.h
 
 Depends-on:
-qnan
+signed-nan
 
 configure.ac:
 
index 1b6ca5200fb9d5184ee0599839a536ea06e5deea..fa25c3e301ab56ccb412b0def3a180f84a218b63 100644 (file)
@@ -6,7 +6,7 @@ tests/infinity.h
 tests/macros.h
 
 Depends-on:
-qnan
+signed-nan
 
 configure.ac:
 
index f89fdf6d0507d51faa3a8f1e157c5b7e10551ee2..35b845c6c309591786e956f3152f0cd466575db0 100644 (file)
@@ -30,7 +30,7 @@
 
 #include "minus-zero.h"
 #include "infinity.h"
-#include "qnan.h"
+#include "signed-nan.h"
 #include "snan.h"
 #include "macros.h"
 
index cc442501500a78b1376378d84199a1011c4a782f..6bd100edae3f4ae0134b6b11e054c8583a4d1bfc 100644 (file)
@@ -39,7 +39,7 @@ va_list t5;
 
 #include <string.h>
 
-#include "qnan.h"
+#include "signed-nan.h"
 #include "snan.h"
 #include "macros.h"
 
index b63c7c2211695cc92bc8f102a2c901d852d62a17..af903c68b51485c7f65aa43c2ef25e52e1b6dc93 100644 (file)
@@ -21,7 +21,7 @@
 #include "infinity.h"
 #include "macros.h"
 #include "minus-zero.h"
-#include "qnan.h"
+#include "signed-nan.h"
 
 #ifndef TOTALORDER
 # define TOTALORDER totalorder