]> granicus.if.org Git - graphviz/commitdiff
osage: inline 'initCList' into a C99 initialization
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Dec 2022 04:46:33 +0000 (20:46 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 8 Dec 2022 01:12:41 +0000 (17:12 -0800)
This is the equivalent of 4460351650475f4e8aa4ef085928e1697776f070 but applied
to osage.

lib/osage/osageinit.c

index b4139670887b68f0b5dbe1b9a381354c9dcbd25b..03c0b0f0b626e6004f428ae090d2aa63be38f39a 100644 (file)
@@ -36,13 +36,6 @@ typedef struct {
     int cnt;
 } clist_t;
 
-static void initCList(clist_t * clist)
-{
-    clist->cl = 0;
-    clist->sz = 0;
-    clist->cnt = 0;
-}
-
 /* addCluster:
  * Append a new cluster to the list.
  * NOTE: cl[0] is empty. The clusters are in cl[1..cnt].
@@ -319,12 +312,11 @@ static void
 mkClusters (Agraph_t* g, clist_t* pclist, Agraph_t* parent)
 {
     graph_t* subg;
-    clist_t  list;
+    clist_t  list = {0};
     clist_t* clist;
 
     if (pclist == NULL) {
         clist = &list;
-        initCList(clist);
     }
     else
         clist = pclist;