From 1fc91f358008bfb39303a9064457259e7e7a5324 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Wed, 9 Dec 2020 15:04:54 -0800 Subject: [PATCH] Fold conv package into fmt Both packages had nearly identical dependency requirements, so merging them should help reduce the complexity of the build graph. --- Makefile | 4 - dsp/mpeg/mpeg1.c | 2 +- examples/cp.c | 2 +- examples/examples.mk | 1 - examples/findprime.c | 2 +- examples/ispell.c | 2 +- examples/nesemu1.cc | 2 +- examples/peek.c | 6 +- examples/printprimes.c | 2 +- examples/subprocess.c | 2 +- examples/unbourne.c | 2 +- libc/bits/abs.c | 6 +- libc/calls/calls.mk | 9 +- libc/calls/clock_gettime.c | 2 +- libc/calls/commandv.c | 2 +- libc/calls/fstat-nt.c | 2 +- libc/calls/getpriority-nt.c | 2 +- libc/calls/getrusage-nt.c | 2 +- libc/calls/getsetpriority-nt.c | 2 +- libc/calls/gettimeofday-nt.c | 2 +- libc/calls/hefty/fork-nt.c | 2 +- libc/calls/hefty/hefty.mk | 1 - libc/calls/hefty/mkntcmdline.c | 2 +- libc/calls/hefty/mkntenvblock.c | 2 +- libc/calls/hefty/ntspawn.c | 2 +- libc/calls/hefty/spawnve-sysv.c | 2 +- libc/calls/isdebuggerpresent.c | 2 +- libc/calls/nice.c | 2 +- libc/calls/openanon.c | 6 +- libc/calls/setitimer-nt.c | 2 +- libc/calls/utimensat-nt.c | 2 +- libc/calls/wait4-nt.c | 2 +- libc/conv/conv.mk | 85 ------------------- libc/conv/isslash.internal.h | 8 -- libc/dns/getaddrinfo.c | 2 +- libc/{conv => fmt}/abs.c | 2 +- libc/{conv => fmt}/atoi.c | 4 +- libc/{conv => fmt}/atol.c | 4 +- libc/{conv => fmt}/atoll.c | 4 +- libc/{conv => fmt}/basename.c | 4 +- libc/{conv => fmt}/basename_n.c | 4 +- libc/{conv => fmt}/conv.h | 6 +- libc/{conv => fmt}/convertmicros.c | 2 +- libc/{conv => fmt}/dirname.c | 2 +- libc/{conv => fmt}/div.c | 6 +- libc/{conv => fmt}/dosdatetimetounix.c | 2 +- libc/{conv => fmt}/filetimetotime.c | 2 +- libc/{conv => fmt}/filetimetotimespec.c | 2 +- libc/{conv => fmt}/filetimetotimeval.c | 2 +- libc/fmt/fmt.mk | 21 ++++- libc/{conv => fmt}/imaxabs.c | 2 +- libc/{conv => fmt}/imaxabs.thunk.S | 0 libc/{conv => fmt}/isabspath.c | 4 +- libc/fmt/isslash.internal.h | 10 +++ libc/fmt/itoa.c | 2 +- libc/{conv => fmt}/itoa.h | 6 +- libc/{conv => fmt}/itoa128radix10.greg.c | 4 +- libc/{conv => fmt}/itoa64.c | 4 +- libc/{conv => fmt}/itoa64fixed16.greg.c | 2 +- libc/{conv => fmt}/itoa64radix10.greg.c | 4 +- libc/{conv => fmt}/itoa64radix16.greg.c | 4 +- libc/{conv => fmt}/itoa64radix8.c | 4 +- libc/{conv => fmt}/kmonthyearday.c | 0 libc/{conv => fmt}/labs.c | 6 +- libc/{conv => fmt}/ldiv.c | 6 +- libc/{conv => fmt}/llabs.c | 6 +- libc/{conv => fmt}/lldiv.c | 6 +- libc/{conv => fmt}/ltpcpy.c | 2 +- libc/fmt/palandntoa.c | 2 +- libc/fmt/palandprintf.c | 2 +- libc/{conv => fmt}/rounddecimalplaces.c | 2 +- libc/{conv => fmt}/strlol.internal.h | 0 libc/{conv => fmt}/strtoimax.c | 2 +- libc/{conv => fmt}/strtol.c | 4 +- libc/{conv => fmt}/strtoll.c | 4 +- libc/{conv => fmt}/strtonum.c | 2 +- libc/{conv => fmt}/strtoul.c | 4 +- libc/{conv => fmt}/strtoull.c | 4 +- libc/{conv => fmt}/strtoumax.c | 2 +- libc/{conv => fmt}/timespectofiletime.c | 2 +- libc/{conv => fmt}/timetofiletime.c | 2 +- libc/{conv => fmt}/timevaltofiletime.c | 2 +- libc/{conv => fmt}/unsleb128.c | 2 +- libc/fmt/vcscanf.c | 2 +- libc/{conv => fmt}/wcslol.internal.h | 6 +- libc/{conv => fmt}/wcstoimax.c | 2 +- libc/{conv => fmt}/wcstol.c | 4 +- libc/isystem/endian.h | 2 +- libc/isystem/stdlib.h | 2 +- libc/libc.mk | 1 - libc/log/asan.c | 2 +- libc/log/backtrace2.c | 2 +- libc/log/backtrace3.c | 2 +- libc/log/checkfail_ndebug.c | 2 +- libc/log/getttysize.c | 2 +- libc/log/log.mk | 9 +- libc/log/vflogf.c | 2 +- libc/mem/mem.mk | 11 ++- libc/mem/reallocarray.c | 2 +- libc/runtime/gothere.greg.c | 55 ------------ libc/runtime/grow.c | 2 +- libc/runtime/program_invocation_short_name.S | 14 ++- libc/runtime/runtime.mk | 4 - libc/sock/inet_ntop.c | 2 +- libc/sock/parseport.c | 2 +- libc/sock/sock.mk | 13 ++- libc/stdio/fread.c | 2 +- libc/stdio/stdio.mk | 7 +- libc/str/strcmp8to16i.internal.h | 2 +- libc/str/tprecode16to8.c | 2 +- libc/str/wcsrtombs.c | 2 +- libc/time/strptime.c | 2 +- libc/time/time.mk | 13 ++- libc/time/times.c | 2 +- net/http/http.mk | 1 - test/libc/conv/test.mk | 64 -------------- test/libc/{conv => fmt}/basename_test.c | 2 +- test/libc/{conv => fmt}/itoa64radix10_test.c | 4 +- test/libc/{conv => fmt}/itoa64radix16_test.c | 2 +- test/libc/{conv => fmt}/llog10_test.c | 2 +- test/libc/fmt/palandprintf_test.c | 2 +- test/libc/{conv => fmt}/strtoimax_test.c | 2 +- test/libc/{conv => fmt}/strtoumax_test.c | 18 ++-- test/libc/fmt/test.mk | 5 +- .../{conv => fmt}/timevaltofiletime_test.c | 2 +- test/libc/test.mk | 1 - test/libc/time/clock_gettime_test.c | 2 +- third_party/chibicc/chibicc.h | 4 +- third_party/chibicc/chibicc.mk | 1 - third_party/chibicc/preprocess.c | 13 --- third_party/ctags/ctags.mk | 13 ++- third_party/ctags/eiffel.c | 2 +- third_party/ctags/readtags.c | 2 +- third_party/dlmalloc/dlmalloc.c | 2 +- third_party/dlmalloc/dlmalloc.mk | 1 - third_party/dlmalloc/mtrace.c | 2 +- third_party/duktape/duk_config.h | 2 +- third_party/f2c/f2c.mk | 9 +- third_party/f2c/wref.c | 2 +- third_party/lemon/lemon.c | 2 +- third_party/lemon/lemon.mk | 1 - third_party/lex/buf.c | 2 +- third_party/lex/lex.mk | 1 - third_party/lex/main.c | 2 +- third_party/lex/regex.c | 2 +- third_party/lex/scanopt.c | 2 +- third_party/lex/tables.c | 2 +- third_party/m4/eval.c | 2 +- third_party/m4/gnum4.c | 2 +- third_party/m4/tokenizer.c | 2 +- third_party/stb/stb.mk | 11 ++- third_party/stb/stb_image.c | 2 +- third_party/stb/stb_image_write.c | 2 +- third_party/stb/stb_image_write_png.c | 2 +- third_party/stb/stb_vorbis.c | 2 +- tool/build/ar.c | 5 +- tool/build/blinkenlights.c | 5 +- tool/build/build.mk | 7 +- tool/build/calculator.c | 5 +- tool/build/helpop.c | 2 +- tool/build/lib/buildlib.mk | 17 ++-- tool/build/lib/cga.c | 2 +- tool/build/lib/dis.c | 2 +- tool/build/lib/disarg.c | 2 +- tool/build/lib/high.c | 2 +- tool/build/lib/panel.c | 2 +- tool/build/lib/pty.c | 4 +- tool/build/lz4toasm.c | 2 +- tool/build/package.c | 2 +- tool/build/rollup.c | 2 +- tool/build/runit.c | 2 +- tool/build/runitd.c | 2 +- tool/calc/calc.c | 2 +- tool/calc/calc.mk | 5 +- tool/decode/ar.c | 2 +- tool/decode/decode.mk | 5 +- tool/decode/elf.c | 2 +- tool/decode/macho.c | 2 +- tool/decode/mkcombos.c | 2 +- tool/decode/pe2.c | 2 +- tool/decode/zip.c | 2 +- tool/hash/crctab.c | 2 +- tool/hash/hash.mk | 3 +- tool/net/greenbean.c | 5 +- tool/net/net.mk | 3 +- tool/net/redbean.c | 5 +- tool/viz/derasterize.c | 2 +- tool/viz/double2int.c | 2 +- tool/viz/fold.c | 2 +- tool/viz/generatematrix.c | 2 +- tool/viz/int2float.c | 2 +- tool/viz/lib/formatmatrix-double.c | 2 +- tool/viz/lib/formatstringtable-assembly.c | 2 +- tool/viz/lib/formatstringtable-code.c | 2 +- tool/viz/lib/vizlib.mk | 19 ++--- tool/viz/life.c | 5 +- tool/viz/memzoom.c | 5 +- tool/viz/od16.c | 2 +- tool/viz/printimage.c | 2 +- tool/viz/printpixel.c | 2 +- tool/viz/printvideo.c | 5 +- tool/viz/tabalign.c | 2 +- tool/viz/viz.mk | 21 +++-- 203 files changed, 352 insertions(+), 563 deletions(-) delete mode 100644 libc/conv/conv.mk delete mode 100644 libc/conv/isslash.internal.h rename libc/{conv => fmt}/abs.c (98%) rename libc/{conv => fmt}/atoi.c (97%) rename libc/{conv => fmt}/atol.c (96%) rename libc/{conv => fmt}/atoll.c (96%) rename libc/{conv => fmt}/basename.c (97%) rename libc/{conv => fmt}/basename_n.c (97%) rename libc/{conv => fmt}/conv.h (97%) rename libc/{conv => fmt}/convertmicros.c (98%) rename libc/{conv => fmt}/dirname.c (98%) rename libc/{conv => fmt}/div.c (95%) rename libc/{conv => fmt}/dosdatetimetounix.c (99%) rename libc/{conv => fmt}/filetimetotime.c (98%) rename libc/{conv => fmt}/filetimetotimespec.c (98%) rename libc/{conv => fmt}/filetimetotimeval.c (98%) rename libc/{conv => fmt}/imaxabs.c (98%) rename libc/{conv => fmt}/imaxabs.thunk.S (100%) rename libc/{conv => fmt}/isabspath.c (97%) create mode 100644 libc/fmt/isslash.internal.h rename libc/{conv => fmt}/itoa.h (92%) rename libc/{conv => fmt}/itoa128radix10.greg.c (97%) rename libc/{conv => fmt}/itoa64.c (97%) rename libc/{conv => fmt}/itoa64fixed16.greg.c (98%) rename libc/{conv => fmt}/itoa64radix10.greg.c (97%) rename libc/{conv => fmt}/itoa64radix16.greg.c (97%) rename libc/{conv => fmt}/itoa64radix8.c (97%) rename libc/{conv => fmt}/kmonthyearday.c (100%) rename libc/{conv => fmt}/labs.c (96%) rename libc/{conv => fmt}/ldiv.c (95%) rename libc/{conv => fmt}/llabs.c (96%) rename libc/{conv => fmt}/lldiv.c (94%) rename libc/{conv => fmt}/ltpcpy.c (98%) rename libc/{conv => fmt}/rounddecimalplaces.c (98%) rename libc/{conv => fmt}/strlol.internal.h (100%) rename libc/{conv => fmt}/strtoimax.c (99%) rename libc/{conv => fmt}/strtol.c (97%) rename libc/{conv => fmt}/strtoll.c (96%) rename libc/{conv => fmt}/strtonum.c (98%) rename libc/{conv => fmt}/strtoul.c (96%) rename libc/{conv => fmt}/strtoull.c (96%) rename libc/{conv => fmt}/strtoumax.c (99%) rename libc/{conv => fmt}/timespectofiletime.c (98%) rename libc/{conv => fmt}/timetofiletime.c (98%) rename libc/{conv => fmt}/timevaltofiletime.c (98%) rename libc/{conv => fmt}/unsleb128.c (98%) rename libc/{conv => fmt}/wcslol.internal.h (79%) rename libc/{conv => fmt}/wcstoimax.c (98%) rename libc/{conv => fmt}/wcstol.c (96%) delete mode 100644 libc/runtime/gothere.greg.c delete mode 100644 test/libc/conv/test.mk rename test/libc/{conv => fmt}/basename_test.c (99%) rename test/libc/{conv => fmt}/itoa64radix10_test.c (98%) rename test/libc/{conv => fmt}/itoa64radix16_test.c (98%) rename test/libc/{conv => fmt}/llog10_test.c (98%) rename test/libc/{conv => fmt}/strtoimax_test.c (99%) rename test/libc/{conv => fmt}/strtoumax_test.c (86%) rename test/libc/{conv => fmt}/timevaltofiletime_test.c (98%) diff --git a/Makefile b/Makefile index 3747d16e..8068a608 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,6 @@ include ape/lib/apelib.mk # │ include ape/ape.mk #─┘ include libc/sysv/sysv.mk #─┐ include libc/nt/nt.mk # ├──system -include libc/conv/conv.mk # │ include libc/fmt/fmt.mk # │ include libc/rand/rand.mk #─┘ include libc/calls/calls.mk #─┐ @@ -186,7 +185,6 @@ include test/libc/dns/test.mk include test/libc/rand/test.mk include test/libc/time/test.mk include test/libc/stdio/test.mk -include test/libc/conv/test.mk include test/libc/release/test.mk include test/libc/test.mk include test/ape/lib/test.mk @@ -251,7 +249,6 @@ COSMOPOLITAN_OBJECTS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_CRYPTO \ LIBC_DNS \ LIBC_ELF \ @@ -286,7 +283,6 @@ COSMOPOLITAN_HEADERS = \ LIBC_ALG \ LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ LIBC_CRYPTO \ LIBC_DNS \ LIBC_ELF \ diff --git a/dsp/mpeg/mpeg1.c b/dsp/mpeg/mpeg1.c index 5b8a5e2f..d0c8a30c 100644 --- a/dsp/mpeg/mpeg1.c +++ b/dsp/mpeg/mpeg1.c @@ -33,7 +33,7 @@ #include "dsp/mpeg/mpeg.h" #include "dsp/mpeg/video.h" #include "libc/bits/initializer.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/macros.h" #include "libc/math.h" diff --git a/examples/cp.c b/examples/cp.c index bab5dd66..0a6d558f 100644 --- a/examples/cp.c +++ b/examples/cp.c @@ -9,8 +9,8 @@ #endif #include "libc/calls/calls.h" #include "libc/calls/hefty/copyfile.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/runtime/gc.h" #include "libc/runtime/runtime.h" diff --git a/examples/examples.mk b/examples/examples.mk index 2ca26f53..5a51e2cd 100644 --- a/examples/examples.mk +++ b/examples/examples.mk @@ -46,7 +46,6 @@ EXAMPLES_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_FMT \ LIBC_LOG \ LIBC_LOG_ASAN \ diff --git a/examples/findprime.c b/examples/findprime.c index b231f312..bea266f5 100644 --- a/examples/findprime.c +++ b/examples/findprime.c @@ -10,7 +10,7 @@ #include "libc/bits/bits.h" #include "libc/calls/calls.h" #include "libc/calls/struct/itimerval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/log/color.internal.h" diff --git a/examples/ispell.c b/examples/ispell.c index 95d8e9be..4524d17a 100644 --- a/examples/ispell.c +++ b/examples/ispell.c @@ -12,7 +12,7 @@ #include "libc/alg/critbit0.h" #include "libc/bits/bits.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/examples/nesemu1.cc b/examples/nesemu1.cc index f7b81f5c..ec658610 100644 --- a/examples/nesemu1.cc +++ b/examples/nesemu1.cc @@ -18,8 +18,8 @@ #include "libc/calls/hefty/spawn.h" #include "libc/calls/struct/itimerval.h" #include "libc/calls/struct/winsize.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/inttypes.h" #include "libc/log/check.h" diff --git a/examples/peek.c b/examples/peek.c index 7d368786..3b293dff 100644 --- a/examples/peek.c +++ b/examples/peek.c @@ -17,14 +17,16 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/runtime/interruptiblecall.h" #include "libc/stdio/stdio.h" #include "libc/sysv/consts/sig.h" struct InterruptibleCall icall; -static intptr_t peek(intptr_t *addr) { return *addr; } +static intptr_t peek(intptr_t *addr) { + return *addr; +} int main(int argc, char *argv[]) { int i; diff --git a/examples/printprimes.c b/examples/printprimes.c index 61fafbf1..5624a98b 100644 --- a/examples/printprimes.c +++ b/examples/printprimes.c @@ -7,7 +7,7 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/math.h" #include "libc/stdio/stdio.h" diff --git a/examples/subprocess.c b/examples/subprocess.c index 42fa2862..7ad61210 100644 --- a/examples/subprocess.c +++ b/examples/subprocess.c @@ -10,7 +10,7 @@ #include "libc/alg/alg.h" #include "libc/calls/calls.h" #include "libc/calls/hefty/spawn.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/runtime/gc.h" diff --git a/examples/unbourne.c b/examples/unbourne.c index d4ee6c23..c3c28735 100644 --- a/examples/unbourne.c +++ b/examples/unbourne.c @@ -120,9 +120,9 @@ #include "libc/calls/struct/stat.h" #include "libc/calls/struct/tms.h" #include "libc/calls/termios.h" -#include "libc/conv/conv.h" #include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/limits.h" #include "libc/log/log.h" diff --git a/libc/bits/abs.c b/libc/bits/abs.c index d4ad144c..b3735735 100644 --- a/libc/bits/abs.c +++ b/libc/bits/abs.c @@ -17,7 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" -int(abs)(int x) { return ABS(x); } +int(abs)(int x) { + return ABS(x); +} diff --git a/libc/calls/calls.mk b/libc/calls/calls.mk index b946b4e6..3fb19d13 100644 --- a/libc/calls/calls.mk +++ b/libc/calls/calls.mk @@ -39,15 +39,14 @@ LIBC_CALLS_A_CHECKS = \ LIBC_CALLS_A_DIRECTDEPS = \ LIBC_FMT \ - LIBC_STR \ - LIBC_RAND \ - LIBC_CONV \ - LIBC_STUBS \ LIBC_NEXGEN32E \ - LIBC_NT_NTDLL \ LIBC_NT_ADVAPI32 \ LIBC_NT_KERNEL32 \ LIBC_NT_KERNELBASE \ + LIBC_NT_NTDLL \ + LIBC_RAND \ + LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV_CALLS \ LIBC_SYSV diff --git a/libc/calls/clock_gettime.c b/libc/calls/clock_gettime.c index 659827fa..24e2a65f 100644 --- a/libc/calls/clock_gettime.c +++ b/libc/calls/clock_gettime.c @@ -23,8 +23,8 @@ #include "libc/calls/internal.h" #include "libc/calls/struct/timespec.h" #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/mach.h" #include "libc/nt/struct/filetime.h" #include "libc/nt/struct/systemtime.h" diff --git a/libc/calls/commandv.c b/libc/calls/commandv.c index 2bf22f78..666c1440 100644 --- a/libc/calls/commandv.c +++ b/libc/calls/commandv.c @@ -20,9 +20,9 @@ #include "libc/bits/progn.internal.h" #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" #include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/nt/ntdll.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" diff --git a/libc/calls/fstat-nt.c b/libc/calls/fstat-nt.c index 5b53e3e6..f2cf25a0 100644 --- a/libc/calls/fstat-nt.c +++ b/libc/calls/fstat-nt.c @@ -20,7 +20,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/internal.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/enum/fileflagandattributes.h" #include "libc/nt/enum/fileinfobyhandleclass.h" #include "libc/nt/enum/filetype.h" diff --git a/libc/calls/getpriority-nt.c b/libc/calls/getpriority-nt.c index 8e1d1ca3..e35d9f30 100644 --- a/libc/calls/getpriority-nt.c +++ b/libc/calls/getpriority-nt.c @@ -21,7 +21,7 @@ #include "libc/calls/calls.h" #include "libc/calls/internal.h" #include "libc/calls/kntprioritycombos.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nexgen32e/ffs.h" #include "libc/nt/enum/processcreationflags.h" #include "libc/nt/enum/threadpriority.h" diff --git a/libc/calls/getrusage-nt.c b/libc/calls/getrusage-nt.c index 5e136b88..08ead423 100644 --- a/libc/calls/getrusage-nt.c +++ b/libc/calls/getrusage-nt.c @@ -20,7 +20,7 @@ #include "libc/calls/calls.h" #include "libc/calls/internal.h" #include "libc/calls/struct/rusage.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/accounting.h" #include "libc/nt/runtime.h" #include "libc/nt/thread.h" diff --git a/libc/calls/getsetpriority-nt.c b/libc/calls/getsetpriority-nt.c index 9ee54583..269c495a 100644 --- a/libc/calls/getsetpriority-nt.c +++ b/libc/calls/getsetpriority-nt.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/sysv/consts/prio.h" #include "libc/sysv/errfuns.h" diff --git a/libc/calls/gettimeofday-nt.c b/libc/calls/gettimeofday-nt.c index 87e20a49..f017211d 100644 --- a/libc/calls/gettimeofday-nt.c +++ b/libc/calls/gettimeofday-nt.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/internal.h" #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" #include "libc/nt/struct/systemtime.h" #include "libc/nt/synchronization.h" diff --git a/libc/calls/hefty/fork-nt.c b/libc/calls/hefty/fork-nt.c index e5bd3ad9..f25667bc 100644 --- a/libc/calls/hefty/fork-nt.c +++ b/libc/calls/hefty/fork-nt.c @@ -22,7 +22,7 @@ #include "libc/calls/hefty/ntspawn.h" #include "libc/calls/hefty/spawn.h" #include "libc/calls/internal.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/nt/enum/filemapflags.h" #include "libc/nt/enum/pageflags.h" #include "libc/nt/enum/startf.h" diff --git a/libc/calls/hefty/hefty.mk b/libc/calls/hefty/hefty.mk index 40e4d1c1..4be740ad 100644 --- a/libc/calls/hefty/hefty.mk +++ b/libc/calls/hefty/hefty.mk @@ -37,7 +37,6 @@ LIBC_CALLS_HEFTY_A_CHECKS = \ LIBC_CALLS_HEFTY_A_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ LIBC_MEM \ LIBC_NEXGEN32E \ diff --git a/libc/calls/hefty/mkntcmdline.c b/libc/calls/hefty/mkntcmdline.c index b764f945..a7e413db 100644 --- a/libc/calls/hefty/mkntcmdline.c +++ b/libc/calls/hefty/mkntcmdline.c @@ -20,7 +20,7 @@ #include "libc/alg/arraylist2.internal.h" #include "libc/calls/calls.h" #include "libc/calls/hefty/ntspawn.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/mem/mem.h" #include "libc/nexgen32e/hascharacter.internal.h" diff --git a/libc/calls/hefty/mkntenvblock.c b/libc/calls/hefty/mkntenvblock.c index ce8e7207..8e11ba79 100644 --- a/libc/calls/hefty/mkntenvblock.c +++ b/libc/calls/hefty/mkntenvblock.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/arraylist2.internal.h" #include "libc/calls/hefty/ntspawn.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/mem/mem.h" #include "libc/str/oldutf16.internal.h" diff --git a/libc/calls/hefty/ntspawn.c b/libc/calls/hefty/ntspawn.c index 238b7bf5..eecddfc0 100644 --- a/libc/calls/hefty/ntspawn.c +++ b/libc/calls/hefty/ntspawn.c @@ -24,7 +24,7 @@ #include "libc/calls/calls.h" #include "libc/calls/hefty/ntspawn.h" #include "libc/calls/internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/enum/processcreationflags.h" #include "libc/nt/process.h" #include "libc/nt/runtime.h" diff --git a/libc/calls/hefty/spawnve-sysv.c b/libc/calls/hefty/spawnve-sysv.c index cdeaa362..fddcd83b 100644 --- a/libc/calls/hefty/spawnve-sysv.c +++ b/libc/calls/hefty/spawnve-sysv.c @@ -22,8 +22,8 @@ #include "libc/calls/hefty/internal.h" #include "libc/calls/hefty/spawn.h" #include "libc/calls/internal.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/paths.h" #include "libc/runtime/runtime.h" diff --git a/libc/calls/isdebuggerpresent.c b/libc/calls/isdebuggerpresent.c index 0f025bea..c923902c 100644 --- a/libc/calls/isdebuggerpresent.c +++ b/libc/calls/isdebuggerpresent.c @@ -21,8 +21,8 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/internal.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/nexgen32e/vendor.internal.h" #include "libc/nt/struct/teb.h" diff --git a/libc/calls/nice.c b/libc/calls/nice.c index e60b3968..237b743a 100644 --- a/libc/calls/nice.c +++ b/libc/calls/nice.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/sysv/consts/prio.h" static int clamp(int p) { diff --git a/libc/calls/openanon.c b/libc/calls/openanon.c index 1d3dd007..72c213ae 100644 --- a/libc/calls/openanon.c +++ b/libc/calls/openanon.c @@ -20,10 +20,10 @@ #include "libc/assert.h" #include "libc/calls/calls.h" #include "libc/calls/internal.h" -#include "libc/conv/conv.h" -#include "libc/conv/isslash.internal.h" -#include "libc/conv/itoa.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/isslash.internal.h" +#include "libc/fmt/itoa.h" #include "libc/nt/createfile.h" #include "libc/nt/enum/accessmask.h" #include "libc/nt/enum/creationdisposition.h" diff --git a/libc/calls/setitimer-nt.c b/libc/calls/setitimer-nt.c index 6362d93c..d9ac482a 100644 --- a/libc/calls/setitimer-nt.c +++ b/libc/calls/setitimer-nt.c @@ -20,8 +20,8 @@ #include "libc/calls/calls.h" #include "libc/calls/internal.h" #include "libc/calls/struct/itimerval.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/nexgen32e/nexgen32e.h" #include "libc/nt/files.h" diff --git a/libc/calls/utimensat-nt.c b/libc/calls/utimensat-nt.c index 9faa6735..a91f3e7f 100644 --- a/libc/calls/utimensat-nt.c +++ b/libc/calls/utimensat-nt.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/createfile.h" #include "libc/nt/enum/accessmask.h" #include "libc/nt/enum/creationdisposition.h" diff --git a/libc/calls/wait4-nt.c b/libc/calls/wait4-nt.c index 45efcb92..b5735186 100644 --- a/libc/calls/wait4-nt.c +++ b/libc/calls/wait4-nt.c @@ -20,7 +20,7 @@ #include "libc/calls/calls.h" #include "libc/calls/internal.h" #include "libc/calls/struct/rusage.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/nt/accounting.h" #include "libc/nt/enum/status.h" diff --git a/libc/conv/conv.mk b/libc/conv/conv.mk deleted file mode 100644 index 6d7f9f60..00000000 --- a/libc/conv/conv.mk +++ /dev/null @@ -1,85 +0,0 @@ -#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ -#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ -# -# SYNOPSIS -# -# Cosmopolitan Data Conversions -# -# DESCRIPTION -# -# This package provides functions that convert between data types. -# It's intended to be lower level than the memory and formatting -# libraries. - -PKGS += LIBC_CONV - -LIBC_CONV_ARTIFACTS += LIBC_CONV_A -LIBC_CONV = $(LIBC_CONV_A_DEPS) $(LIBC_CONV_A) -LIBC_CONV_A = o/$(MODE)/libc/conv/conv.a -LIBC_CONV_A_FILES := $(wildcard libc/conv/*) -LIBC_CONV_A_HDRS = $(filter %.h,$(LIBC_CONV_A_FILES)) -LIBC_CONV_A_SRCS_S = $(filter %.S,$(LIBC_CONV_A_FILES)) -LIBC_CONV_A_SRCS_C = $(filter %.c,$(LIBC_CONV_A_FILES)) - -LIBC_CONV_A_SRCS = \ - $(LIBC_CONV_A_SRCS_S) \ - $(LIBC_CONV_A_SRCS_C) - -LIBC_CONV_A_OBJS = \ - $(LIBC_CONV_A_SRCS:%=o/$(MODE)/%.zip.o) \ - $(LIBC_CONV_A_SRCS_S:%.S=o/$(MODE)/%.o) \ - $(LIBC_CONV_A_SRCS_C:%.c=o/$(MODE)/%.o) - -LIBC_CONV_A_CHECKS = \ - $(LIBC_CONV_A).pkg \ - $(LIBC_CONV_A_HDRS:%=o/$(MODE)/%.ok) - -LIBC_CONV_A_DIRECTDEPS = \ - LIBC_NEXGEN32E \ - LIBC_STUBS \ - LIBC_STR \ - LIBC_TINYMATH \ - LIBC_SYSV \ - THIRD_PARTY_COMPILER_RT - -LIBC_CONV_A_DEPS := \ - $(call uniq,$(foreach x,$(LIBC_CONV_A_DIRECTDEPS),$($(x)))) - -$(LIBC_CONV_A): libc/conv/ \ - $(LIBC_CONV_A).pkg \ - $(LIBC_CONV_A_OBJS) - -$(LIBC_CONV_A).pkg: \ - $(LIBC_CONV_A_OBJS) \ - $(foreach x,$(LIBC_CONV_A_DIRECTDEPS),$($(x)_A).pkg) - -o/$(MODE)/libc/conv/dosdatetimetounix.o \ -o/$(MODE)/libc/conv/itoa64radix10.greg.o \ -o/$(MODE)/libc/conv/timetofiletime.o \ -o/$(MODE)/libc/conv/filetimetotime.o \ -o/$(MODE)/libc/conv/timespectofiletime.o \ -o/$(MODE)/libc/conv/filetimetotimespec.o \ -o/$(MODE)/libc/conv/filetimetotimeval.o: \ - OVERRIDE_CFLAGS += \ - -O3 - -o/$(MODE)/libc/conv/itoa64radix10.greg.o \ -o/$(MODE)/libc/conv/itoa128radix10.greg.o: \ - OVERRIDE_CFLAGS += \ - -fwrapv - -$(LIBC_CONV_A_OBJS): \ - OVERRIDE_CFLAGS += \ - $(NO_MAGIC) - -LIBC_CONV_LIBS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x))) -LIBC_CONV_SRCS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_SRCS)) -LIBC_CONV_HDRS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_HDRS)) -LIBC_CONV_BINS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_BINS)) -LIBC_CONV_CHECKS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_CHECKS)) -LIBC_CONV_OBJS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_OBJS)) -LIBC_CONV_TESTS = $(foreach x,$(LIBC_CONV_ARTIFACTS),$($(x)_TESTS)) -$(LIBC_CONV_OBJS): $(BUILD_FILES) libc/conv/conv.mk - -.PHONY: o/$(MODE)/libc/conv -o/$(MODE)/libc/conv: $(LIBC_CONV_CHECKS) diff --git a/libc/conv/isslash.internal.h b/libc/conv/isslash.internal.h deleted file mode 100644 index 63f7a15c..00000000 --- a/libc/conv/isslash.internal.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef COSMOPOLITAN_LIBC_CONV_ISSLASH_H_ -#define COSMOPOLITAN_LIBC_CONV_ISSLASH_H_ -#if !(__ASSEMBLER__ + __LINKER__ + 0) - -forceinline bool isslash(int c) { return c == '/' || c == '\\'; } - -#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ -#endif /* COSMOPOLITAN_LIBC_CONV_ISSLASH_H_ */ diff --git a/libc/dns/getaddrinfo.c b/libc/dns/getaddrinfo.c index dfeb175b..04aa346f 100644 --- a/libc/dns/getaddrinfo.c +++ b/libc/dns/getaddrinfo.c @@ -19,10 +19,10 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" #include "libc/dns/dns.h" #include "libc/dns/hoststxt.h" #include "libc/dns/resolvconf.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/sock/sock.h" #include "libc/str/str.h" diff --git a/libc/conv/abs.c b/libc/fmt/abs.c similarity index 98% rename from libc/conv/abs.c rename to libc/fmt/abs.c index 553bef67..2ee77469 100644 --- a/libc/conv/abs.c +++ b/libc/fmt/abs.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" int(abs)(int x) { return 0 < x ? x : -x; diff --git a/libc/conv/atoi.c b/libc/fmt/atoi.c similarity index 97% rename from libc/conv/atoi.c rename to libc/fmt/atoi.c index 153ab7ae..11af3ba2 100644 --- a/libc/conv/atoi.c +++ b/libc/fmt/atoi.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" /** diff --git a/libc/conv/atol.c b/libc/fmt/atol.c similarity index 96% rename from libc/conv/atol.c rename to libc/fmt/atol.c index 578c5350..c60026bc 100644 --- a/libc/conv/atol.c +++ b/libc/fmt/atol.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" long atol(const char *s) { diff --git a/libc/conv/atoll.c b/libc/fmt/atoll.c similarity index 96% rename from libc/conv/atoll.c rename to libc/fmt/atoll.c index 3349fe61..54422193 100644 --- a/libc/conv/atoll.c +++ b/libc/fmt/atoll.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" long long atoll(const char *s) { diff --git a/libc/conv/basename.c b/libc/fmt/basename.c similarity index 97% rename from libc/conv/basename.c rename to libc/fmt/basename.c index 0e3b3f51..36b01d00 100644 --- a/libc/conv/basename.c +++ b/libc/fmt/basename.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/isslash.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/isslash.internal.h" #include "libc/str/str.h" /** diff --git a/libc/conv/basename_n.c b/libc/fmt/basename_n.c similarity index 97% rename from libc/conv/basename_n.c rename to libc/fmt/basename_n.c index 1800523b..d9bb3973 100644 --- a/libc/conv/basename_n.c +++ b/libc/fmt/basename_n.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/isslash.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/isslash.internal.h" /** * Returns pointer to last filename component in path. diff --git a/libc/conv/conv.h b/libc/fmt/conv.h similarity index 97% rename from libc/conv/conv.h rename to libc/fmt/conv.h index 6f419b64..0b568cfe 100644 --- a/libc/conv/conv.h +++ b/libc/fmt/conv.h @@ -1,5 +1,5 @@ -#ifndef COSMOPOLITAN_LIBC_CONV_CONV_H_ -#define COSMOPOLITAN_LIBC_CONV_CONV_H_ +#ifndef COSMOPOLITAN_LIBC_FMT_CONV_H_ +#define COSMOPOLITAN_LIBC_FMT_CONV_H_ #include "libc/calls/struct/timespec.h" #include "libc/calls/struct/timeval.h" #include "libc/nt/struct/filetime.h" @@ -103,4 +103,4 @@ intmax_t __imaxabs(intmax_t) libcesque pureconst; COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ -#endif /* COSMOPOLITAN_LIBC_CONV_CONV_H_ */ +#endif /* COSMOPOLITAN_LIBC_FMT_CONV_H_ */ diff --git a/libc/conv/convertmicros.c b/libc/fmt/convertmicros.c similarity index 98% rename from libc/conv/convertmicros.c rename to libc/fmt/convertmicros.c index 305782a5..4f4b731d 100644 --- a/libc/conv/convertmicros.c +++ b/libc/fmt/convertmicros.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/time/time.h" long convertmicros(const struct timeval *tv, long tick) { diff --git a/libc/conv/dirname.c b/libc/fmt/dirname.c similarity index 98% rename from libc/conv/dirname.c rename to libc/fmt/dirname.c index f0c7a051..56bd8b34 100644 --- a/libc/conv/dirname.c +++ b/libc/fmt/dirname.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/str/str.h" #define ISDELIM(c) (c == '/' || c == '\\' || c == '.') diff --git a/libc/conv/div.c b/libc/fmt/div.c similarity index 95% rename from libc/conv/div.c rename to libc/fmt/div.c index 9321feb8..cbdd3060 100644 --- a/libc/conv/div.c +++ b/libc/fmt/div.c @@ -17,6 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" -div_t(div)(int num, int den) { return div(num, den); } +div_t(div)(int num, int den) { + return div(num, den); +} diff --git a/libc/conv/dosdatetimetounix.c b/libc/fmt/dosdatetimetounix.c similarity index 99% rename from libc/conv/dosdatetimetounix.c rename to libc/fmt/dosdatetimetounix.c index 5415e76e..26bf0e9b 100644 --- a/libc/conv/dosdatetimetounix.c +++ b/libc/fmt/dosdatetimetounix.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/time/time.h" diff --git a/libc/conv/filetimetotime.c b/libc/fmt/filetimetotime.c similarity index 98% rename from libc/conv/filetimetotime.c rename to libc/fmt/filetimetotime.c index de05c401..6ca69b6b 100644 --- a/libc/conv/filetimetotime.c +++ b/libc/fmt/filetimetotime.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" int64_t filetimetotime(struct NtFileTime ft) { diff --git a/libc/conv/filetimetotimespec.c b/libc/fmt/filetimetotimespec.c similarity index 98% rename from libc/conv/filetimetotimespec.c rename to libc/fmt/filetimetotimespec.c index e218d4f8..f68ba278 100644 --- a/libc/conv/filetimetotimespec.c +++ b/libc/fmt/filetimetotimespec.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" /** diff --git a/libc/conv/filetimetotimeval.c b/libc/fmt/filetimetotimeval.c similarity index 98% rename from libc/conv/filetimetotimeval.c rename to libc/fmt/filetimetotimeval.c index 64596ec6..2b988a39 100644 --- a/libc/conv/filetimetotimeval.c +++ b/libc/fmt/filetimetotimeval.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" void FileTimeToTimeVal(struct timeval *tv, struct NtFileTime ft) { diff --git a/libc/fmt/fmt.mk b/libc/fmt/fmt.mk index 53f5d164..5789db9d 100644 --- a/libc/fmt/fmt.mk +++ b/libc/fmt/fmt.mk @@ -34,12 +34,12 @@ LIBC_FMT_A_CHECKS = \ $(LIBC_FMT_A_HDRS:%=o/$(MODE)/%.ok) LIBC_FMT_A_DIRECTDEPS = \ - LIBC_STUBS \ - LIBC_STR \ - LIBC_TINYMATH \ LIBC_NEXGEN32E \ LIBC_NT_KERNELBASE \ + LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV \ + LIBC_TINYMATH \ THIRD_PARTY_COMPILER_RT LIBC_FMT_A_DEPS := \ @@ -57,6 +57,21 @@ $(LIBC_FMT_A_OBJS): \ OVERRIDE_CFLAGS += \ -fno-jump-tables +o/$(MODE)/libc/fmt/dosdatetimetounix.o \ +o/$(MODE)/libc/fmt/itoa64radix10.greg.o \ +o/$(MODE)/libc/fmt/timetofiletime.o \ +o/$(MODE)/libc/fmt/filetimetotime.o \ +o/$(MODE)/libc/fmt/timespectofiletime.o \ +o/$(MODE)/libc/fmt/filetimetotimespec.o \ +o/$(MODE)/libc/fmt/filetimetotimeval.o: \ + OVERRIDE_CFLAGS += \ + -O3 + +o/$(MODE)/libc/fmt/itoa64radix10.greg.o \ +o/$(MODE)/libc/fmt/itoa128radix10.greg.o: \ + OVERRIDE_CFLAGS += \ + -fwrapv + LIBC_FMT_LIBS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x))) LIBC_FMT_SRCS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_SRCS)) LIBC_FMT_HDRS = $(foreach x,$(LIBC_FMT_ARTIFACTS),$($(x)_HDRS)) diff --git a/libc/conv/imaxabs.c b/libc/fmt/imaxabs.c similarity index 98% rename from libc/conv/imaxabs.c rename to libc/fmt/imaxabs.c index da364479..04d1ed4b 100644 --- a/libc/conv/imaxabs.c +++ b/libc/fmt/imaxabs.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" intmax_t(imaxabs)(intmax_t x) { diff --git a/libc/conv/imaxabs.thunk.S b/libc/fmt/imaxabs.thunk.S similarity index 100% rename from libc/conv/imaxabs.thunk.S rename to libc/fmt/imaxabs.thunk.S diff --git a/libc/conv/isabspath.c b/libc/fmt/isabspath.c similarity index 97% rename from libc/conv/isabspath.c rename to libc/fmt/isabspath.c index b5521d4e..a9375849 100644 --- a/libc/conv/isabspath.c +++ b/libc/fmt/isabspath.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/isslash.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/isslash.internal.h" /** * Returns true if pathname could be absolute on any known platform. diff --git a/libc/fmt/isslash.internal.h b/libc/fmt/isslash.internal.h new file mode 100644 index 00000000..4ee549e4 --- /dev/null +++ b/libc/fmt/isslash.internal.h @@ -0,0 +1,10 @@ +#ifndef COSMOPOLITAN_LIBC_FMT_ISSLASH_H_ +#define COSMOPOLITAN_LIBC_FMT_ISSLASH_H_ +#if !(__ASSEMBLER__ + __LINKER__ + 0) + +forceinline bool isslash(int c) { + return c == '/' || c == '\\'; +} + +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_FMT_ISSLASH_H_ */ diff --git a/libc/fmt/itoa.c b/libc/fmt/itoa.c index dcbf0b44..bdb4929a 100644 --- a/libc/fmt/itoa.c +++ b/libc/fmt/itoa.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" STATIC_YOINK("ntoa"); diff --git a/libc/conv/itoa.h b/libc/fmt/itoa.h similarity index 92% rename from libc/conv/itoa.h rename to libc/fmt/itoa.h index d5c31264..0371be9d 100644 --- a/libc/conv/itoa.h +++ b/libc/fmt/itoa.h @@ -1,5 +1,5 @@ -#ifndef COSMOPOLITAN_LIBC_CONV_ITOA_H_ -#define COSMOPOLITAN_LIBC_CONV_ITOA_H_ +#ifndef COSMOPOLITAN_LIBC_FMT_ITOA_H_ +#define COSMOPOLITAN_LIBC_FMT_ITOA_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ /*───────────────────────────────────────────────────────────────────────────│─╗ @@ -29,4 +29,4 @@ size_t uint128toarray_radix10(uint128_t, char *); COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ -#endif /* COSMOPOLITAN_LIBC_CONV_ITOA_H_ */ +#endif /* COSMOPOLITAN_LIBC_FMT_ITOA_H_ */ diff --git a/libc/conv/itoa128radix10.greg.c b/libc/fmt/itoa128radix10.greg.c similarity index 97% rename from libc/conv/itoa128radix10.greg.c rename to libc/fmt/itoa128radix10.greg.c index a9d7e328..be7bc580 100644 --- a/libc/conv/itoa128radix10.greg.c +++ b/libc/fmt/itoa128radix10.greg.c @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/reverse.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" uint128_t __udivmodti4(uint128_t, uint128_t, uint128_t *); diff --git a/libc/conv/itoa64.c b/libc/fmt/itoa64.c similarity index 97% rename from libc/conv/itoa64.c rename to libc/fmt/itoa64.c index 78086bca..e1ccd86d 100644 --- a/libc/conv/itoa64.c +++ b/libc/fmt/itoa64.c @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/reverse.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" noinline size_t uint64toarray(uint64_t i, char *a, int r) { size_t j; diff --git a/libc/conv/itoa64fixed16.greg.c b/libc/fmt/itoa64fixed16.greg.c similarity index 98% rename from libc/conv/itoa64fixed16.greg.c rename to libc/fmt/itoa64fixed16.greg.c index 00601c50..e87f8b9e 100644 --- a/libc/conv/itoa64fixed16.greg.c +++ b/libc/fmt/itoa64fixed16.greg.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" size_t uint64toarray_fixed16(uint64_t x, char b[hasatleast 17], uint8_t k) { int i; diff --git a/libc/conv/itoa64radix10.greg.c b/libc/fmt/itoa64radix10.greg.c similarity index 97% rename from libc/conv/itoa64radix10.greg.c rename to libc/fmt/itoa64radix10.greg.c index 137761dc..4134c527 100644 --- a/libc/conv/itoa64radix10.greg.c +++ b/libc/fmt/itoa64radix10.greg.c @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/reverse.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" /** diff --git a/libc/conv/itoa64radix16.greg.c b/libc/fmt/itoa64radix16.greg.c similarity index 97% rename from libc/conv/itoa64radix16.greg.c rename to libc/fmt/itoa64radix16.greg.c index 36157db2..bd665724 100644 --- a/libc/conv/itoa64radix16.greg.c +++ b/libc/fmt/itoa64radix16.greg.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/macros.h" #include "libc/nexgen32e/bsr.h" diff --git a/libc/conv/itoa64radix8.c b/libc/fmt/itoa64radix8.c similarity index 97% rename from libc/conv/itoa64radix8.c rename to libc/fmt/itoa64radix8.c index 3fb18d78..20ca1571 100644 --- a/libc/conv/itoa64radix8.c +++ b/libc/fmt/itoa64radix8.c @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/reverse.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" /** diff --git a/libc/conv/kmonthyearday.c b/libc/fmt/kmonthyearday.c similarity index 100% rename from libc/conv/kmonthyearday.c rename to libc/fmt/kmonthyearday.c diff --git a/libc/conv/labs.c b/libc/fmt/labs.c similarity index 96% rename from libc/conv/labs.c rename to libc/fmt/labs.c index ceded9b7..fd0fc03b 100644 --- a/libc/conv/labs.c +++ b/libc/fmt/labs.c @@ -17,7 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" -long(labs)(long x) { return ABS(x); } +long(labs)(long x) { + return ABS(x); +} diff --git a/libc/conv/ldiv.c b/libc/fmt/ldiv.c similarity index 95% rename from libc/conv/ldiv.c rename to libc/fmt/ldiv.c index 361b693c..52a341a3 100644 --- a/libc/conv/ldiv.c +++ b/libc/fmt/ldiv.c @@ -17,6 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" -ldiv_t(ldiv)(long num, long den) { return ldiv(num, den); } +ldiv_t(ldiv)(long num, long den) { + return ldiv(num, den); +} diff --git a/libc/conv/llabs.c b/libc/fmt/llabs.c similarity index 96% rename from libc/conv/llabs.c rename to libc/fmt/llabs.c index 19998f49..2ef727d5 100644 --- a/libc/conv/llabs.c +++ b/libc/fmt/llabs.c @@ -17,7 +17,9 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" -long long(llabs)(long long x) { return ABS(x); } +long long(llabs)(long long x) { + return ABS(x); +} diff --git a/libc/conv/lldiv.c b/libc/fmt/lldiv.c similarity index 94% rename from libc/conv/lldiv.c rename to libc/fmt/lldiv.c index e3c3e971..9cf69271 100644 --- a/libc/conv/lldiv.c +++ b/libc/fmt/lldiv.c @@ -17,6 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" -lldiv_t(lldiv)(long long num, long long den) { return lldiv(num, den); } +lldiv_t(lldiv)(long long num, long long den) { + return lldiv(num, den); +} diff --git a/libc/conv/ltpcpy.c b/libc/fmt/ltpcpy.c similarity index 98% rename from libc/conv/ltpcpy.c rename to libc/fmt/ltpcpy.c index 52be48c2..5e9d63b9 100644 --- a/libc/conv/ltpcpy.c +++ b/libc/fmt/ltpcpy.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" char *ltpcpy(char *dst, long x) { unsigned len = llog10(abs(x)) + 1; diff --git a/libc/fmt/palandntoa.c b/libc/fmt/palandntoa.c index 29cd80a5..ee4c8fee 100644 --- a/libc/fmt/palandntoa.c +++ b/libc/fmt/palandntoa.c @@ -25,7 +25,7 @@ │ THE SOFTWARE. │ └─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/paland.inc" #include "libc/fmt/palandprintf.internal.h" diff --git a/libc/fmt/palandprintf.c b/libc/fmt/palandprintf.c index 9ffbd1ba..da677674 100644 --- a/libc/fmt/palandprintf.c +++ b/libc/fmt/palandprintf.c @@ -38,7 +38,7 @@ #include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/bits/weaken.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/fmt/paland.inc" #include "libc/fmt/palandprintf.internal.h" diff --git a/libc/conv/rounddecimalplaces.c b/libc/fmt/rounddecimalplaces.c similarity index 98% rename from libc/conv/rounddecimalplaces.c rename to libc/fmt/rounddecimalplaces.c index 3ee5b52a..4e5628c1 100644 --- a/libc/conv/rounddecimalplaces.c +++ b/libc/fmt/rounddecimalplaces.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/math.h" double RoundDecimalPlaces(double f, double digs, double rounder(double)) { diff --git a/libc/conv/strlol.internal.h b/libc/fmt/strlol.internal.h similarity index 100% rename from libc/conv/strlol.internal.h rename to libc/fmt/strlol.internal.h diff --git a/libc/conv/strtoimax.c b/libc/fmt/strtoimax.c similarity index 99% rename from libc/conv/strtoimax.c rename to libc/fmt/strtoimax.c index 0c6f116c..6212ad86 100644 --- a/libc/conv/strtoimax.c +++ b/libc/fmt/strtoimax.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/nexgen32e/bsr.h" #include "libc/str/str.h" diff --git a/libc/conv/strtol.c b/libc/fmt/strtol.c similarity index 97% rename from libc/conv/strtol.c rename to libc/fmt/strtol.c index 23280b02..cdf62a76 100644 --- a/libc/conv/strtol.c +++ b/libc/fmt/strtol.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" /** diff --git a/libc/conv/strtoll.c b/libc/fmt/strtoll.c similarity index 96% rename from libc/conv/strtoll.c rename to libc/fmt/strtoll.c index f97c5333..7204b16e 100644 --- a/libc/conv/strtoll.c +++ b/libc/fmt/strtoll.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" long long strtoll(const char *s, char **endptr, int optional_base) { diff --git a/libc/conv/strtonum.c b/libc/fmt/strtonum.c similarity index 98% rename from libc/conv/strtonum.c rename to libc/fmt/strtonum.c index e3874ecf..0cb40d56 100644 --- a/libc/conv/strtonum.c +++ b/libc/fmt/strtonum.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/str/str.h" #include "libc/sysv/errfuns.h" diff --git a/libc/conv/strtoul.c b/libc/fmt/strtoul.c similarity index 96% rename from libc/conv/strtoul.c rename to libc/fmt/strtoul.c index e0787e3f..f5da0ae5 100644 --- a/libc/conv/strtoul.c +++ b/libc/fmt/strtoul.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" unsigned long strtoul(const char *s, char **endptr, int optional_base) { diff --git a/libc/conv/strtoull.c b/libc/fmt/strtoull.c similarity index 96% rename from libc/conv/strtoull.c rename to libc/fmt/strtoull.c index 3910f6aa..645daef3 100644 --- a/libc/conv/strtoull.c +++ b/libc/fmt/strtoull.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/strlol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/strlol.internal.h" #include "libc/limits.h" unsigned long long strtoull(const char *s, char **endptr, int optional_base) { diff --git a/libc/conv/strtoumax.c b/libc/fmt/strtoumax.c similarity index 99% rename from libc/conv/strtoumax.c rename to libc/fmt/strtoumax.c index 2040aeaa..3a9cd8f2 100644 --- a/libc/conv/strtoumax.c +++ b/libc/fmt/strtoumax.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/str/str.h" /** diff --git a/libc/conv/timespectofiletime.c b/libc/fmt/timespectofiletime.c similarity index 98% rename from libc/conv/timespectofiletime.c rename to libc/fmt/timespectofiletime.c index 1e2c3a8d..a6ee4f06 100644 --- a/libc/conv/timespectofiletime.c +++ b/libc/fmt/timespectofiletime.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nexgen32e/nexgen32e.h" #include "libc/nt/struct/filetime.h" diff --git a/libc/conv/timetofiletime.c b/libc/fmt/timetofiletime.c similarity index 98% rename from libc/conv/timetofiletime.c rename to libc/fmt/timetofiletime.c index a45e1a15..9d17d5df 100644 --- a/libc/conv/timetofiletime.c +++ b/libc/fmt/timetofiletime.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" struct NtFileTime TimeToFileTime(int64_t t) { diff --git a/libc/conv/timevaltofiletime.c b/libc/fmt/timevaltofiletime.c similarity index 98% rename from libc/conv/timevaltofiletime.c rename to libc/fmt/timevaltofiletime.c index 2155d030..674b0a17 100644 --- a/libc/conv/timevaltofiletime.c +++ b/libc/fmt/timevaltofiletime.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" #include "libc/time/time.h" diff --git a/libc/conv/unsleb128.c b/libc/fmt/unsleb128.c similarity index 98% rename from libc/conv/unsleb128.c rename to libc/fmt/unsleb128.c index e52fd41f..12c1c7c7 100644 --- a/libc/conv/unsleb128.c +++ b/libc/fmt/unsleb128.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" /** * Decodes a GNU-style varint from a buffer. diff --git a/libc/fmt/vcscanf.c b/libc/fmt/vcscanf.c index 02be64bd..0b68d0a6 100644 --- a/libc/fmt/vcscanf.c +++ b/libc/fmt/vcscanf.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/weaken.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" diff --git a/libc/conv/wcslol.internal.h b/libc/fmt/wcslol.internal.h similarity index 79% rename from libc/conv/wcslol.internal.h rename to libc/fmt/wcslol.internal.h index 45137aa9..a183fc86 100644 --- a/libc/conv/wcslol.internal.h +++ b/libc/fmt/wcslol.internal.h @@ -1,5 +1,5 @@ -#ifndef COSMOPOLITAN_LIBC_CONV_WCSLOL_H_ -#define COSMOPOLITAN_LIBC_CONV_WCSLOL_H_ +#ifndef COSMOPOLITAN_LIBC_FMT_WCSLOL_H_ +#define COSMOPOLITAN_LIBC_FMT_WCSLOL_H_ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ @@ -13,4 +13,4 @@ COSMOPOLITAN_C_START_ COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ -#endif /* COSMOPOLITAN_LIBC_CONV_WCSLOL_H_ */ +#endif /* COSMOPOLITAN_LIBC_FMT_WCSLOL_H_ */ diff --git a/libc/conv/wcstoimax.c b/libc/fmt/wcstoimax.c similarity index 98% rename from libc/conv/wcstoimax.c rename to libc/fmt/wcstoimax.c index 252e0297..2ae92f76 100644 --- a/libc/conv/wcstoimax.c +++ b/libc/fmt/wcstoimax.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/str/str.h" intmax_t wcstoimax(const wchar_t *s, wchar_t **endptr, int base) { diff --git a/libc/conv/wcstol.c b/libc/fmt/wcstol.c similarity index 96% rename from libc/conv/wcstol.c rename to libc/fmt/wcstol.c index 8bb2acd0..314c5d16 100644 --- a/libc/conv/wcstol.c +++ b/libc/fmt/wcstol.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/wcslol.internal.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/wcslol.internal.h" #include "libc/limits.h" #include "libc/str/str.h" diff --git a/libc/isystem/endian.h b/libc/isystem/endian.h index 9bacf991..ff745bf4 100644 --- a/libc/isystem/endian.h +++ b/libc/isystem/endian.h @@ -1,4 +1,4 @@ #ifndef LIBC_ISYSTEM_ENDIAN_H_ #define LIBC_ISYSTEM_ENDIAN_H_ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #endif diff --git a/libc/isystem/stdlib.h b/libc/isystem/stdlib.h index fbb9406a..b887d845 100644 --- a/libc/isystem/stdlib.h +++ b/libc/isystem/stdlib.h @@ -1,6 +1,6 @@ #ifndef LIBC_ISYSTEM_STDLIB_H_ #define LIBC_ISYSTEM_STDLIB_H_ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/rand/rand.h" #include "libc/runtime/runtime.h" diff --git a/libc/libc.mk b/libc/libc.mk index 3c3134fb..be947d59 100644 --- a/libc/libc.mk +++ b/libc/libc.mk @@ -11,7 +11,6 @@ LIBC_CHECKS = $(LIBC_HDRS:%=o/$(MODE)/%.ok) o/$(MODE)/libc: o/$(MODE)/libc/alg \ o/$(MODE)/libc/bits \ o/$(MODE)/libc/calls \ - o/$(MODE)/libc/conv \ o/$(MODE)/libc/crt \ o/$(MODE)/libc/dns \ o/$(MODE)/libc/elf \ diff --git a/libc/log/asan.c b/libc/log/asan.c index 2506973c..c8ba2cb8 100644 --- a/libc/log/asan.c +++ b/libc/log/asan.c @@ -20,7 +20,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/bits/weaken.h" #include "libc/calls/calls.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/log/asan.internal.h" #include "libc/log/backtrace.internal.h" #include "libc/log/log.h" diff --git a/libc/log/backtrace2.c b/libc/log/backtrace2.c index 23ce7d79..5114cfab 100644 --- a/libc/log/backtrace2.c +++ b/libc/log/backtrace2.c @@ -23,8 +23,8 @@ #include "libc/bits/weaken.h" #include "libc/calls/calls.h" #include "libc/calls/hefty/spawn.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/log/backtrace.internal.h" #include "libc/log/log.h" diff --git a/libc/log/backtrace3.c b/libc/log/backtrace3.c index 9daf559a..4544d991 100644 --- a/libc/log/backtrace3.c +++ b/libc/log/backtrace3.c @@ -21,8 +21,8 @@ #include "libc/assert.h" #include "libc/bits/weaken.h" #include "libc/calls/calls.h" -#include "libc/conv/itoa.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/backtrace.internal.h" #include "libc/macros.h" #include "libc/nexgen32e/gc.internal.h" diff --git a/libc/log/checkfail_ndebug.c b/libc/log/checkfail_ndebug.c index 27d9d860..8c4b85ab 100644 --- a/libc/log/checkfail_ndebug.c +++ b/libc/log/checkfail_ndebug.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" #include "libc/errno.h" +#include "libc/fmt/itoa.h" #include "libc/log/internal.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" diff --git a/libc/log/getttysize.c b/libc/log/getttysize.c index ae216e7e..b8c93c78 100644 --- a/libc/log/getttysize.c +++ b/libc/log/getttysize.c @@ -20,7 +20,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/termios.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" #include "libc/sysv/consts/termios.h" diff --git a/libc/log/log.mk b/libc/log/log.mk index 86ea8fdf..a60acc0b 100644 --- a/libc/log/log.mk +++ b/libc/log/log.mk @@ -30,22 +30,21 @@ LIBC_LOG_A_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_ELF \ LIBC_FMT \ - LIBC_TINYMATH \ + LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_NT_KERNELBASE \ - LIBC_MEM \ + LIBC_NT_NTDLL \ LIBC_RAND \ LIBC_RUNTIME \ LIBC_STDIO \ LIBC_STR \ LIBC_STUBS \ - LIBC_NT_NTDLL \ - LIBC_UNICODE \ LIBC_SYSV \ LIBC_TIME \ + LIBC_TINYMATH \ + LIBC_UNICODE \ THIRD_PARTY_DLMALLOC LIBC_LOG_A_DEPS := \ diff --git a/libc/log/vflogf.c b/libc/log/vflogf.c index 550df441..db1f9345 100644 --- a/libc/log/vflogf.c +++ b/libc/log/vflogf.c @@ -21,9 +21,9 @@ #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" #include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/log/internal.h" #include "libc/log/log.h" diff --git a/libc/mem/mem.mk b/libc/mem/mem.mk index 08a3d0d3..e37f29b7 100644 --- a/libc/mem/mem.mk +++ b/libc/mem/mem.mk @@ -29,14 +29,13 @@ LIBC_MEM_A_CHECKS = \ $(LIBC_MEM_A_HDRS:%=o/$(MODE)/%.ok) LIBC_MEM_A_DIRECTDEPS = \ - LIBC_CONV \ - LIBC_STR \ - LIBC_FMT \ - LIBC_RAND \ - LIBC_STUBS \ LIBC_CALLS \ - LIBC_RUNTIME \ + LIBC_FMT \ LIBC_NEXGEN32E \ + LIBC_RAND \ + LIBC_RUNTIME \ + LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV \ THIRD_PARTY_DLMALLOC diff --git a/libc/mem/reallocarray.c b/libc/mem/reallocarray.c index 97f235a8..0397af3b 100644 --- a/libc/mem/reallocarray.c +++ b/libc/mem/reallocarray.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" /** diff --git a/libc/runtime/gothere.greg.c b/libc/runtime/gothere.greg.c deleted file mode 100644 index 2a39f394..00000000 --- a/libc/runtime/gothere.greg.c +++ /dev/null @@ -1,55 +0,0 @@ -/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ -╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2020 Justine Alexandra Roberts Tunney │ -│ │ -│ This program is free software; you can redistribute it and/or modify │ -│ it under the terms of the GNU General Public License as published by │ -│ the Free Software Foundation; version 2 of the License. │ -│ │ -│ This program is distributed in the hope that it will be useful, but │ -│ WITHOUT ANY WARRANTY; without even the implied warranty of │ -│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU │ -│ General Public License for more details. │ -│ │ -│ You should have received a copy of the GNU General Public License │ -│ along with this program; if not, write to the Free Software │ -│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ -│ 02110-1301 USA │ -╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" -#include "libc/runtime/runtime.h" - -/** - * Debugs super low-level stuff, e.g. - * - * void GOT_HERE(int); - * INITIALIZER(100, _init_got_here_100, GOT_HERE(100)); - * INITIALIZER(200, _init_got_here_200, GOT_HERE(200)); - * INITIALIZER(300, _init_got_here_300, GOT_HERE(300)); - * INITIALIZER(400, _init_got_here_400, GOT_HERE(400)); - * INITIALIZER(500, _init_got_here_500, GOT_HERE(500)); - * INITIALIZER(600, _init_got_here_600, GOT_HERE(600)); - * INITIALIZER(700, _init_got_here_700, GOT_HERE(700)); - * INITIALIZER(800, _init_got_here_800, GOT_HERE(800)); - * - */ -privileged interruptfn void GOT_HERE(long num) { - size_t len; - char msg[48]; - len = 0; - msg[len++] = 'g'; - msg[len++] = 'o'; - msg[len++] = 't'; - msg[len++] = ' '; - msg[len++] = 'h'; - msg[len++] = 'e'; - msg[len++] = 'r'; - msg[len++] = 'e'; - msg[len++] = ' '; - len += int64toarray_radix10(num, &msg[len]); - msg[len++] = '\r'; - msg[len++] = '\n'; - msg[len] = '\0'; - __print(msg, len); -} diff --git a/libc/runtime/grow.c b/libc/runtime/grow.c index b0e7f921..8d5f566b 100644 --- a/libc/runtime/grow.c +++ b/libc/runtime/grow.c @@ -20,7 +20,7 @@ #include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/bits/weaken.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" diff --git a/libc/runtime/program_invocation_short_name.S b/libc/runtime/program_invocation_short_name.S index 9140988c..ba931dcd 100644 --- a/libc/runtime/program_invocation_short_name.S +++ b/libc/runtime/program_invocation_short_name.S @@ -28,11 +28,17 @@ program_invocation_short_name: .previous .init.start 400,_init_program_invocation_short_name - push %rdi push %rsi - mov (%r13),%rdi - call basename + mov (%r13),%rsi + mov %rsi,%rcx +1: lodsb + cmp $'/,%al + cmoveq %rsi,%rcx + cmp $'\\,%al + cmoveq %rsi,%rcx + test %al,%al + jnz 1b + xchg %rcx,%rax pop %rsi - pop %rdi stosq .init.end 400,_init_program_invocation_short_name diff --git a/libc/runtime/runtime.mk b/libc/runtime/runtime.mk index 20a384ba..ad7c81df 100644 --- a/libc/runtime/runtime.mk +++ b/libc/runtime/runtime.mk @@ -34,15 +34,11 @@ LIBC_RUNTIME_A_CHECKS = \ $(LIBC_RUNTIME_A_HDRS:%=o/$(MODE)/%.ok) LIBC_RUNTIME_A_DIRECTDEPS = \ - LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ - LIBC_TINYMATH \ LIBC_ELF \ LIBC_FMT \ LIBC_NEXGEN32E \ LIBC_NT_KERNELBASE \ - LIBC_RAND \ LIBC_STR \ LIBC_STUBS \ LIBC_SYSV \ diff --git a/libc/sock/inet_ntop.c b/libc/sock/inet_ntop.c index ad23eb9e..1ecaa6eb 100644 --- a/libc/sock/inet_ntop.c +++ b/libc/sock/inet_ntop.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/sysv/consts/af.h" #include "libc/sysv/errfuns.h" diff --git a/libc/sock/parseport.c b/libc/sock/parseport.c index 2bc9ef70..9d4efa3d 100644 --- a/libc/sock/parseport.c +++ b/libc/sock/parseport.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/sock/sock.h" #include "libc/sysv/errfuns.h" diff --git a/libc/sock/sock.mk b/libc/sock/sock.mk index 7371c5cc..c0b16f71 100644 --- a/libc/sock/sock.mk +++ b/libc/sock/sock.mk @@ -21,18 +21,17 @@ LIBC_SOCK_A_CHECKS = \ LIBC_SOCK_A_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ LIBC_MEM \ + LIBC_NEXGEN32E \ + LIBC_NT_KERNEL32 \ + LIBC_NT_KERNELBASE \ + LIBC_NT_MSWSOCK \ + LIBC_NT_NTDLL \ + LIBC_NT_WS2_32 \ LIBC_RUNTIME \ LIBC_STDIO \ LIBC_STUBS \ - LIBC_NT_KERNELBASE \ - LIBC_NT_KERNEL32 \ - LIBC_NT_NTDLL \ - LIBC_NT_WS2_32 \ - LIBC_NT_MSWSOCK \ - LIBC_NEXGEN32E \ LIBC_SYSV_CALLS \ LIBC_SYSV diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c index 04434b6e..e4c7f989 100644 --- a/libc/stdio/fread.c +++ b/libc/stdio/fread.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/stdio/internal.h" #include "libc/stdio/stdio.h" diff --git a/libc/stdio/stdio.mk b/libc/stdio/stdio.mk index ac5dc334..41591764 100644 --- a/libc/stdio/stdio.mk +++ b/libc/stdio/stdio.mk @@ -29,15 +29,14 @@ LIBC_STDIO_A_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_FMT \ LIBC_MEM \ LIBC_NEXGEN32E \ - LIBC_STUBS \ - LIBC_STR \ + LIBC_NT_KERNELBASE \ LIBC_RAND \ LIBC_RUNTIME \ - LIBC_NT_KERNELBASE \ + LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV \ LIBC_SYSV_CALLS diff --git a/libc/str/strcmp8to16i.internal.h b/libc/str/strcmp8to16i.internal.h index 8c27f3fe..7841377c 100644 --- a/libc/str/strcmp8to16i.internal.h +++ b/libc/str/strcmp8to16i.internal.h @@ -1,6 +1,6 @@ #ifndef COSMOPOLITAN_LIBC_STR_STRCMP8TO16I_H_ #define COSMOPOLITAN_LIBC_STR_STRCMP8TO16I_H_ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/str/oldutf16.internal.h" #include "libc/str/str.h" diff --git a/libc/str/tprecode16to8.c b/libc/str/tprecode16to8.c index f9c1d519..99d429b7 100644 --- a/libc/str/tprecode16to8.c +++ b/libc/str/tprecode16to8.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/intrin/packsswb.h" #include "libc/intrin/pandn.h" #include "libc/intrin/pcmpgtw.h" diff --git a/libc/str/wcsrtombs.c b/libc/str/wcsrtombs.c index 251ad054..7fbfc083 100644 --- a/libc/str/wcsrtombs.c +++ b/libc/str/wcsrtombs.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/str/str.h" #include "libc/str/tpencode.internal.h" diff --git a/libc/time/strptime.c b/libc/time/strptime.c index e256c6b7..a3ff98e8 100644 --- a/libc/time/strptime.c +++ b/libc/time/strptime.c @@ -25,7 +25,7 @@ │ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ │ │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/str/str.h" #include "libc/time/struct/tm.h" diff --git a/libc/time/time.mk b/libc/time/time.mk index cd5b0067..52302058 100644 --- a/libc/time/time.mk +++ b/libc/time/time.mk @@ -28,18 +28,17 @@ LIBC_TIME_A_CHECKS = \ $(LIBC_TIME_A_HDRS:%=o/$(MODE)/%.ok) LIBC_TIME_A_DIRECTDEPS = \ + LIBC_CALLS \ LIBC_FMT \ LIBC_MEM \ - LIBC_STR \ - LIBC_CONV \ - LIBC_STUBS \ - LIBC_CALLS \ - LIBC_RUNTIME \ LIBC_NEXGEN32E \ - LIBC_NT_NTDLL \ LIBC_NT_KERNELBASE \ - LIBC_SYSV_CALLS \ + LIBC_NT_NTDLL \ + LIBC_RUNTIME \ + LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV \ + LIBC_SYSV_CALLS \ LIBC_ZIPOS LIBC_TIME_A_DEPS := \ diff --git a/libc/time/times.c b/libc/time/times.c index f065d605..7874ded3 100644 --- a/libc/time/times.c +++ b/libc/time/times.c @@ -22,8 +22,8 @@ #include "libc/calls/struct/rusage.h" #include "libc/calls/struct/timeval.h" #include "libc/calls/struct/tms.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/nt/accounting.h" #include "libc/nt/runtime.h" #include "libc/runtime/sysconf.h" diff --git a/net/http/http.mk b/net/http/http.mk index 50c58f83..d812de99 100644 --- a/net/http/http.mk +++ b/net/http/http.mk @@ -30,7 +30,6 @@ NET_HTTP_A_CHECKS = \ NET_HTTP_A_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ LIBC_LOG \ LIBC_LOG_ASAN \ diff --git a/test/libc/conv/test.mk b/test/libc/conv/test.mk deleted file mode 100644 index 2c33c862..00000000 --- a/test/libc/conv/test.mk +++ /dev/null @@ -1,64 +0,0 @@ -#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐ -#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘ - -PKGS += TEST_LIBC_CONV - -TEST_LIBC_CONV_SRCS := $(wildcard test/libc/conv/*.c) -TEST_LIBC_CONV_SRCS_TEST = $(filter %_test.c,$(TEST_LIBC_CONV_SRCS)) - -TEST_LIBC_CONV_OBJS = \ - $(TEST_LIBC_CONV_SRCS:%=o/$(MODE)/%.zip.o) \ - $(TEST_LIBC_CONV_SRCS:%.c=o/$(MODE)/%.o) - -TEST_LIBC_CONV_COMS = \ - $(TEST_LIBC_CONV_SRCS:%.c=o/$(MODE)/%.com) - -TEST_LIBC_CONV_BINS = \ - $(TEST_LIBC_CONV_COMS) \ - $(TEST_LIBC_CONV_COMS:%=%.dbg) - -TEST_LIBC_CONV_TESTS = \ - $(TEST_LIBC_CONV_SRCS_TEST:%.c=o/$(MODE)/%.com.ok) - -TEST_LIBC_CONV_CHECKS = \ - $(TEST_LIBC_CONV_SRCS_TEST:%.c=o/$(MODE)/%.com.runs) - -TEST_LIBC_CONV_DIRECTDEPS = \ - LIBC_CONV \ - LIBC_FMT \ - LIBC_LOG \ - LIBC_MEM \ - LIBC_STDIO \ - LIBC_NEXGEN32E \ - LIBC_STUBS \ - LIBC_TINYMATH \ - LIBC_RUNTIME \ - LIBC_X \ - LIBC_TESTLIB - -TEST_LIBC_CONV_DEPS := \ - $(call uniq,$(foreach x,$(TEST_LIBC_CONV_DIRECTDEPS),$($(x)))) - -o/$(MODE)/test/libc/conv/conv.pkg: \ - $(TEST_LIBC_CONV_OBJS) \ - $(foreach x,$(TEST_LIBC_CONV_DIRECTDEPS),$($(x)_A).pkg) - -o/$(MODE)/test/libc/conv/%.com.dbg: \ - $(TEST_LIBC_CONV_DEPS) \ - o/$(MODE)/test/libc/conv/%.o \ - o/$(MODE)/test/libc/conv/conv.pkg \ - $(LIBC_TESTMAIN) \ - $(CRT) \ - $(APE) - @$(APELINK) - -$(TEST_LIBC_CONV_OBJS): test/libc/conv/test.mk - -$(TEST_LIBC_CONV_OBJS): \ - DEFAULT_CCFLAGS += \ - -fno-builtin - -.PHONY: o/$(MODE)/test/libc/conv -o/$(MODE)/test/libc/conv: \ - $(TEST_LIBC_CONV_BINS) \ - $(TEST_LIBC_CONV_CHECKS) diff --git a/test/libc/conv/basename_test.c b/test/libc/fmt/basename_test.c similarity index 99% rename from test/libc/conv/basename_test.c rename to test/libc/fmt/basename_test.c index 9356e26e..f6310697 100644 --- a/test/libc/conv/basename_test.c +++ b/test/libc/fmt/basename_test.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/conv/itoa64radix10_test.c b/test/libc/fmt/itoa64radix10_test.c similarity index 98% rename from test/libc/conv/itoa64radix10_test.c rename to test/libc/fmt/itoa64radix10_test.c index abfb167f..613af65c 100644 --- a/test/libc/conv/itoa64radix10_test.c +++ b/test/libc/fmt/itoa64radix10_test.c @@ -17,8 +17,8 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/conv/itoa64radix16_test.c b/test/libc/fmt/itoa64radix16_test.c similarity index 98% rename from test/libc/conv/itoa64radix16_test.c rename to test/libc/fmt/itoa64radix16_test.c index 046fa1dd..0609e573 100644 --- a/test/libc/conv/itoa64radix16_test.c +++ b/test/libc/fmt/itoa64radix16_test.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/testlib/testlib.h" TEST(itoa64radix16, test) { diff --git a/test/libc/conv/llog10_test.c b/test/libc/fmt/llog10_test.c similarity index 98% rename from test/libc/conv/llog10_test.c rename to test/libc/fmt/llog10_test.c index 5cd3e832..38af799f 100644 --- a/test/libc/conv/llog10_test.c +++ b/test/libc/fmt/llog10_test.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/fmt/palandprintf_test.c b/test/libc/fmt/palandprintf_test.c index f937b5f0..ba28931b 100644 --- a/test/libc/fmt/palandprintf_test.c +++ b/test/libc/fmt/palandprintf_test.c @@ -27,9 +27,9 @@ #include "libc/bits/progn.internal.h" #include "libc/bits/pushpop.h" #include "libc/bits/safemacros.internal.h" -#include "libc/conv/itoa.h" #include "libc/errno.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" #include "libc/math.h" #include "libc/mem/mem.h" diff --git a/test/libc/conv/strtoimax_test.c b/test/libc/fmt/strtoimax_test.c similarity index 99% rename from test/libc/conv/strtoimax_test.c rename to test/libc/fmt/strtoimax_test.c index 8afb4122..3b27660e 100644 --- a/test/libc/conv/strtoimax_test.c +++ b/test/libc/fmt/strtoimax_test.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/testlib/testlib.h" TEST(strtoimax, testZero) { diff --git a/test/libc/conv/strtoumax_test.c b/test/libc/fmt/strtoumax_test.c similarity index 86% rename from test/libc/conv/strtoumax_test.c rename to test/libc/fmt/strtoumax_test.c index c8824b44..c15be769 100644 --- a/test/libc/conv/strtoumax_test.c +++ b/test/libc/fmt/strtoumax_test.c @@ -18,14 +18,22 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/testlib/testlib.h" -TEST(strtoumax, testZero) { EXPECT_EQ(UINTMAX_MIN, strtoumax("0", NULL, 0)); } -TEST(strtoumax, testDecimal) { EXPECT_EQ(123, strtoumax("123", NULL, 0)); } -TEST(strtoumax, testHex) { EXPECT_EQ(255, strtoumax("0xff", NULL, 0)); } -TEST(strtoumax, testOctal) { EXPECT_EQ(123, strtoumax("0173", NULL, 0)); } +TEST(strtoumax, testZero) { + EXPECT_EQ(UINTMAX_MIN, strtoumax("0", NULL, 0)); +} +TEST(strtoumax, testDecimal) { + EXPECT_EQ(123, strtoumax("123", NULL, 0)); +} +TEST(strtoumax, testHex) { + EXPECT_EQ(255, strtoumax("0xff", NULL, 0)); +} +TEST(strtoumax, testOctal) { + EXPECT_EQ(123, strtoumax("0173", NULL, 0)); +} TEST(strtoumax, testMaximum) { EXPECT_EQ(UINTMAX_MAX, diff --git a/test/libc/fmt/test.mk b/test/libc/fmt/test.mk index b72b6aa0..32f67af0 100644 --- a/test/libc/fmt/test.mk +++ b/test/libc/fmt/test.mk @@ -21,7 +21,6 @@ TEST_LIBC_FMT_CHECKS = \ TEST_LIBC_FMT_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_FMT \ LIBC_MEM \ LIBC_NEXGEN32E \ @@ -55,6 +54,10 @@ o/$(MODE)/test/libc/fmt/%.com.dbg: \ $(TEST_LIBC_FMT_OBJS): test/libc/fmt/test.mk +$(TEST_LIBC_FMT_OBJS): \ + DEFAULT_CCFLAGS += \ + -fno-builtin + .PHONY: o/$(MODE)/test/libc/fmt o/$(MODE)/test/libc/fmt: \ $(TEST_LIBC_FMT_BINS) \ diff --git a/test/libc/conv/timevaltofiletime_test.c b/test/libc/fmt/timevaltofiletime_test.c similarity index 98% rename from test/libc/conv/timevaltofiletime_test.c rename to test/libc/fmt/timevaltofiletime_test.c index 3f39801d..e32cf764 100644 --- a/test/libc/conv/timevaltofiletime_test.c +++ b/test/libc/fmt/timevaltofiletime_test.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/timeval.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/filetime.h" #include "libc/testlib/testlib.h" #include "libc/time/time.h" diff --git a/test/libc/test.mk b/test/libc/test.mk index b3f35b00..f49196d1 100644 --- a/test/libc/test.mk +++ b/test/libc/test.mk @@ -6,7 +6,6 @@ o/$(MODE)/test/libc: \ o/$(MODE)/test/libc/alg \ o/$(MODE)/test/libc/bits \ o/$(MODE)/test/libc/calls \ - o/$(MODE)/test/libc/conv \ o/$(MODE)/test/libc/crypto \ o/$(MODE)/test/libc/dns \ o/$(MODE)/test/libc/fmt \ diff --git a/test/libc/time/clock_gettime_test.c b/test/libc/time/clock_gettime_test.c index 317d14ca..b80fbcae 100644 --- a/test/libc/time/clock_gettime_test.c +++ b/test/libc/time/clock_gettime_test.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/timespec.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/runtime/gc.h" #include "libc/stdio/stdio.h" diff --git a/third_party/chibicc/chibicc.h b/third_party/chibicc/chibicc.h index ba1ddb9d..4cb5bff1 100644 --- a/third_party/chibicc/chibicc.h +++ b/third_party/chibicc/chibicc.h @@ -5,10 +5,10 @@ #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" #include "libc/calls/weirdtypes.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/log/log.h" diff --git a/third_party/chibicc/chibicc.mk b/third_party/chibicc/chibicc.mk index 05e5f37a..9ec07c1b 100644 --- a/third_party/chibicc/chibicc.mk +++ b/third_party/chibicc/chibicc.mk @@ -42,7 +42,6 @@ THIRD_PARTY_CHIBICC_A_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_FMT \ LIBC_LOG \ LIBC_MEM \ diff --git a/third_party/chibicc/preprocess.c b/third_party/chibicc/preprocess.c index 89fc4f5a..4910d2d6 100644 --- a/third_party/chibicc/preprocess.c +++ b/third_party/chibicc/preprocess.c @@ -1301,18 +1301,6 @@ static void join_adjacent_string_literals(Token *tok) { tok1 = tok1->next; continue; } -#if 0 - assert(tok1->ty->base->size == tok2->ty->base->size); - Token *t = copy_token(tok1); - t->ty = - array_of(tok1->ty->base, tok1->ty->array_len + tok2->ty->array_len - 1); - t->str = calloc(1, t->ty->size); - t->next = tok2->next; - memcpy(mempcpy(t->str, tok1->str, tok1->ty->size - tok1->ty->base->size), - tok2->str, tok2->ty->size); - t->len = strlen(t->loc); - *tok1 = *t; -#else Token *tok2 = tok1->next; while (tok2->kind == TK_STR) tok2 = tok2->next; int len = tok1->ty->array_len; @@ -1330,7 +1318,6 @@ static void join_adjacent_string_literals(Token *tok) { tok1->str = buf; tok1->next = tok2; tok1 = tok2; -#endif } } diff --git a/third_party/ctags/ctags.mk b/third_party/ctags/ctags.mk index e4ead4cd..757236db 100644 --- a/third_party/ctags/ctags.mk +++ b/third_party/ctags/ctags.mk @@ -15,17 +15,16 @@ THIRD_PARTY_CTAGS_CHECKS = \ THIRD_PARTY_CTAGS_DIRECTDEPS = \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ - LIBC_RUNTIME \ - LIBC_MEM \ LIBC_FMT \ LIBC_LOG \ - LIBC_TIME \ - LIBC_SYSV \ + LIBC_MEM \ + LIBC_NEXGEN32E \ + LIBC_RUNTIME \ + LIBC_STDIO \ LIBC_STR \ LIBC_STUBS \ - LIBC_STDIO \ - LIBC_NEXGEN32E \ + LIBC_SYSV \ + LIBC_TIME \ LIBC_UNICODE \ THIRD_PARTY_MUSL \ THIRD_PARTY_REGEX diff --git a/third_party/ctags/eiffel.c b/third_party/ctags/eiffel.c index 135d214e..df71f058 100644 --- a/third_party/ctags/eiffel.c +++ b/third_party/ctags/eiffel.c @@ -12,7 +12,7 @@ #include "third_party/ctags/general.h" /* must always come first */ #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "third_party/ctags/debug.h" diff --git a/third_party/ctags/readtags.c b/third_party/ctags/readtags.c index 646a51b5..b791cc20 100644 --- a/third_party/ctags/readtags.c +++ b/third_party/ctags/readtags.c @@ -9,8 +9,8 @@ */ #include "libc/calls/calls.h" #include "libc/calls/weirdtypes.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/mem/mem.h" #include "libc/stdio/stdio.h" diff --git a/third_party/dlmalloc/dlmalloc.c b/third_party/dlmalloc/dlmalloc.c index d5aa10d9..7a1085b2 100644 --- a/third_party/dlmalloc/dlmalloc.c +++ b/third_party/dlmalloc/dlmalloc.c @@ -2,8 +2,8 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/internal.h" #include "libc/calls/struct/sysinfo.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/macros.h" #include "libc/mem/mem.h" diff --git a/third_party/dlmalloc/dlmalloc.mk b/third_party/dlmalloc/dlmalloc.mk index be00d331..95bb7b0b 100644 --- a/third_party/dlmalloc/dlmalloc.mk +++ b/third_party/dlmalloc/dlmalloc.mk @@ -27,7 +27,6 @@ THIRD_PARTY_DLMALLOC_A_CHECKS = \ THIRD_PARTY_DLMALLOC_A_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ diff --git a/third_party/dlmalloc/mtrace.c b/third_party/dlmalloc/mtrace.c index f1ed4543..84377ab1 100644 --- a/third_party/dlmalloc/mtrace.c +++ b/third_party/dlmalloc/mtrace.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "third_party/dlmalloc/dlmalloc.internal.h" diff --git a/third_party/duktape/duk_config.h b/third_party/duktape/duk_config.h index 39323b46..27ce9553 100644 --- a/third_party/duktape/duk_config.h +++ b/third_party/duktape/duk_config.h @@ -44,8 +44,8 @@ #include "libc/calls/termios.h" #include "libc/calls/typedef/sighandler_t.h" #include "libc/calls/weirdtypes.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/inttypes.h" #include "libc/limits.h" diff --git a/third_party/f2c/f2c.mk b/third_party/f2c/f2c.mk index 6fccab6e..3e7653c9 100644 --- a/third_party/f2c/f2c.mk +++ b/third_party/f2c/f2c.mk @@ -22,16 +22,15 @@ THIRD_PARTY_F2C_A_CHECKS = \ $(THIRD_PARTY_F2C_A_HDRS:%=o/$(MODE)/%.ok) THIRD_PARTY_F2C_A_DIRECTDEPS = \ - LIBC_CONV \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_RUNTIME \ - LIBC_MEM \ LIBC_FMT \ + LIBC_MEM \ + LIBC_NEXGEN32E \ + LIBC_RUNTIME \ + LIBC_STDIO \ LIBC_STR \ LIBC_STUBS \ - LIBC_STDIO \ - LIBC_NEXGEN32E \ LIBC_UNICODE THIRD_PARTY_F2C_A_DEPS := \ diff --git a/third_party/f2c/wref.c b/third_party/f2c/wref.c index 47f947b6..4feafe2e 100644 --- a/third_party/f2c/wref.c +++ b/third_party/f2c/wref.c @@ -1,4 +1,4 @@ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/str/str.h" #include "third_party/f2c/fmt.h" diff --git a/third_party/lemon/lemon.c b/third_party/lemon/lemon.c index be981a99..61a0e9b3 100644 --- a/third_party/lemon/lemon.c +++ b/third_party/lemon/lemon.c @@ -10,7 +10,7 @@ #include "libc/alg/alg.h" #include "libc/assert.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/mem/mem.h" #include "libc/runtime/gc.h" diff --git a/third_party/lemon/lemon.mk b/third_party/lemon/lemon.mk index e276e9b6..3b987400 100644 --- a/third_party/lemon/lemon.mk +++ b/third_party/lemon/lemon.mk @@ -22,7 +22,6 @@ THIRD_PARTY_LEMON_LINK = \ THIRD_PARTY_LEMON_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ LIBC_MEM \ LIBC_NEXGEN32E \ diff --git a/third_party/lex/buf.c b/third_party/lex/buf.c index 96b0afa2..c2ed76c8 100644 --- a/third_party/lex/buf.c +++ b/third_party/lex/buf.c @@ -42,7 +42,7 @@ #include "libc/mem/mem.h" #include "libc/fmt/fmt.h" #include "libc/math.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "flexdef.h" /* Take note: The buffer object is sometimes used as a String buffer (one diff --git a/third_party/lex/lex.mk b/third_party/lex/lex.mk index 50467f6e..ad1127ac 100644 --- a/third_party/lex/lex.mk +++ b/third_party/lex/lex.mk @@ -60,7 +60,6 @@ THIRD_PARTY_LEX_DIRECTDEPS = \ LIBC_ALG \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_FMT \ LIBC_LOG \ LIBC_MATH \ diff --git a/third_party/lex/main.c b/third_party/lex/main.c index 5b19a657..dc518540 100644 --- a/third_party/lex/main.c +++ b/third_party/lex/main.c @@ -50,7 +50,7 @@ asm(".include \"third_party/lex/COPYING\""); #include "libc/str/str.h" #include "libc/mem/mem.h" #include "libc/math.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/runtime/gc.h" #include "libc/x/x.h" diff --git a/third_party/lex/regex.c b/third_party/lex/regex.c index 0dacf585..018f482c 100644 --- a/third_party/lex/regex.c +++ b/third_party/lex/regex.c @@ -31,7 +31,7 @@ #include "libc/str/str.h" #include "libc/mem/mem.h" #include "libc/fmt/fmt.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "flexdef.h" diff --git a/third_party/lex/scanopt.c b/third_party/lex/scanopt.c index 5e3e6c9a..74429fee 100644 --- a/third_party/lex/scanopt.c +++ b/third_party/lex/scanopt.c @@ -39,7 +39,7 @@ #include "flexdef.h" #include "libc/str/str.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/str/str.h" diff --git a/third_party/lex/tables.c b/third_party/lex/tables.c index 11d3e985..24ea272f 100644 --- a/third_party/lex/tables.c +++ b/third_party/lex/tables.c @@ -1,7 +1,7 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ │vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi│ └─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/sock/sock.h" #include "libc/str/str.h" diff --git a/third_party/m4/eval.c b/third_party/m4/eval.c index 595f6dc6..497bb139 100644 --- a/third_party/m4/eval.c +++ b/third_party/m4/eval.c @@ -41,7 +41,7 @@ */ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/errno.h" #include "libc/limits.h" #include "libc/log/bsd.h" diff --git a/third_party/m4/gnum4.c b/third_party/m4/gnum4.c index 4c109d0a..f3281455 100644 --- a/third_party/m4/gnum4.c +++ b/third_party/m4/gnum4.c @@ -38,7 +38,7 @@ #include "libc/fmt/fmt.h" #include "libc/log/bsd.h" #include "libc/limits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/calls/weirdtypes.h" #include "libc/calls/calls.h" #include "libc/errno.h" diff --git a/third_party/m4/tokenizer.c b/third_party/m4/tokenizer.c index af952738..3c635700 100644 --- a/third_party/m4/tokenizer.c +++ b/third_party/m4/tokenizer.c @@ -1,4 +1,4 @@ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" diff --git a/third_party/stb/stb.mk b/third_party/stb/stb.mk index 3e57334e..62f10c6e 100644 --- a/third_party/stb/stb.mk +++ b/third_party/stb/stb.mk @@ -28,18 +28,17 @@ THIRD_PARTY_STB_A_OBJS = \ THIRD_PARTY_STB_A_DIRECTDEPS = \ DSP_CORE \ LIBC_ALG \ - LIBC_FMT \ - LIBC_STDIO \ LIBC_BITS \ - LIBC_CONV \ + LIBC_FMT \ + LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ - LIBC_TINYMATH \ LIBC_RUNTIME \ + LIBC_STDIO \ LIBC_STR \ - LIBC_LOG \ - LIBC_X \ LIBC_STUBS \ + LIBC_TINYMATH \ + LIBC_X \ THIRD_PARTY_ZLIB THIRD_PARTY_STB_A_DEPS := \ diff --git a/third_party/stb/stb_image.c b/third_party/stb/stb_image.c index ff3b1eca..8996afe0 100644 --- a/third_party/stb/stb_image.c +++ b/third_party/stb/stb_image.c @@ -20,7 +20,7 @@ #include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/log/gdb.h" #include "libc/log/log.h" diff --git a/third_party/stb/stb_image_write.c b/third_party/stb/stb_image_write.c index 41217c01..8bc167ae 100644 --- a/third_party/stb/stb_image_write.c +++ b/third_party/stb/stb_image_write.c @@ -120,7 +120,7 @@ */ #include "dsp/core/core.h" #include "libc/assert.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/limits.h" #include "libc/macros.h" diff --git a/third_party/stb/stb_image_write_png.c b/third_party/stb/stb_image_write_png.c index 10c7cc15..b327d158 100644 --- a/third_party/stb/stb_image_write_png.c +++ b/third_party/stb/stb_image_write_png.c @@ -119,7 +119,7 @@ * Public Domain (www.unlicense.org) */ #include "libc/assert.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/mem/mem.h" #include "libc/stdio/stdio.h" diff --git a/third_party/stb/stb_vorbis.c b/third_party/stb/stb_vorbis.c index bf99d198..8f1d20e5 100644 --- a/third_party/stb/stb_vorbis.c +++ b/third_party/stb/stb_vorbis.c @@ -36,7 +36,7 @@ #include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/math.h" #include "libc/mem/alloca.h" diff --git a/tool/build/ar.c b/tool/build/ar.c index 7261f702..086adf99 100644 --- a/tool/build/ar.c +++ b/tool/build/ar.c @@ -22,11 +22,10 @@ #include "libc/calls/calls.h" #include "libc/calls/struct/iovec.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/elf/def.h" #include "libc/elf/elf.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/macros.h" #include "libc/runtime/runtime.h" diff --git a/tool/build/blinkenlights.c b/tool/build/blinkenlights.c index 0529b773..a9d6f27b 100644 --- a/tool/build/blinkenlights.c +++ b/tool/build/blinkenlights.c @@ -31,11 +31,10 @@ #include "libc/calls/struct/termios.h" #include "libc/calls/struct/winsize.h" #include "libc/calls/termios.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/errno.h" #include "libc/fmt/bing.internal.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/intrin/pcmpeqb.h" #include "libc/intrin/pmovmskb.h" #include "libc/log/check.h" diff --git a/tool/build/build.mk b/tool/build/build.mk index cc3f0434..b90590be 100644 --- a/tool/build/build.mk +++ b/tool/build/build.mk @@ -30,36 +30,35 @@ TOOL_BUILD_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_DNS \ LIBC_ELF \ LIBC_FMT \ LIBC_INTRIN \ LIBC_LOG \ LIBC_LOG_ASAN \ - LIBC_TINYMATH \ LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_NT_KERNELBASE \ LIBC_NT_USER32 \ + LIBC_RAND \ LIBC_RUNTIME \ LIBC_SOCK \ LIBC_STDIO \ LIBC_STR \ - LIBC_RAND \ LIBC_STUBS \ LIBC_SYSV \ LIBC_SYSV_CALLS \ LIBC_TESTLIB \ LIBC_TIME \ + LIBC_TINYMATH \ LIBC_UNICODE \ LIBC_X \ - TOOL_BUILD_LIB \ THIRD_PARTY_COMPILER_RT \ THIRD_PARTY_GDTOA \ THIRD_PARTY_GETOPT \ THIRD_PARTY_XED \ THIRD_PARTY_ZLIB \ + TOOL_BUILD_LIB \ THIRD_PARTY_STB TOOL_BUILD_DEPS := \ diff --git a/tool/build/calculator.c b/tool/build/calculator.c index 6d01e167..8220803c 100644 --- a/tool/build/calculator.c +++ b/tool/build/calculator.c @@ -14,10 +14,9 @@ #include "libc/bits/morton.h" #include "libc/bits/popcnt.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" #include "libc/log/color.internal.h" #include "libc/log/log.h" diff --git a/tool/build/helpop.c b/tool/build/helpop.c index 3196d415..bcbe2c51 100644 --- a/tool/build/helpop.c +++ b/tool/build/helpop.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" diff --git a/tool/build/lib/buildlib.mk b/tool/build/lib/buildlib.mk index e6e41b53..f327f54d 100644 --- a/tool/build/lib/buildlib.mk +++ b/tool/build/lib/buildlib.mk @@ -27,27 +27,26 @@ TOOL_BUILD_LIB_A_OBJS = \ TOOL_BUILD_LIB_A_DIRECTDEPS = \ LIBC_ALG \ LIBC_BITS \ - LIBC_CONV \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ LIBC_ELF \ LIBC_FMT \ + LIBC_INTRIN \ + LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ + LIBC_RAND \ LIBC_RUNTIME \ + LIBC_SOCK \ + LIBC_STDIO \ + LIBC_STR \ LIBC_STUBS \ - LIBC_INTRIN \ LIBC_SYSV \ LIBC_SYSV_CALLS \ LIBC_TIME \ - LIBC_LOG \ - LIBC_RAND \ - LIBC_STR \ - LIBC_SOCK \ - LIBC_UNICODE \ - LIBC_STDIO \ - LIBC_X \ LIBC_TINYMATH \ + LIBC_UNICODE \ + LIBC_X \ THIRD_PARTY_COMPILER_RT \ THIRD_PARTY_XED diff --git a/tool/build/lib/cga.c b/tool/build/lib/cga.c index 1ce8ad9c..cfee6960 100644 --- a/tool/build/lib/cga.c +++ b/tool/build/lib/cga.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/macros.h" #include "libc/str/str.h" #include "tool/build/lib/buffer.h" diff --git a/tool/build/lib/dis.c b/tool/build/lib/dis.c index 6d9b2304..b042ce0e 100644 --- a/tool/build/lib/dis.c +++ b/tool/build/lib/dis.c @@ -20,9 +20,9 @@ #include "libc/alg/alg.h" #include "libc/alg/arraylist2.internal.h" #include "libc/bits/safemacros.internal.h" -#include "libc/conv/itoa.h" #include "libc/fmt/bing.internal.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/build/lib/disarg.c b/tool/build/lib/disarg.c index e556e1c4..0afc94ed 100644 --- a/tool/build/lib/disarg.c +++ b/tool/build/lib/disarg.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/bits/bits.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/macros.h" diff --git a/tool/build/lib/high.c b/tool/build/lib/high.c index a505f127..012548d1 100644 --- a/tool/build/lib/high.c +++ b/tool/build/lib/high.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/str/str.h" #include "tool/build/lib/high.h" diff --git a/tool/build/lib/panel.c b/tool/build/lib/panel.c index a32da7ce..c91f7912 100644 --- a/tool/build/lib/panel.c +++ b/tool/build/lib/panel.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/str/tpdecode.internal.h" diff --git a/tool/build/lib/pty.c b/tool/build/lib/pty.c index b4022ca1..bc95632d 100644 --- a/tool/build/lib/pty.c +++ b/tool/build/lib/pty.c @@ -21,8 +21,8 @@ #include "libc/assert.h" #include "libc/bits/bits.h" #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/build/lz4toasm.c b/tool/build/lz4toasm.c index 3f599ec8..aedce0be 100644 --- a/tool/build/lz4toasm.c +++ b/tool/build/lz4toasm.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/build/package.c b/tool/build/package.c index 97e4a30a..8d1b99f8 100644 --- a/tool/build/package.c +++ b/tool/build/package.c @@ -26,11 +26,11 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" #include "libc/elf/def.h" #include "libc/elf/elf.h" #include "libc/elf/struct/rela.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/build/rollup.c b/tool/build/rollup.c index 18d11030..3d96a3ac 100644 --- a/tool/build/rollup.c +++ b/tool/build/rollup.c @@ -21,7 +21,7 @@ #include "libc/alg/arraylist2.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/mem/mem.h" diff --git a/tool/build/runit.c b/tool/build/runit.c index 796e3bca..cc2b8cf8 100644 --- a/tool/build/runit.c +++ b/tool/build/runit.c @@ -25,10 +25,10 @@ #include "libc/calls/struct/itimerval.h" #include "libc/calls/struct/sigaction.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" #include "libc/dce.h" #include "libc/dns/dns.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/limits.h" #include "libc/log/check.h" diff --git a/tool/build/runitd.c b/tool/build/runitd.c index 48f2694d..08b64530 100644 --- a/tool/build/runitd.c +++ b/tool/build/runitd.c @@ -23,9 +23,9 @@ #include "libc/calls/hefty/spawn.h" #include "libc/calls/struct/sigaction.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" #include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/log/check.h" #include "libc/log/log.h" diff --git a/tool/calc/calc.c b/tool/calc/calc.c index 37fd2c73..4b1e44f2 100644 --- a/tool/calc/calc.c +++ b/tool/calc/calc.c @@ -21,8 +21,8 @@ #include "libc/bits/bswap.h" #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/log/log.h" #include "libc/macros.h" #include "libc/math.h" diff --git a/tool/calc/calc.mk b/tool/calc/calc.mk index 43f5bc86..68239430 100644 --- a/tool/calc/calc.mk +++ b/tool/calc/calc.mk @@ -27,16 +27,15 @@ TOOL_CALC_CHECKS = \ TOOL_CALC_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ - LIBC_LOG \ LIBC_FMT \ + LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_RAND \ LIBC_RUNTIME \ LIBC_STDIO \ - LIBC_STUBS \ LIBC_STR \ + LIBC_STUBS \ LIBC_SYSV \ LIBC_TINYMATH \ LIBC_X \ diff --git a/tool/decode/ar.c b/tool/decode/ar.c index 1296ca6b..72840c61 100644 --- a/tool/decode/ar.c +++ b/tool/decode/ar.c @@ -20,7 +20,7 @@ #include "libc/bits/bits.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/mem/mem.h" diff --git a/tool/decode/decode.mk b/tool/decode/decode.mk index d3224019..6de5ccda 100644 --- a/tool/decode/decode.mk +++ b/tool/decode/decode.mk @@ -23,14 +23,12 @@ TOOL_DECODE_CHECKS = \ TOOL_DECODE_DIRECTDEPS = \ LIBC_CALLS \ - LIBC_CONV \ LIBC_ELF \ LIBC_FMT \ LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_RAND \ - LIBC_TIME \ LIBC_RUNTIME \ LIBC_RUNTIME \ LIBC_STDIO \ @@ -38,11 +36,12 @@ TOOL_DECODE_DIRECTDEPS = \ LIBC_STUBS \ LIBC_SYSV \ LIBC_SYSV_CALLS \ + LIBC_TIME \ LIBC_UNICODE \ LIBC_X \ - TOOL_DECODE_LIB \ THIRD_PARTY_GDTOA \ THIRD_PARTY_GETOPT \ + TOOL_DECODE_LIB \ THIRD_PARTY_XED TOOL_DECODE_DEPS := \ diff --git a/tool/decode/elf.c b/tool/decode/elf.c index 5127b8ef..866244f6 100644 --- a/tool/decode/elf.c +++ b/tool/decode/elf.c @@ -20,11 +20,11 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" #include "libc/elf/elf.h" #include "libc/elf/struct/rela.h" #include "libc/elf/struct/shdr.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/stdio/stdio.h" diff --git a/tool/decode/macho.c b/tool/decode/macho.c index a4e5b0da..86053849 100644 --- a/tool/decode/macho.c +++ b/tool/decode/macho.c @@ -21,7 +21,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macho.internal.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" diff --git a/tool/decode/mkcombos.c b/tool/decode/mkcombos.c index 654328ae..207263df 100644 --- a/tool/decode/mkcombos.c +++ b/tool/decode/mkcombos.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" diff --git a/tool/decode/pe2.c b/tool/decode/pe2.c index bde7bd53..4ac98671 100644 --- a/tool/decode/pe2.c +++ b/tool/decode/pe2.c @@ -20,7 +20,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/nt/struct/imagedosheader.internal.h" #include "libc/nt/struct/imagentheaders.internal.h" #include "libc/nt/struct/imageoptionalheader.internal.h" diff --git a/tool/decode/zip.c b/tool/decode/zip.c index 0721b79f..0e18a8aa 100644 --- a/tool/decode/zip.c +++ b/tool/decode/zip.c @@ -21,7 +21,7 @@ #include "libc/bits/safemacros.internal.h" #include "libc/calls/calls.h" #include "libc/calls/struct/stat.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/mem/mem.h" #include "libc/nexgen32e/crc32.h" diff --git a/tool/hash/crctab.c b/tool/hash/crctab.c index bcc18cf1..d627b77c 100644 --- a/tool/hash/crctab.c +++ b/tool/hash/crctab.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/macros.h" #include "libc/nexgen32e/crc32.h" #include "libc/runtime/runtime.h" diff --git a/tool/hash/hash.mk b/tool/hash/hash.mk index 25ddbbda..0fffe792 100644 --- a/tool/hash/hash.mk +++ b/tool/hash/hash.mk @@ -17,11 +17,10 @@ TOOL_HASH_BINS = \ $(TOOL_HASH_COMS:%=%.dbg) TOOL_HASH_DIRECTDEPS = \ - LIBC_CONV \ - LIBC_STR \ LIBC_FMT \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ + LIBC_STR \ LIBC_STUBS \ LIBC_STDIO diff --git a/tool/net/greenbean.c b/tool/net/greenbean.c index 52f5370d..dcc97f23 100644 --- a/tool/net/greenbean.c +++ b/tool/net/greenbean.c @@ -26,10 +26,9 @@ #include "libc/calls/struct/itimerval.h" #include "libc/calls/struct/stat.h" #include "libc/calls/weirdtypes.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/net/net.mk b/tool/net/net.mk index 2031ceeb..2947f0dc 100644 --- a/tool/net/net.mk +++ b/tool/net/net.mk @@ -23,14 +23,13 @@ TOOL_NET_DIRECTDEPS = \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_DNS \ - LIBC_RAND \ LIBC_FMT \ LIBC_LOG \ LIBC_LOG_ASAN \ LIBC_MEM \ LIBC_NEXGEN32E \ + LIBC_RAND \ LIBC_RUNTIME \ LIBC_SOCK \ LIBC_STDIO \ diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 2fa774e9..2c539a7b 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -26,10 +26,9 @@ #include "libc/calls/struct/itimerval.h" #include "libc/calls/struct/stat.h" #include "libc/calls/weirdtypes.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/viz/derasterize.c b/tool/viz/derasterize.c index f7aa07d7..1a9a39c6 100644 --- a/tool/viz/derasterize.c +++ b/tool/viz/derasterize.c @@ -24,7 +24,7 @@ #include "libc/calls/ioctl.h" #include "libc/calls/struct/stat.h" #include "libc/calls/termios.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/limits.h" #include "libc/log/check.h" diff --git a/tool/viz/double2int.c b/tool/viz/double2int.c index 29ae3c0d..366a3c8a 100644 --- a/tool/viz/double2int.c +++ b/tool/viz/double2int.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/macros.h" #include "libc/runtime/gc.h" diff --git a/tool/viz/fold.c b/tool/viz/fold.c index d86cb5fc..1607a550 100644 --- a/tool/viz/fold.c +++ b/tool/viz/fold.c @@ -18,8 +18,8 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" diff --git a/tool/viz/generatematrix.c b/tool/viz/generatematrix.c index 77bb2745..bc0649a4 100644 --- a/tool/viz/generatematrix.c +++ b/tool/viz/generatematrix.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/limits.h" #include "libc/log/check.h" diff --git a/tool/viz/int2float.c b/tool/viz/int2float.c index 97eb1b09..5e524bd5 100644 --- a/tool/viz/int2float.c +++ b/tool/viz/int2float.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/macros.h" #include "libc/runtime/gc.h" diff --git a/tool/viz/lib/formatmatrix-double.c b/tool/viz/lib/formatmatrix-double.c index 53e9d600..35b738ae 100644 --- a/tool/viz/lib/formatmatrix-double.c +++ b/tool/viz/lib/formatmatrix-double.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/log/check.h" #include "libc/math.h" #include "libc/mem/mem.h" diff --git a/tool/viz/lib/formatstringtable-assembly.c b/tool/viz/lib/formatstringtable-assembly.c index bba29f7b..7e1c261e 100644 --- a/tool/viz/lib/formatstringtable-assembly.c +++ b/tool/viz/lib/formatstringtable-assembly.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/bits.h" #include "libc/bits/safemacros.internal.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "libc/runtime/gc.h" #include "libc/str/str.h" #include "libc/unicode/unicode.h" diff --git a/tool/viz/lib/formatstringtable-code.c b/tool/viz/lib/formatstringtable-code.c index 271c11ee..9b71a670 100644 --- a/tool/viz/lib/formatstringtable-code.c +++ b/tool/viz/lib/formatstringtable-code.c @@ -18,7 +18,7 @@ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/bits/safemacros.internal.h" -#include "libc/conv/itoa.h" +#include "libc/fmt/itoa.h" #include "tool/viz/lib/formatstringtable.h" void *FormatStringTableAsCode(long yn, long xn, const char *const T[yn][xn], diff --git a/tool/viz/lib/vizlib.mk b/tool/viz/lib/vizlib.mk index 8b6acbda..9d435771 100644 --- a/tool/viz/lib/vizlib.mk +++ b/tool/viz/lib/vizlib.mk @@ -25,27 +25,26 @@ TOOL_VIZ_LIB_A_OBJS = \ $(TOOL_VIZ_LIB_A_SRCS_C:%.c=o/$(MODE)/%.o) TOOL_VIZ_LIB_A_DIRECTDEPS = \ - DSP_TTY \ DSP_CORE \ DSP_SCALE \ - LIBC_INTRIN \ + DSP_TTY \ LIBC_ALG \ LIBC_BITS \ LIBC_CALLS \ - LIBC_CONV \ LIBC_FMT \ - LIBC_SYSV \ - LIBC_UNICODE \ - LIBC_TESTLIB \ + LIBC_INTRIN \ + LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ - LIBC_LOG \ + LIBC_STDIO \ + LIBC_STR \ + LIBC_STUBS \ + LIBC_SYSV \ + LIBC_TESTLIB \ LIBC_TIME \ LIBC_TINYMATH \ - LIBC_STDIO \ - LIBC_STUBS \ - LIBC_STR \ + LIBC_UNICODE \ LIBC_X \ THIRD_PARTY_AVIR \ THIRD_PARTY_GDTOA \ diff --git a/tool/viz/life.c b/tool/viz/life.c index 6dd2cec2..d58704c6 100644 --- a/tool/viz/life.c +++ b/tool/viz/life.c @@ -29,11 +29,10 @@ #include "libc/calls/struct/termios.h" #include "libc/calls/struct/winsize.h" #include "libc/calls/termios.internal.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/viz/memzoom.c b/tool/viz/memzoom.c index 5c0ed4b0..11b92cce 100644 --- a/tool/viz/memzoom.c +++ b/tool/viz/memzoom.c @@ -30,10 +30,9 @@ #include "libc/calls/struct/termios.h" #include "libc/calls/struct/winsize.h" #include "libc/calls/ucontext.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/dce.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" +#include "libc/fmt/itoa.h" #include "libc/log/log.h" #include "libc/macros.h" #include "libc/nexgen32e/bsf.h" diff --git a/tool/viz/od16.c b/tool/viz/od16.c index 7460cb6d..c5233410 100644 --- a/tool/viz/od16.c +++ b/tool/viz/od16.c @@ -17,7 +17,7 @@ │ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │ │ 02110-1301 USA │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" #include "libc/log/check.h" #include "libc/mem/mem.h" diff --git a/tool/viz/printimage.c b/tool/viz/printimage.c index 021e4648..ebbd01b6 100644 --- a/tool/viz/printimage.c +++ b/tool/viz/printimage.c @@ -29,8 +29,8 @@ #include "libc/calls/ioctl.h" #include "libc/calls/struct/stat.h" #include "libc/calls/struct/winsize.h" -#include "libc/conv/conv.h" #include "libc/dce.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/log/log.h" diff --git a/tool/viz/printpixel.c b/tool/viz/printpixel.c index b0cf0588..dbd99d06 100644 --- a/tool/viz/printpixel.c +++ b/tool/viz/printpixel.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "dsp/tty/quant.h" #include "dsp/tty/xtermname.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" diff --git a/tool/viz/printvideo.c b/tool/viz/printvideo.c index 6494ff4b..a7784e3c 100644 --- a/tool/viz/printvideo.c +++ b/tool/viz/printvideo.c @@ -44,12 +44,11 @@ #include "libc/calls/struct/sigset.h" #include "libc/calls/termios.h" #include "libc/calls/ucontext.h" -#include "libc/conv/conv.h" -#include "libc/conv/itoa.h" -#include "libc/dce.h" #include "libc/dns/dns.h" #include "libc/errno.h" +#include "libc/fmt/conv.h" #include "libc/fmt/fmt.h" +#include "libc/fmt/itoa.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/macros.h" diff --git a/tool/viz/tabalign.c b/tool/viz/tabalign.c index 6c33eb1e..68cb0983 100644 --- a/tool/viz/tabalign.c +++ b/tool/viz/tabalign.c @@ -19,7 +19,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/alg/arraylist.internal.h" #include "libc/bits/safemacros.internal.h" -#include "libc/conv/conv.h" +#include "libc/fmt/conv.h" #include "libc/limits.h" #include "libc/log/check.h" #include "libc/log/log.h" diff --git a/tool/viz/viz.mk b/tool/viz/viz.mk index 5f7dc959..7093df7e 100644 --- a/tool/viz/viz.mk +++ b/tool/viz/viz.mk @@ -19,44 +19,43 @@ TOOL_VIZ_BINS = \ TOOL_VIZ_DIRECTDEPS = \ DSP_CORE \ DSP_MPEG \ - DSP_TTY \ DSP_SCALE \ + DSP_TTY \ LIBC_BITS \ LIBC_CALLS \ LIBC_CALLS_HEFTY \ - LIBC_CONV \ LIBC_DNS \ LIBC_FMT \ LIBC_LOG \ LIBC_MEM \ LIBC_NEXGEN32E \ + LIBC_NT_COMDLG32 \ + LIBC_NT_GDI32 \ LIBC_NT_KERNEL32 \ LIBC_NT_KERNELBASE \ LIBC_NT_USER32 \ - LIBC_NT_GDI32 \ - LIBC_NT_COMDLG32 \ + LIBC_RAND \ LIBC_RUNTIME \ - LIBC_TESTLIB \ + LIBC_SOCK \ LIBC_STDIO \ LIBC_STR \ LIBC_STUBS \ - LIBC_SOCK \ LIBC_SYSV \ + LIBC_SYSV_CALLS \ + LIBC_TESTLIB \ LIBC_TIME \ LIBC_TINYMATH \ LIBC_UNICODE \ - LIBC_RAND \ LIBC_X \ - LIBC_SYSV_CALLS \ NET_HTTP \ - TOOL_DECODE_LIB \ - TOOL_VIZ_LIB \ - THIRD_PARTY_GETOPT \ THIRD_PARTY_AVIR \ THIRD_PARTY_DLMALLOC \ THIRD_PARTY_GDTOA \ + THIRD_PARTY_GETOPT \ THIRD_PARTY_STB \ THIRD_PARTY_XED \ + TOOL_DECODE_LIB \ + TOOL_VIZ_LIB \ THIRD_PARTY_ZLIB TOOL_VIZ_DEPS := \