]> granicus.if.org Git - graphviz/commitdiff
common sizeArray: remove platform-conditional struct code smattr/7274ea57-04ed-4877-918e-989acc6cae8b
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 11 Oct 2022 04:40:59 +0000 (21:40 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 11 Oct 2022 05:04:02 +0000 (22:04 -0700)
08f481fa36bbf199e0f8fbf862639d8fc4e575ab made this initialization platform
dependent and its commit message does not explain why. Both statements are
equivalent; the value of `Agstrictdirected` _is_ `{ 1, 1, 0, 1 }`. This change
removes the Windows branch of this which was causing warnings under MinGW
12.2.0:

  lib/common/htmltable.c:1472:5: error: missing initializer for field 'flatlock'
    of 'Agdesc_t' {aka 'struct Agdesc_s'} [-Werror=missing-field-initializers]
   1472 |     Agdesc_t dir = { 1, 1, 0, 1 };
        |     ^~~~~~~~
  In file included from lib/common/types.h:41,
                   from lib/common/render.h:29,
                   from lib/common/htmltable.c:32:
  lib/cgraph/cgraph.h:166:14: note: 'flatlock' declared here
    166 |     unsigned flatlock:1;        /* if sets are flattened into lists…
        |              ^~~~~~~~

lib/common/htmltable.c

index 960801f739b3ee88e86c85ae0f4742bd882ec312..f3784a9ba020fdedbf3b5f783619287c87d91fc8 100644 (file)
@@ -1468,11 +1468,7 @@ static void sizeArray(htmltbl_t * tbl)
 {
     graph_t *rowg;
     graph_t *colg;
-#ifdef _WIN32
-    Agdesc_t dir = { 1, 1, 0, 1 };
-#else
     Agdesc_t dir = Agstrictdirected;
-#endif
 
     /* Do the 1D cases by hand */
     if (tbl->rc == 1 || tbl->cc == 1) {