]> Savannah Git Hosting - gnulib.git/commitdiff
snan: Simplify a type.
authorBruno Haible <bruno@clisp.org>
Sun, 15 Oct 2023 13:53:01 +0000 (15:53 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 15 Oct 2023 13:53:01 +0000 (15:53 +0200)
* lib/snan.h (memory_long_double): Put the 'value' field first.
* tests/test-totalorder.h (main): No need for designated initializer
syntax any more.

ChangeLog
lib/snan.h
tests/test-totalorder.h

index ef440addaf978c7d5e618dfd902a0131b0ceb307..6aedd3af73f7e49e608707f58629cc4ddf4313a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-10-15  Bruno Haible  <bruno@clisp.org>
+
+       snan: Simplify a type.
+       * lib/snan.h (memory_long_double): Put the 'value' field first.
+       * tests/test-totalorder.h (main): No need for designated initializer
+       syntax any more.
+
 2023-10-15  Bruno Haible  <bruno@clisp.org>
 
        vma-iter: Fix compilation error on FreeBSD 5.2.1.
index abd95318d703d8682378b8193a410f3c8097ac57..b89f13a8de71463f7906677084866dfbcb749af8 100644 (file)
@@ -181,7 +181,7 @@ SNaNd ()
 
 #define NWORDS \
   ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; long double value; }
+typedef union { long double value; unsigned int word[NWORDS]; }
         memory_long_double;
 
 #if defined LDBL_EXPBIT0_WORD && defined LDBL_EXPBIT0_BIT
index 6292ea130aeed97fb9adb3edbfd8364b172b8b7d..e00d51c4c49ba33749b8d5ef481777d9df80bcab 100644 (file)
@@ -27,24 +27,24 @@ main ()
 {
   TOTALORDER_TYPE x[] =
     {
-      { .value = TOTALORDER_NEGATIVE_NAN () },
+      { TOTALORDER_NEGATIVE_NAN () },
 #if TOTALORDER_HAVE_SNAN
       TOTALORDER_NEGATIVE_SNAN (),
 #endif
-      { .value = -TOTALORDER_INF () },
-      { .value = -1e37 },
-      { .value = -1 },
-      { .value = -1e-5 },
-      { .value = TOTALORDER_MINUS_ZERO },
-      { .value = 0 },
-      { .value = 1e-5 },
-      { .value = 1 },
-      { .value = 1e37 },
-      { .value = TOTALORDER_INF () },
+      { -TOTALORDER_INF () },
+      { -1e37 },
+      { -1 },
+      { -1e-5 },
+      { TOTALORDER_MINUS_ZERO },
+      { 0 },
+      { 1e-5 },
+      { 1 },
+      { 1e37 },
+      { TOTALORDER_INF () },
 #if TOTALORDER_HAVE_SNAN
       TOTALORDER_POSITIVE_SNAN (),
 #endif
-      { .value = TOTALORDER_POSITIVE_NAN () }
+      { TOTALORDER_POSITIVE_NAN () }
     };
   int n = SIZEOF (x);
   int result = 0;