diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-12-05 15:17:44 -0800 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-12-05 15:17:44 -0800 |
commit | b48327d357e0818d1a6ae2a064cfa7d1567e1242 (patch) | |
tree | 4677f228a9846937a7ec71c72a1ab63ab69d68ab /src/base/fmt/float.c | |
parent | c200dd832789afa298ba45e0b9efdec96c0e92cc (diff) |
feat(huge): huge refactor (in progress).
Commented out libc includes to uncover all explicit dependencies.
A large fraction has now been ported over (no testing).
I did not port over the command line tools, such as the rc shell.
These will be done independently - as of now I just want the library to
stand independent.
Compilation currently fails due to the lack of math functions.
Diffstat (limited to 'src/base/fmt/float.c')
-rw-r--r-- | src/base/fmt/float.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/base/fmt/float.c b/src/base/fmt/float.c index 8a42dfc..ba2637e 100644 --- a/src/base/fmt/float.c +++ b/src/base/fmt/float.c @@ -154,7 +154,7 @@ sub1(char *a, int n) * can't get here. the number a is always normalized * so that it has a nonzero first digit. */ - abort(); + rt·exit(1); } // ----------------------------------------------------------------------- @@ -322,7 +322,7 @@ divascii(char *a, int *na, int *dp, int *bp) d = (int)(arrlen(tab1))-1; t = tab1 + d; b = t->bp; - if(memcmp(a, t->cmp, t->siz) > 0) + if(mem·compare(a, t->siz, t->cmp) > 0) d--; *dp -= d; *bp += b; @@ -382,7 +382,7 @@ mulascii(char *a, int *na, int *dp, int *bp) d = (int)(arrlen(tab2))-1; t = tab2 + d; b = t->bp; - if(memcmp(a, t->cmp, t->siz) < 0) + if(mem·compare(a, t->siz, t->cmp) < 0) d--; p = a + *na; *bp -= b; @@ -398,8 +398,8 @@ cmp(char *a, char *b) while((c1 = *b++) != '\0') { c2 = *a++; - if(isupper(c2)) - c2 = tolower(c2); + if(utf8·isupper(c2)) + c2 = utf8·tolower(c2); if(c1 != c2) return 1; } @@ -824,7 +824,7 @@ fmtfloat(fmt·State *io) end = special[0+ucase]; special: io->flag = f & (fmt·Width|fmt·Left); - return copy(io, end, strlen(end), strlen(end)); + return copy(io, end, str·len(end), str·len(end)); } if(isInf(val, 1)) { end = special[2+ucase]; @@ -910,7 +910,7 @@ fmtfloat(fmt·State *io) z2 = 0; } fmtexp(suf, e, ucase); - nsuf = strlen(suf); + nsuf = str·len(suf); break; casef: |