From e792934006067db07fcb07a721f3a09ea3900ceb Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 22 Mar 2021 21:15:08 -0700 Subject: [PATCH] replace unnecessary max() implementation with libc fmaxf No need to hand roll this ourselves now that we compile with C99. --- lib/neatogen/stress.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/neatogen/stress.c b/lib/neatogen/stress.c index 1d87f8174..4cbae1583 100644 --- a/lib/neatogen/stress.c +++ b/lib/neatogen/stress.c @@ -788,8 +788,6 @@ float *compute_apsp_packed(vtx_data * graph, int n) return Dij; } -#define max(x,y) ((x)>(y)?(x):(y)) - float *compute_apsp_artifical_weights_packed(vtx_data * graph, int n) { /* compute all-pairs-shortest-path-length while weighting the graph */ @@ -820,12 +818,8 @@ float *compute_apsp_artifical_weights_packed(vtx_data * graph, int n) for (j = 1; j <= deg_i; j++) { neighbor = graph[i].edges[j]; deg_j = graph[neighbor].nedges - 1; - weights[j] = (float) - max((float) - (deg_i + deg_j - - 2 * common_neighbors(graph, i, neighbor, - vtx_vec)), - graph[i].ewgts[j]); + weights[j] = fmaxf((float)(deg_i + deg_j - + 2 * common_neighbors(graph, i, neighbor, vtx_vec)), graph[i].ewgts[j]); } empty_neighbors_vec(graph, i, vtx_vec); graph[i].ewgts = weights; -- 2.40.0