To use the fabs function to the used type, instead of the double
variant. it fixes a build issue with clang:
./s_compoundn_template.c:64:14: error: absolute value function 'fabs' given an argument of type 'const long double' but has parameter of type 'double' which may cause truncation of value [-Werror,-Wabsolute-value]
64 | FLOAT pd = fabs (*(const FLOAT *) p);
| ^
./s_compoundn_template.c:64:14: note: use function 'fabsl' instead
64 | FLOAT pd = fabs (*(const FLOAT *) p);
| ^~~~
| fabsl
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
static int
compare (const void *p, const void *q)
{
- FLOAT pd = fabs (*(const FLOAT *) p);
- FLOAT qd = fabs (*(const FLOAT *) q);
+ FLOAT pd = M_FABS (*(const FLOAT *) p);
+ FLOAT qd = M_FABS (*(const FLOAT *) q);
if (pd < qd)
return -1;
else if (pd == qd)