From: Matthew Fernandez Date: Tue, 22 Mar 2022 01:43:47 +0000 (-0700) Subject: lib/topfish maxmatch: remove unused 'sum_weights' X-Git-Tag: 4.0.0~161^2~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c746f19bd35900da4ed72acc5396e4dbd753575c;p=graphviz lib/topfish maxmatch: remove unused 'sum_weights' This causes compiler warnings resulting in build failure when enabling this in the CMake build system. Gitlab: related to #1836 --- diff --git a/lib/topfish/hierarchy.c b/lib/topfish/hierarchy.c index 40a119f8d..a276abebe 100644 --- a/lib/topfish/hierarchy.c +++ b/lib/topfish/hierarchy.c @@ -56,20 +56,17 @@ unweighted_common_fraction(v_data * graph, int v, int u, float *v_vector) num_shared_neighbors); } -static float fill_neighbors_vec(v_data * graph, int vtx, float *vtx_vec) -{ - float sum_weights = 0; +static void fill_neighbors_vec(v_data *graph, int vtx, float *vtx_vec) { int j; if (graph[0].ewgts != NULL) { for (j = 0; j < graph[vtx].nedges; j++) { - sum_weights += (vtx_vec[graph[vtx].edges[j]] = (float) fabs(graph[vtx].ewgts[j])); // use fabs for the self loop + vtx_vec[graph[vtx].edges[j]] = (float) fabs(graph[vtx].ewgts[j]); // use fabs for the self loop } } else { for (j = 0; j < graph[vtx].nedges; j++) { - sum_weights += (vtx_vec[graph[vtx].edges[j]] = 1); + vtx_vec[graph[vtx].edges[j]] = 1; } } - return sum_weights; } static void @@ -163,7 +160,6 @@ maxmatch(v_data * graph, /* array of vtx data for graph */ int closest_neighbor; float *vtx_vec = N_NEW(nvtxs, float); float *weighted_vtx_vec = N_NEW(nvtxs, float); - float sum_weights; // gather statistics, to enable normalizing the values double avg_edge_len = 0, avg_deg_2 = 0; @@ -247,7 +243,7 @@ maxmatch(v_data * graph, /* array of vtx data for graph */ continue; } inv_size = sqrt(1.0 / geom_graph[vtx].size); - sum_weights = fill_neighbors_vec(graph, vtx, weighted_vtx_vec); + fill_neighbors_vec(graph, vtx, weighted_vtx_vec); fill_neighbors_vec_unweighted(graph, vtx, vtx_vec); closest_neighbor = -1;