From 8d45c6484f45db4b8125f7d07743a99caa7b6c5c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 3 Jul 2019 11:22:57 +0200 Subject: [PATCH] mescc: Mes C Library: Support GNU Awk: Implement atof. * lib/stdlib/atoi.c: Update. * lib/stdlib/atof.c: Rename from stub/atof.c; Implement. * lib/libc+gnu.c: Update include. * lib/libg.c: Update include. --- build-aux/configure-lib.sh | 1 + lib/{stub => stdlib}/atof.c | 11 ++++------- lib/stdlib/atoi.c | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-) rename lib/{stub => stdlib}/atof.c (87%) diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh index 0cecaccf..0831f210 100644 --- a/build-aux/configure-lib.sh +++ b/build-aux/configure-lib.sh @@ -249,6 +249,7 @@ lib/stdlib/abort.c lib/stdlib/abs.c lib/stdlib/alloca.c lib/stdlib/atexit.c +lib/stdlib/atof.c lib/stdlib/atol.c lib/stdlib/mbstowcs.c lib/string/bcmp.c diff --git a/lib/stub/atof.c b/lib/stdlib/atof.c similarity index 87% rename from lib/stub/atof.c rename to lib/stdlib/atof.c index 19f6771d..8bcacfcf 100644 --- a/lib/stub/atof.c +++ b/lib/stdlib/atof.c @@ -20,12 +20,9 @@ #include -int -atof (int x) +double +atof (char const *string) { - static int stub = 0; - if (__mes_debug () && !stub) - eputs ("atof stub\n"); - stub = 1; - return 0; + char const *p = string; + return abtod (&p, 0); } diff --git a/lib/stdlib/atoi.c b/lib/stdlib/atoi.c index 3f113723..6699fbea 100644 --- a/lib/stdlib/atoi.c +++ b/lib/stdlib/atoi.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -21,8 +21,8 @@ #include int -atoi (char const *s) +atoi (char const *string) { - char const *p = s; + char const *p = string; return abtol (&p, 0); }