]> granicus.if.org Git - graphviz/commitdiff
sfio _Sftable: use C99 designated field initializers
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 7 Oct 2022 03:46:28 +0000 (20:46 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 11 Oct 2022 03:33:01 +0000 (20:33 -0700)
Squashes a number of -Wmissing-field-initializer warnings.

lib/sfio/sftable.c

index 55fb874a73a1796d12db79ea67aeb8e9fccec331..48ed720bcf183111cab0c0309fe2f2670d2ef6ee 100644 (file)
@@ -427,13 +427,11 @@ static int sfcvinit(void)
 
 /* table for floating point and integer conversions */
 Sftab_t _Sftable = {
-    {1e1, 1e2, 1e4, 1e8, 1e16, 1e32}
-    ,                          /* _Sfpos10     */
+    .sf_pos10 = {1e1, 1e2, 1e4, 1e8, 1e16, 1e32},
+    .sf_neg10 = {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32},
 
-    {1e-1, 1e-2, 1e-4, 1e-8, 1e-16, 1e-32}
-    ,                          /* _Sfneg10     */
-
-    {'0', '0', '0', '1', '0', '2', '0', '3', '0', '4', /* _Sfdec       */
+    .sf_dec =
+    {'0', '0', '0', '1', '0', '2', '0', '3', '0', '4',
      '0', '5', '0', '6', '0', '7', '0', '8', '0', '9',
      '1', '0', '1', '1', '1', '2', '1', '3', '1', '4',
      '1', '5', '1', '6', '1', '7', '1', '8', '1', '9',
@@ -453,12 +451,11 @@ Sftab_t _Sftable = {
      '8', '5', '8', '6', '8', '7', '8', '8', '8', '9',
      '9', '0', '9', '1', '9', '2', '9', '3', '9', '4',
      '9', '5', '9', '6', '9', '7', '9', '8', '9', '9',
-     }
-    ,
+     },
 
-    "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_",
+    .sf_digits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_",
 
-    sfcvinit, 0,
-    sffmtpos,
-    sffmtint
+    .sf_cvinitf = sfcvinit,
+    .sf_fmtposf = sffmtpos,
+    .sf_fmtintf = sffmtint
 };