From 425bdd6de7f18538c68adb51cf82136d53114e17 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 4 Jul 2022 11:43:14 +0200 Subject: [PATCH] dot.demo/neatopack.c: add missing initialization Normally gvLayoutJobs does this initialization, but since we call ccomps before doing the layout and it expects graphs and nodes to have 'Agraphinfo_t' and 'Anodeinfo_t' records attached already, we must do this initialization in the user program instead, see https://graphviz.org/pdf/pack.3.pdf. Fixes first part of https://gitlab.com/graphviz/graphviz/-/issues/1800. --- dot.demo/neatopack.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dot.demo/neatopack.c b/dot.demo/neatopack.c index e86d7d133..f7db2af11 100644 --- a/dot.demo/neatopack.c +++ b/dot.demo/neatopack.c @@ -23,6 +23,9 @@ int main(int argc, char *argv[]) { fp = stdin; graph_t *g = agread(fp, NULL); + aginit(g, AGRAPH, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); + aginit(g, AGNODE, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); + int ncc; graph_t **cc = ccomps(g, &ncc, NULL); -- 2.40.0