From f801c63795f3abad546c240bc4c27032c3e3c785 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 13 Jul 2015 14:22:17 +0200 Subject: Fix some warnings --- src/whirligig.c | 2 +- tests/pr_p_gradient_check.c | 4 ++-- tests/prediction_gradient_check.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/whirligig.c b/src/whirligig.c index b774f397..c5e8084b 100644 --- a/src/whirligig.c +++ b/src/whirligig.c @@ -777,7 +777,7 @@ int main(int argc, char *argv[]) /* Allocate initial window */ win.ws = default_window_size; win.img = calloc(win.ws, sizeof(struct image)); - if ( (win.img == NULL) ) { + if ( win.img == NULL ) { ERROR("Failed to allocate series buffers\n"); return 1; } diff --git a/tests/pr_p_gradient_check.c b/tests/pr_p_gradient_check.c index 1ae7b049..17709741 100644 --- a/tests/pr_p_gradient_check.c +++ b/tests/pr_p_gradient_check.c @@ -320,12 +320,12 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, vec2[n_line] = grad; n_line++; - if ( (fabs(cgrad) < 5e-8) && (fabs(grad) < 5e-8) ) { + if ( (fabsl(cgrad) < 5e-8) && (fabsl(grad) < 5e-8) ) { n_small++; continue; } - total += fabs(cgrad - grad); + total += fabsl(cgrad - grad); ntot++; if ( !within_tolerance(grad, cgrad, 5.0) diff --git a/tests/prediction_gradient_check.c b/tests/prediction_gradient_check.c index c5d4206b..0ab8a2ec 100644 --- a/tests/prediction_gradient_check.c +++ b/tests/prediction_gradient_check.c @@ -326,12 +326,12 @@ static double test_gradients(Crystal *cr, double incr_val, int refine, vec2[n_line] = grad; n_line++; - if ( (fabs(cgrad) < 5e-12) && (fabs(grad) < 5e-12) ) { + if ( (fabsl(cgrad) < 5e-12) && (fabsl(grad) < 5e-12) ) { n_small++; continue; } - total += fabs(cgrad - grad); + total += fabsl(cgrad - grad); ntot++; if ( !within_tolerance(grad, cgrad, 5.0) -- cgit v1.2.3