plug-ins: fix more abs().

I am comparing absolute value of 2 double computation results. Might as
well just use fabs() instead of truncating both values to int.
Fixes the following:
> warning: using integer absolute value function ‘abs’ when argument is
> of floating point type ‘double’ [-Wabsolute-value]
This commit is contained in:
Jehan 2020-04-14 00:10:09 +02:00
parent fddaa77218
commit f6dd30f3a8
1 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,7 @@
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include <libgimp/gimp.h>
@ -309,8 +310,8 @@ find_grid_pos (GdkPoint *p,
m_hi_n_lo = m_lo_n_lo + 1;
/* figure out which is the better candidate */
if (abs ((m_lo_n_lo * r + (0.5 * r * (n_lo % 2))) - y) <
abs ((m_hi_n_lo * r + (0.5 * r * (n_lo % 2))) - y))
if (fabs ((m_lo_n_lo * r + (0.5 * r * (n_lo % 2))) - y) <
fabs ((m_hi_n_lo * r + (0.5 * r * (n_lo % 2))) - y))
{
m_n_lo = m_lo_n_lo;
}
@ -324,8 +325,8 @@ find_grid_pos (GdkPoint *p,
m_hi_n_hi = m_lo_n_hi + 1;
/* figure out which is the better candidate */
if (abs((m_lo_n_hi * r + (0.5 * r * (n_hi % 2))) - y) <
abs((m_hi_n_hi * r + (0.5 * r * (n_hi % 2))) - y))
if (fabs((m_lo_n_hi * r + (0.5 * r * (n_hi % 2))) - y) <
fabs((m_hi_n_hi * r + (0.5 * r * (n_hi % 2))) - y))
{
m_n_hi = m_lo_n_hi;
}