]> Savannah Git Hosting - gnulib.git/commitdiff
ieee754-h tests: Fix some gcc -Wmissing-field-initializers warnings.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Sep 2023 14:23:39 +0000 (16:23 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 14 Sep 2023 10:09:54 +0000 (12:09 +0200)
* tests/test-ieee754-h.c (float_tests): Use float literals.
(double_tests): Use double literals. Initialize frac_lo.

ChangeLog
tests/test-ieee754-h.c

index d64702a63b9003846e09b1b981080ca2e0480a71..d4af58378f6687d59e47bd1fe3b367157adeba88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-09-04  Bruno Haible  <bruno@clisp.org>
 
+       ieee754-h tests: Fix some gcc -Wmissing-field-initializers warnings.
+       * tests/test-ieee754-h.c (float_tests): Use float literals.
+       (double_tests): Use double literals. Initialize frac_lo.
+
        string-buffer tests: Fix a gcc -Wformat warning.
        * tests/test-string-buffer.c: Include <wchar.h>. Don't assume that
        wint_t has the same size as 'int'.
index 02e2db0531395217b8d51f68215596138fe715d1..559fa0671538aa112dd27cf68978d54b1a4dff23 100644 (file)
@@ -26,9 +26,9 @@ static struct {
   unsigned sign; unsigned exponent; unsigned frac;
 } const float_tests[] =
   {
-   {0, 0, 0, 0},
-   {-0.0, 1, 0, 0},
-   {0.1, 0, 0x7b, 0x4ccccd}
+   {0.0f, 0, 0, 0},
+   {-0.0f, 1, 0, 0},
+   {0.1f, 0, 0x7b, 0x4ccccd}
   };
 
 static struct {
@@ -36,8 +36,8 @@ static struct {
   unsigned sign; unsigned exponent; unsigned frac_hi; unsigned frac_lo;
 } const double_tests[] =
   {
-   {0, 0, 0, 0},
-   {-0.0, 1, 0, 0 },
+   {0.0, 0, 0, 0, 0},
+   {-0.0, 1, 0, 0, 0},
    {0.1, 0, 0x3fb, 0x99999, 0x9999999a}
   };