From 339add1a67aa2add550208523d9ecd73e39ba1e0 Mon Sep 17 00:00:00 2001 From: Emden Gansner Date: Thu, 12 Jan 2017 16:29:42 -0500 Subject: [PATCH] Fix github issue #919; general cleanup. --- lib/fdpgen/fdp.h | 4 +--- lib/fdpgen/fdpinit.c | 6 +++--- lib/fdpgen/layout.c | 14 +++++++------- lib/fdpgen/tlayout.c | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/fdpgen/fdp.h b/lib/fdpgen/fdp.h index c68ceb5eb..6dcab4eb4 100644 --- a/lib/fdpgen/fdp.h +++ b/lib/fdpgen/fdp.h @@ -128,10 +128,8 @@ struct fdpParms_s { typedef struct fdpParms_s fdpParms_t; extern void fdp_layout(Agraph_t * g); - extern void fdp_nodesize(node_t *, boolean); - extern void fdp_init_graph(Agraph_t * g); - extern void fdp_init_node_edge(Agraph_t * g); extern void fdp_cleanup(Agraph_t * g); + extern void fdp_init_node_edge(graph_t * g); #ifdef __cplusplus } diff --git a/lib/fdpgen/fdpinit.c b/lib/fdpgen/fdpinit.c index b390fccc8..81ab0754b 100644 --- a/lib/fdpgen/fdpinit.c +++ b/lib/fdpgen/fdpinit.c @@ -46,9 +46,9 @@ static void initialPositions(graph_t * g) c = '\0'; if (sscanf(p, "%lf,%lf%c", pvec, pvec + 1, &c) >= 2) { if (PSinputscale > 0.0) { - int i; - for (i = 0; i < NDIM; i++) - pvec[i] = pvec[i] / PSinputscale; + int j; + for (j = 0; j < NDIM; j++) + pvec[j] = pvec[j] / PSinputscale; } ND_pinned(np) = P_SET; if ((c == '!') diff --git a/lib/fdpgen/layout.c b/lib/fdpgen/layout.c index c61bd0c5a..68bddba07 100644 --- a/lib/fdpgen/layout.c +++ b/lib/fdpgen/layout.c @@ -136,7 +136,7 @@ finalCC(graph_t * g, int c_cnt, graph_t ** cc, point * pts, graph_t * rg, if (isRoot || isEmpty) margin = 0; else - margin = late_int (g, G_margin, CL_OFFSET, 0); + margin = late_int (rg, G_margin, CL_OFFSET, 0); pt.x = -bb.LL.x + margin; pt.y = -bb.LL.y + margin + GD_border(rg)[BOTTOM_IX].y; bb.LL.x = 0; @@ -1002,11 +1002,11 @@ static void setBB(graph_t * g) * Initialize graph-dependent information and * state variable.s */ -void init_info(graph_t * g, layout_info * infop) +static void init_info(graph_t * g, layout_info * infop) { - infop->G_coord = agattr(g,AGRAPH, "coords", NULL); - infop->G_width = agattr(g,AGRAPH, "width", NULL); - infop->G_height = agattr(g, AGRAPH,"height", NULL); + infop->G_coord = agattr(g, AGRAPH, "coords", NULL); + infop->G_width = agattr(g, AGRAPH, "width", NULL); + infop->G_height = agattr(g, AGRAPH, "height", NULL); infop->rootg = g; infop->gid = 0; infop->pack.mode = getPackInfo(g, l_node, CL_OFFSET / 2, &(infop->pack)); @@ -1055,7 +1055,7 @@ mkClusters (graph_t * g, clist_t* pclist, graph_t* parent) } } -void fdp_init_graph(Agraph_t * g) +static void fdp_init_graph(Agraph_t * g) { setEdgeType (g, ET_LINE); GD_alg(g) = (void *) NEW(gdata); /* freed in cleanup_graph */ @@ -1067,7 +1067,7 @@ void fdp_init_graph(Agraph_t * g) fdp_init_node_edge(g); } -void fdpLayout(graph_t * g) +static void fdpLayout(graph_t * g) { layout_info info; diff --git a/lib/fdpgen/tlayout.c b/lib/fdpgen/tlayout.c index 643e6ddab..7a1a0110d 100644 --- a/lib/fdpgen/tlayout.c +++ b/lib/fdpgen/tlayout.c @@ -468,7 +468,7 @@ static pointf initPositions(graph_t * g, bport_t * pp) double size; Agnode_t *np; int n_pos = 0; /* no. of nodes with position info */ - box bb = { {0, 0}, {0, 0} }; + boxf bb = { {0, 0}, {0, 0} }; pointf ctr; /* center of boundary ellipse */ long local_seed; double PItimes2 = M_PI * 2.0; -- 2.40.0