Pay off more technical debt

This makes breaking changes to add underscores to many non-standard
function names provided by the c library. MODE=tiny is now tinier and
we now use smaller locks that are better for tiny apps in this mode.
Some headers have been renamed to be in the same folder as the build
package, so it'll be easier to know which build dependency is needed.
Certain old misguided interfaces have been removed. Intel intrinsics
headers are now listed in libc/isystem (but not in the amalgamation)
to help further improve open source compatibility. Header complexity
has also been reduced. Lastly, more shell scripts are now available.
This commit is contained in:
Justine Tunney 2022-09-12 23:10:38 -07:00
parent b69f3d2488
commit 6f7d0cb1c3
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
960 changed files with 4072 additions and 4873 deletions

View file

@ -20,13 +20,13 @@
#include "libc/fmt/fmt.internal.h"
#include "libc/fmt/internal.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/bsr.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/intrin/tpenc.h"
#include "libc/intrin/weaken.h"
#include "libc/nexgen32e/bsr.h"
#include "libc/str/str.h"
#include "libc/str/strwidth.h"
#include "libc/str/thompike.h"
#include "libc/str/tpenc.h"
#include "libc/str/unicode.h"
#include "libc/str/utf16.h"
@ -40,27 +40,27 @@ static int __fmt_stoa_byte(out_f out, void *a, uint64_t c) {
static int __fmt_stoa_wide(out_f out, void *a, uint64_t w) {
char buf[8];
if (!isascii(w)) w = tpenc(w);
if (!isascii(w)) w = _tpenc(w);
WRITE64LE(buf, w);
return out(buf, a, w ? (bsr(w) >> 3) + 1 : 1);
return out(buf, a, w ? (_bsr(w) >> 3) + 1 : 1);
}
static int __fmt_stoa_bing(out_f out, void *a, uint64_t w) {
char buf[8];
w = tpenc(kCp437[w & 0xFF]);
w = _tpenc(kCp437[w & 0xFF]);
WRITE64LE(buf, w);
return out(buf, a, w ? (bsr(w) >> 3) + 1 : 1);
return out(buf, a, w ? (_bsr(w) >> 3) + 1 : 1);
}
static int __fmt_stoa_quoted(out_f out, void *a, uint64_t w) {
char buf[8];
if (isascii(w)) {
w = cescapec(w);
w = _cescapec(w);
} else {
w = tpenc(w);
w = _tpenc(w);
}
WRITE64LE(buf, w);
return out(buf, a, w ? (bsr(w) >> 3) + 1 : 1);
return out(buf, a, w ? (_bsr(w) >> 3) + 1 : 1);
}
/**
@ -102,7 +102,7 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data,
} else {
emit = __fmt_stoa_wide;
}
} else if ((flags & FLAGS_HASH) && weaken(kCp437)) {
} else if ((flags & FLAGS_HASH) && _weaken(kCp437)) {
justdobytes = true;
emit = __fmt_stoa_bing;
ignorenul = flags & FLAGS_PRECISION;
@ -129,15 +129,15 @@ int __fmt_stoa(int out(const char *, void *, size_t), void *arg, void *data,
if (width) {
w = precision;
if (signbit == 63) {
if (weaken(wcsnwidth)) {
w = weaken(wcsnwidth)((const wchar_t *)p, precision, 0);
if (_weaken(wcsnwidth)) {
w = _weaken(wcsnwidth)((const wchar_t *)p, precision, 0);
}
} else if (signbit == 15) {
if (weaken(strnwidth16)) {
w = weaken(strnwidth16)((const char16_t *)p, precision, 0);
if (_weaken(strnwidth16)) {
w = _weaken(strnwidth16)((const char16_t *)p, precision, 0);
}
} else if (weaken(strnwidth)) {
w = weaken(strnwidth)(p, precision, 0);
} else if (_weaken(strnwidth)) {
w = _weaken(strnwidth)(p, precision, 0);
}
if (!(flags & FLAGS_NOQUOTE) && (flags & FLAGS_REPR)) {
w += 2 + (signbit == 63) + (signbit == 15);