From 0ed4fc83b52b9f471a08174e75b946d095a3a4e4 Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Mon, 26 Apr 2021 11:35:47 +0200 Subject: [PATCH] adg: use fabs instead of abs All internal operations use floating points: `abs` accepts integer values. This is just plain wrong. --- src/adg/adg-ldim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/adg/adg-ldim.c b/src/adg/adg-ldim.c index bb52f8b5..4b69de58 100644 --- a/src/adg/adg-ldim.c +++ b/src/adg/adg-ldim.c @@ -50,6 +50,7 @@ #include "adg-toy-text.h" #include "adg-dim.h" #include "adg-dim-private.h" +#include #include "adg-ldim.h" #include "adg-ldim-private.h" @@ -860,8 +861,8 @@ _adg_choose_flags(AdgLDim *ldim, gboolean *to_outside, gboolean *to_detach) data = adg_ldim_get_instance_private(ldim); local = adg_entity_get_local_matrix((AdgEntity *) ldim); global = adg_entity_get_global_matrix((AdgEntity *) ldim); - local_factor = abs(local->xx + local->yy) / 2; - global_factor = abs(global->xx + global->yy) / 2; + local_factor = fabs(local->xx + local->yy) / 2; + global_factor = fabs(global->xx + global->yy) / 2; available_space = data->geometry.distance * local_factor * global_factor; markers_space = 0; -- 2.11.4.GIT