From 5bf5b803a4a615150256ab5bbb41c2bbd2717050 Mon Sep 17 00:00:00 2001 From: Costa Shulyupin Date: Mon, 21 Feb 2022 22:12:01 +0200 Subject: [PATCH] refactor circularLayout MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit cut function cleanup, eliminate warning: ./lib/circogen/circular.c: In function ‘cleanup’: ./lib/circogen/circular.c|56 col 50| warning: unused parameter ‘sp’ [-Wunused-parameter] || 56 | static void cleanup(block_t * root, circ_state * sp) || | ~~~~~~~~~~~~~^~ --- lib/circogen/circular.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/circogen/circular.c b/lib/circogen/circular.c index dedbc1a3a..6bd22a254 100644 --- a/lib/circogen/circular.c +++ b/lib/circogen/circular.c @@ -48,16 +48,6 @@ static void initGraphAttrs(Agraph_t * g, circ_state * state) state->rootname = rootname; } -/* cleanup: - * We need to cleanup objects created in initGraphAttrs - * and all blocks. All graph objects are components of the - * initial derived graph and will be freed when it is closed. - */ -static void cleanup(block_t * root, circ_state * sp) -{ - freeBlocktree(root); -} - static block_t* createOneBlock(Agraph_t * g, circ_state * state) { @@ -106,7 +96,12 @@ void circularLayout(Agraph_t * g, Agraph_t* realg) root = createBlocktree(g, &state); circPos(g, root, &state); - cleanup(root, &state); + /* cleanup: + * We need to cleanup objects created in initGraphAttrs + * and all blocks. All graph objects are components of the + * initial derived graph and will be freed when it is closed. + */ + freeBlocktree(root); } #ifdef DEBUG -- 2.40.0