From aa4feb99e45498d1bee4d983a819e36134f4052b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 16 Jan 2022 10:11:44 -0800 Subject: [PATCH] dot.demo/neatopack.c:[nfc] align with C99 style and clang-format --- dot.demo/neatopack.c | 58 ++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/dot.demo/neatopack.c b/dot.demo/neatopack.c index fe9e2f6f3..e86d7d133 100644 --- a/dot.demo/neatopack.c +++ b/dot.demo/neatopack.c @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (c) 2011 AT&T Intellectual Property + * Copyright (c) 2011 AT&T Intellectual Property * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,43 +11,37 @@ #include #include #include +#include -int main (int argc, char* argv[]) -{ - graph_t *g; - graph_t *sg; - FILE *fp; - graph_t** cc; - int i, ncc; - GVC_t *gvc; +int main(int argc, char *argv[]) { + GVC_t *gvc = gvContext(); - gvc = gvContext(); + FILE *fp; + if (argc > 1) + fp = fopen(argv[1], "r"); + else + fp = stdin; + graph_t *g = agread(fp, NULL); - if (argc > 1) - fp = fopen(argv[1], "r"); - else - fp = stdin; - g = agread(fp, NULL); + int ncc; + graph_t **cc = ccomps(g, &ncc, NULL); - cc = ccomps(g, &ncc, (char*)0); + for (int i = 0; i < ncc; i++) { + graph_t *sg = cc[i]; + nodeInduce(sg); + gvLayout(gvc, sg, "neato"); + } + pack_graph(ncc, cc, g, 0); - for (i = 0; i < ncc; i++) { - sg = cc[i]; - nodeInduce (sg); - gvLayout(gvc, sg, "neato"); - } - pack_graph (ncc, cc, g, 0); + gvRender(gvc, g, "ps", stdout); - gvRender(gvc, g, "ps", stdout); + for (int i = 0; i < ncc; i++) { + graph_t *sg = cc[i]; + gvFreeLayout(gvc, sg); + agdelete(g, sg); + } - for (i = 0; i < ncc; i++) { - sg = cc[i]; - gvFreeLayout(gvc, sg); - agdelete(g, sg); - } - - agclose(g); - - return (gvFreeContext(gvc)); + agclose(g); + return gvFreeContext(gvc); } -- 2.40.0