From 5dbd6ea612e29a6bebb8a01e7f4e6be0058650f0 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Thu, 30 Dec 2021 11:05:19 -0500 Subject: [PATCH] Fixed another abs() warning in novas.c. There was one more place where novas.c calls abs() that caused a warning when compiled on the Mac. It was passing long int to abs(). To be abundantly cautious, instead of using labs(), I just manually check for negative values and toggle -- inline abs. --- generate/novas/novas.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generate/novas/novas.c b/generate/novas/novas.c index 0d1b1808..5f1a4fec 100644 --- a/generate/novas/novas.c +++ b/generate/novas/novas.c @@ -8084,7 +8084,10 @@ short int cio_array (double jd_tdb, long int n_pts, else if ((abs_del_index <= n_pts) && (del_n_pts == 0)) { - n_swap = abs (n_pts - abs_del_index); + /* [Don Cross - 2021-12-30] Reworked abs() with inline logic to eliminate warnings about long int. */ + n_swap = n_pts - abs_del_index; + if (n_swap < 0) + n_swap = -n_swap; n_read = abs_del_index; /*