From e4a568f45b6e4707a72583bde62e9cec7fedf56b Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 28 Jun 2021 20:51:46 -0700 Subject: [PATCH] remove useless flag parameter to remove_overlap This function has no path in which it sets this output parameter to non-zero. --- cmd/gvmap/gvmap.c | 2 +- lib/neatogen/adjust.c | 4 ++-- lib/neatogen/overlap.c | 9 +++------ lib/neatogen/overlap.h | 2 +- lib/sfdpgen/spring_electrical.c | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cmd/gvmap/gvmap.c b/cmd/gvmap/gvmap.c index 65c419750..f7c99ac5f 100644 --- a/cmd/gvmap/gvmap.c +++ b/cmd/gvmap/gvmap.c @@ -408,7 +408,7 @@ makeMap (SparseMatrix graph, int n, real* x, real* width, int* grouping, SparseMatrix D; D = SparseMatrix_get_real_adjacency_matrix_symmetrized(graph); remove_overlap(dim, D, x, width, 1000, 5000., - ELSCHEME_NONE, 0, NULL, NULL, TRUE, &flag); + ELSCHEME_NONE, 0, NULL, NULL, TRUE); nart = nart0; nrandom = nr0; diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index 2d0f31a3f..5470d1aea 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -749,7 +749,7 @@ fdpAdjust (graph_t* g, adjust_data* am) real *sizes; real *pos = N_NEW(Ndim * agnnodes(g), real); Agnode_t *n; - int flag, i; + int flag = 0, i; expand_t sep = sepFactor(g); pointf pad; @@ -777,7 +777,7 @@ fdpAdjust (graph_t* g, adjust_data* am) } remove_overlap(Ndim, A, pos, sizes, am->value, am->scaling, - ELSCHEME_NONE, 0, NULL, NULL, mapBool (agget(g, "overlap_shrink"), TRUE), &flag); + ELSCHEME_NONE, 0, NULL, NULL, mapBool (agget(g, "overlap_shrink"), TRUE)); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { real *npos = pos + (Ndim * ND_id(n)); diff --git a/lib/neatogen/overlap.c b/lib/neatogen/overlap.c index 83061cb7f..8828c1889 100644 --- a/lib/neatogen/overlap.c +++ b/lib/neatogen/overlap.c @@ -539,7 +539,7 @@ static int check_convergence(real max_overlap, real res, int has_penalty_terms, } void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntry, real initial_scaling, - int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int do_shrinking, int *flag){ + int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int do_shrinking){ /* edge_labeling_scheme: if ELSCHEME_NONE, n_constr_nodes/constr_nodes/A_constr are not used @@ -584,8 +584,6 @@ void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntr if (!ntry) return; - *flag = 0; - #ifdef DEBUG _statistics[0] = _statistics[1] = 0.; {FILE*fp; @@ -640,7 +638,7 @@ void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntr if (has_penalty_terms){ /* now do without penalty */ remove_overlap(dim, A, x, label_sizes, ntry, 0., - ELSCHEME_NONE, 0, NULL, NULL, do_shrinking, flag); + ELSCHEME_NONE, 0, NULL, NULL, do_shrinking); } #ifdef DEBUG @@ -672,7 +670,7 @@ void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntr #include #include void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntry, real initial_scaling, - int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int do_shrinking, int *flag) + int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int do_shrinking) { static int once; @@ -687,7 +685,6 @@ void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntr (void)constr_nodes; (void)A_constr; (void)do_shrinking; - (void)flag; if (once == 0) { once = 1; diff --git a/lib/neatogen/overlap.h b/lib/neatogen/overlap.h index 13e03c37a..108f89a90 100644 --- a/lib/neatogen/overlap.h +++ b/lib/neatogen/overlap.h @@ -49,5 +49,5 @@ typedef struct relative_position_constraints_struct* relative_position_constrai real OverlapSmoother_smooth(OverlapSmoother sm, int dim, real *x); void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntry, real initial_scaling, - int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int doShrink, int *flag); + int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int doShrink); real overlap_scaling(int dim, int m, real *x, real *width, real scale_sta, real scale_sto, real epsilon, int maxiter); diff --git a/lib/sfdpgen/spring_electrical.c b/lib/sfdpgen/spring_electrical.c index 9e2cd9d07..209ba64e0 100644 --- a/lib/sfdpgen/spring_electrical.c +++ b/lib/sfdpgen/spring_electrical.c @@ -2003,7 +2003,7 @@ static void multilevel_spring_electrical_embedding_core(int dim, SparseMatrix A0 assert(!(*flag)); attach_edge_label_coordinates(dim, A, n_edge_label_nodes, edge_label_nodes, x, x2); remove_overlap(dim, A, x, label_sizes, ctrl->overlap, ctrl->initial_scaling, - ctrl->edge_labeling_scheme, n_edge_label_nodes, edge_label_nodes, A, ctrl->do_shrinking, flag); + ctrl->edge_labeling_scheme, n_edge_label_nodes, edge_label_nodes, A, ctrl->do_shrinking); SparseMatrix_delete(A2); FREE(x2); if (A != A0) SparseMatrix_delete(A); @@ -2123,7 +2123,7 @@ static void multilevel_spring_electrical_embedding_core(int dim, SparseMatrix A0 remove_overlap(dim, A, x, label_sizes, ctrl->overlap, ctrl->initial_scaling, - ctrl->edge_labeling_scheme, n_edge_label_nodes, edge_label_nodes, A, ctrl->do_shrinking, flag); + ctrl->edge_labeling_scheme, n_edge_label_nodes, edge_label_nodes, A, ctrl->do_shrinking); RETURN: *ctrl = ctrl0; -- 2.40.0