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

@ -17,13 +17,13 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "dsp/core/twixt8.h"
#include "libc/intrin/bsr.h"
#include "libc/log/check.h"
#include "libc/log/log.h"
#include "libc/macros.internal.h"
#include "libc/math.h"
#include "libc/mem/gc.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/bsr.h"
#include "libc/runtime/gc.internal.h"
#include "libc/stdio/stdio.h"
#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
@ -82,16 +82,16 @@ void *BilinearScale(long dcw, long dyw, long dxw,
DCHECK_LE(sxn, sxw);
DCHECK_LE(dyn, dyw);
DCHECK_LE(dxn, dxw);
DCHECK_LT(bsrl(cn) + bsrl(syn) + bsrl(sxn), 32);
DCHECK_LT(bsrl(cn) + bsrl(dyn) + bsrl(dxn), 32);
DCHECK_LT(_bsrl(cn) + _bsrl(syn) + _bsrl(sxn), 32);
DCHECK_LT(_bsrl(cn) + _bsrl(dyn) + _bsrl(dxn), 32);
BilinearScaler(dcw, dyw, dxw, dst, scw, syw, sxw, src, c0, cn, dyn, dxn,
syn, sxn, ry, rx, oy, ox,
gc(xmemalign(64, ROUNDUP(sizeof(int) * (dyn + 1), 64))),
gc(xmemalign(64, ROUNDUP(dyn + 1, 64))),
gc(xmemalign(64, ROUNDUP(sizeof(int) * (dxn + 1), 64))),
gc(xmemalign(64, ROUNDUP(dxn + 1, 64))),
gc(xmemalign(64, ROUNDUP(dxn, 64))),
gc(xmemalign(64, ROUNDUP(sxn, 64) * 2)));
_gc(xmemalign(64, ROUNDUP(sizeof(int) * (dyn + 1), 64))),
_gc(xmemalign(64, ROUNDUP(dyn + 1, 64))),
_gc(xmemalign(64, ROUNDUP(sizeof(int) * (dxn + 1), 64))),
_gc(xmemalign(64, ROUNDUP(dxn + 1, 64))),
_gc(xmemalign(64, ROUNDUP(dxn, 64))),
_gc(xmemalign(64, ROUNDUP(sxn, 64) * 2)));
} else {
bzero(dst[c0], &dst[cn][0][0] - &dst[c0][0][0]);
}

View file

@ -24,7 +24,7 @@
#include "libc/macros.internal.h"
#include "libc/math.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/str/str.h"
#include "tool/viz/lib/graphic.h"
#include "tool/viz/lib/knobs.h"

View file

@ -19,8 +19,8 @@
#include "libc/assert.h"
#include "libc/math.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.internal.h"
#include "libc/x/x.h"
#include "libc/mem/gc.h"
#include "libc/x/xasprintf.h"
#include "tool/viz/lib/formatstringtable.h"
#include "tool/viz/lib/stringbuilder.h"
@ -44,7 +44,7 @@ void FormatMatrixByte(long yn, long xn, const unsigned char M[yn][xn],
yn, xn,
formatter(yn, xn,
ConvertByteMatrixToStringTable(
yn, xn, gc(calloc(yn * xn, sizeof(char *))), M),
yn, xn, _gc(calloc(yn * xn, sizeof(char *))), M),
emit, arg, param1, param2, param3));
}

View file

@ -21,7 +21,7 @@
#include "libc/log/check.h"
#include "libc/math.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/x/x.h"
#include "third_party/gdtoa/gdtoa.h"
#include "tool/viz/lib/formatstringtable.h"

View file

@ -17,7 +17,7 @@
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/math.h"
#include "libc/runtime/gc.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/x/x.h"
#include "tool/viz/lib/formatstringtable.h"

View file

@ -19,8 +19,9 @@
#include "libc/assert.h"
#include "libc/math.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.internal.h"
#include "libc/mem/gc.h"
#include "libc/x/x.h"
#include "libc/x/xasprintf.h"
#include "tool/viz/lib/formatstringtable.h"
#include "tool/viz/lib/stringbuilder.h"
@ -44,7 +45,7 @@ void FormatMatrixShort(long yn, long xn, const short M[yn][xn], int emit(),
yn, xn,
formatter(yn, xn,
ConvertShortMatrixToStringTable(
yn, xn, gc(xcalloc(yn * xn, sizeof(char *))), M),
yn, xn, _gc(xcalloc(yn * xn, sizeof(char *))), M),
emit, arg, param1, param2, param3));
}

View file

@ -19,7 +19,7 @@
#include "libc/fmt/itoa.h"
#include "libc/intrin/bits.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/runtime/gc.internal.h"
#include "libc/mem/gc.internal.h"
#include "libc/str/str.h"
#include "libc/str/strwidth.h"
#include "libc/x/x.h"

View file

@ -1,8 +1,8 @@
#ifndef COSMOPOLITAN_TOOL_VIZ_LIB_GRAPHIC_H_
#define COSMOPOLITAN_TOOL_VIZ_LIB_GRAPHIC_H_
#include "dsp/tty/quant.h"
#include "libc/runtime/buffer.h"
#include "libc/runtime/gc.internal.h"
#include "libc/runtime/buffer.internal.h"
#include "libc/mem/gc.internal.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -18,7 +18,7 @@
*/
#include "libc/assert.h"
#include "libc/intrin/xmmintrin.internal.h"
#include "libc/runtime/buffer.h"
#include "libc/runtime/buffer.internal.h"
#include "tool/viz/lib/graphic.h"
/**

View file

@ -25,19 +25,19 @@
#include "dsp/core/illumination.h"
#include "dsp/core/q.h"
#include "dsp/scale/scale.h"
#include "libc/intrin/xmmintrin.internal.h"
#include "libc/calls/calls.h"
#include "libc/calls/struct/sigset.h"
#include "libc/intrin/pmulhrsw.h"
#include "libc/intrin/xmmintrin.internal.h"
#include "libc/log/check.h"
#include "libc/log/log.h"
#include "libc/macros.internal.h"
#include "libc/math.h"
#include "libc/mem/gc.internal.h"
#include "libc/mem/mem.h"
#include "libc/nexgen32e/gc.internal.h"
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/runtime/gc.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/sig.h"
@ -96,8 +96,8 @@ void YCbCrComputeCoefficients(int swing, double gamma,
double x;
double f1[6][3];
long longs[6][6];
long bitlimit = roundup2pow(swing);
long wordoffset = rounddown2pow((bitlimit - swing) / 2);
long bitlimit = _roundup2pow(swing);
long wordoffset = _rounddown2pow((bitlimit - swing) / 2);
long chromaswing = swing + 2 * (bitlimit / 2. - swing / 2. - wordoffset);
long lumamin = wordoffset;
long lumamax = wordoffset + swing;