Fold conv package into fmt

Both packages had nearly identical dependency requirements, so merging
them should help reduce the complexity of the build graph.
This commit is contained in:
Justine Tunney 2020-12-09 15:04:54 -08:00
parent 978b7858f9
commit 1fc91f3580
203 changed files with 352 additions and 563 deletions

View file

@ -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"

View file

@ -42,7 +42,6 @@ THIRD_PARTY_CHIBICC_A_DIRECTDEPS = \
LIBC_BITS \
LIBC_CALLS \
LIBC_CALLS_HEFTY \
LIBC_CONV \
LIBC_FMT \
LIBC_LOG \
LIBC_MEM \

View file

@ -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
}
}

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 \

View file

@ -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"

View file

@ -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"

View file

@ -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 := \

View file

@ -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"

View file

@ -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"

View file

@ -22,7 +22,6 @@ THIRD_PARTY_LEMON_LINK = \
THIRD_PARTY_LEMON_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
LIBC_CONV \
LIBC_FMT \
LIBC_MEM \
LIBC_NEXGEN32E \

View file

@ -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

View file

@ -60,7 +60,6 @@ THIRD_PARTY_LEX_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
LIBC_CALLS_HEFTY \
LIBC_CONV \
LIBC_FMT \
LIBC_LOG \
LIBC_MATH \

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 := \

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"