diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-07 22:22:16 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-07 22:22:16 +0100 |
| commit | 8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (patch) | |
| tree | ae0285dd15042d1e9236a5ce2e60daf65acbdca0 /lib/libc/stdio/dtoa.c | |
| parent | fc00c656c96528112d05cf0edf8631bd5eaea446 (diff) | |
Add bin/true and bin/false implementations
- Added assembly implementations for `true` and `false` commands.
- Updated Kbuild files to include new binaries.
- Removed unused libraries and headers.
- Cleaned up makefile and unused code.
Diffstat (limited to 'lib/libc/stdio/dtoa.c')
| -rw-r--r-- | lib/libc/stdio/dtoa.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/stdio/dtoa.c b/lib/libc/stdio/dtoa.c index 9417fa8e..9b0eea99 100644 --- a/lib/libc/stdio/dtoa.c +++ b/lib/libc/stdio/dtoa.c @@ -1598,7 +1598,9 @@ static Bigint *Balloc(int k MTd) len = (sizeof(Bigint) + (x - 1) * sizeof(ULong) + sizeof(double) - 1) / sizeof(double); - if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem + if (k <= Kmax && + (long)(pmem_next - private_mem) + (long)len <= + (long)PRIVATE_mem #ifdef MULTIPLE_THREADS && TI == TI1 #endif @@ -4891,7 +4893,8 @@ static char *rv_alloc(int i MTd) int j, k, *r; j = sizeof(ULong); - for (k = 0; sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= i; + for (k = 0; + sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (size_t)i; j <<= 1) k++; r = (int *)Balloc(k MTa); @@ -4910,7 +4913,7 @@ static char *nrv_alloc(const char *s, char *s0, size_t s0len, char **rve, if (!s0) s0 = rv_alloc(n MTa); - else if (s0len <= n) { + else if (s0len <= (size_t)n) { rv = 0; t = rv + n; goto rve_chk; @@ -5312,7 +5315,7 @@ char *dtoa_r(double dd, int mode, int ndigits, int *decpt, int *sign, blen = sizeof(Bigint) + ((1 << ((int *)buf)[-1]) - 1) * sizeof(ULong) - sizeof(int); - } else if (blen <= i) { + } else if (blen <= (size_t)i) { buf = 0; if (rve) *rve = buf + i; |
