[xf86-video-neomagic] Use fabs() instead of abs() on double value.

Submitted by Matthieu Herrb on Feb. 10, 2019, 4:20 p.m.

Details

Message ID 20190210162027.22600-1-matthieu@herrb.eu
State Accepted
Commit f2aad64f4d732d4ec26e66d135fcd86c385527b7
Headers show
Series "Use fabs() instead of abs() on double value." ( rev: 1 ) in X.org

Not browsing as part of any series.

Commit Message

Matthieu Herrb Feb. 10, 2019, 4:20 p.m.
Silences clang warnings.

Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
---
 src/neo_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/neo_driver.c b/src/neo_driver.c
index 84e09ca..4301881 100644
--- a/src/neo_driver.c
+++ b/src/neo_driver.c
@@ -2953,7 +2953,7 @@  neoCalcVCLK(ScrnInfoPtr pScrn, long freq)
 	for (n = 0; n <= MAX_N; n++)
 	    for (d = 1; d <= MAX_D; d++) {
 		f_out = (n+1.0)/((d+1.0)*(1<<f))*REF_FREQ;
-		f_diff = abs(f_out-f_target);
+		f_diff = fabs(f_out-f_target);
 		if (f_diff < f_best_diff) {
 		    f_best_diff = f_diff;
 		    n_best = n;

Comments

> Matthieu Herrb <matthieu@herrb.eu> hat am 10. Februar 2019 um 17:20
> geschrieben:
> 
> 
> Silences clang warnings.
> 
> Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>

Reviewed-by: Walter Harms wharms@bfs,de
> ---
>  src/neo_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/neo_driver.c b/src/neo_driver.c
> index 84e09ca..4301881 100644
> --- a/src/neo_driver.c
> +++ b/src/neo_driver.c
> @@ -2953,7 +2953,7 @@ neoCalcVCLK(ScrnInfoPtr pScrn, long freq)
>  	for (n = 0; n <= MAX_N; n++)
>  	    for (d = 1; d <= MAX_D; d++) {
>  		f_out = (n+1.0)/((d+1.0)*(1<<f))*REF_FREQ;
> -		f_diff = abs(f_out-f_target);
> +		f_diff = fabs(f_out-f_target);
>  		if (f_diff < f_best_diff) {
>  		    f_best_diff = f_diff;
>  		    n_best = n;
> -- 
> 2.20.1
> 
> _______________________________________________
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel