mirror of
https://github.com/cosinekitty/astronomy.git
synced 2026-05-19 14:27:52 -04:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user