sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 6b950e436b9d81edb982d740d02198ba184402fb
parent c30255e50a77f20fb48bed7c700ff32f0d0dc489
Author: Michael Forney <mforney@mforney.org>
Date:   Fri, 22 Feb 2019 14:26:39 -0800

sort: Use regular `double` for -n

`long double` may require software emulation and the (possible) extra
precision is unnecessary here.

Diffstat:
Msort.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sort.c b/sort.c @@ -177,7 +177,7 @@ static int slinecmp(struct line *a, struct line *b) { int res = 0; - long double x, y; + double x, y; struct keydef *kd; TAILQ_FOREACH(kd, &kdhead, entry) { @@ -190,8 +190,8 @@ slinecmp(struct line *a, struct line *b) TAILQ_LAST(&kdhead, kdhead) != TAILQ_FIRST(&kdhead)) { res = 0; } else if (kd->flags & MOD_N) { - x = strtold(col1.line.data, NULL); - y = strtold(col2.line.data, NULL); + x = strtod(col1.line.data, NULL); + y = strtod(col2.line.data, NULL); res = (x < y) ? -1 : (x > y); } else if (kd->flags & (MOD_D | MOD_F | MOD_I)) { res = skipmodcmp(&col1.line, &col2.line, kd->flags);