mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
goom: Use fabs() instead of abs() to calculate the floating point absolute value
tentacle3d.c:268:7: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value] if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot + 2.0 * G_PI))) { ^
This commit is contained in:
parent
97fb3655df
commit
1cdd3765d6
1 changed files with 3 additions and 2 deletions
|
@ -265,12 +265,13 @@ pretty_move (PluginInfo * goomInfo, float cycle, float *dist, float *dist2,
|
||||||
tmp = cycle - (G_PI * 2.0) * floor (cycle / (G_PI * 2.0));
|
tmp = cycle - (G_PI * 2.0) * floor (cycle / (G_PI * 2.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot + 2.0 * G_PI))) {
|
if (fabs (tmp - fx_data->rot) > fabs (tmp - (fx_data->rot + 2.0 * G_PI))) {
|
||||||
fx_data->rot = (tmp + 15.0f * (fx_data->rot + 2 * G_PI)) / 16.0f;
|
fx_data->rot = (tmp + 15.0f * (fx_data->rot + 2 * G_PI)) / 16.0f;
|
||||||
if (fx_data->rot > 2.0 * G_PI)
|
if (fx_data->rot > 2.0 * G_PI)
|
||||||
fx_data->rot -= 2.0 * G_PI;
|
fx_data->rot -= 2.0 * G_PI;
|
||||||
*rotangle = fx_data->rot;
|
*rotangle = fx_data->rot;
|
||||||
} else if (abs (tmp - fx_data->rot) > abs (tmp - (fx_data->rot - 2.0 * G_PI))) {
|
} else if (fabs (tmp - fx_data->rot) >
|
||||||
|
fabs (tmp - (fx_data->rot - 2.0 * G_PI))) {
|
||||||
fx_data->rot = (tmp + 15.0f * (fx_data->rot - 2.0 * G_PI)) / 16.0f;
|
fx_data->rot = (tmp + 15.0f * (fx_data->rot - 2.0 * G_PI)) / 16.0f;
|
||||||
if (fx_data->rot < 0.0f)
|
if (fx_data->rot < 0.0f)
|
||||||
fx_data->rot += 2.0 * G_PI;
|
fx_data->rot += 2.0 * G_PI;
|
||||||
|
|
Loading…
Reference in a new issue