diff --git a/dsp/core/dct.c b/dsp/core/dct.c index cae19d596..68d5c3bdc 100644 --- a/dsp/core/dct.c +++ b/dsp/core/dct.c @@ -65,8 +65,8 @@ * * @cost ~100ns */ -void *dct(float M[restrict hasatleast 8][8], unsigned stride, - float c0, float c1, float c2, float c3, float c4) { +void *dct(float M[restrict hasatleast 8][8], unsigned stride, float c0, + float c1, float c2, float c3, float c4) { unsigned y, x; for (y = 0; y < stride * 8; y += stride) { DCT(M[y][0], M[y][1], M[y][2], M[y][3], M[y][4], M[y][5], M[y][6], M[y][7], diff --git a/dsp/core/gamma.c b/dsp/core/gamma.c index bcbf1273b..ab33737fd 100644 --- a/dsp/core/gamma.c +++ b/dsp/core/gamma.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "dsp/core/core.h" #include "dsp/core/gamma.h" +#include "dsp/core/core.h" #include "libc/math.h" double rgb2stdpc(double x, double g) { diff --git a/dsp/tty/altbuf.c b/dsp/tty/altbuf.c index 42dc045eb..9efb96366 100644 --- a/dsp/tty/altbuf.c +++ b/dsp/tty/altbuf.c @@ -24,9 +24,13 @@ * The alternate buffer trick lets one restore the console exactly as it * was, once the program is done running. */ -int ttyenablealtbuf(int ttyfd) { return ttysend(ttyfd, "\e[?1049h"); } +int ttyenablealtbuf(int ttyfd) { + return ttysend(ttyfd, "\e[?1049h"); +} /** * Asks teletypewriter to restore blinking box thing. */ -int ttydisablealtbuf(int ttyfd) { return ttysend(ttyfd, "\e[?1049l"); } +int ttydisablealtbuf(int ttyfd) { + return ttysend(ttyfd, "\e[?1049l"); +} diff --git a/dsp/tty/savecursor.c b/dsp/tty/savecursor.c index 75979413f..30e240a41 100644 --- a/dsp/tty/savecursor.c +++ b/dsp/tty/savecursor.c @@ -21,9 +21,13 @@ /** * Asks teletypewriter to push current position. */ -int ttysavecursor(int ttyfd) { return ttysend(ttyfd, "\e[s"); } +int ttysavecursor(int ttyfd) { + return ttysend(ttyfd, "\e[s"); +} /** * Asks teletypewriter to pop previous position. */ -int ttyrestorecursor(int ttyfd) { return ttysend(ttyfd, "\e[u"); } +int ttyrestorecursor(int ttyfd) { + return ttysend(ttyfd, "\e[u"); +} diff --git a/dsp/tty/setbgfg16.c b/dsp/tty/setbgfg16.c index 32834130c..f92792667 100644 --- a/dsp/tty/setbgfg16.c +++ b/dsp/tty/setbgfg16.c @@ -35,8 +35,12 @@ static char *setansibgfg(char *p, unsigned bg, unsigned fg) { return p; } -char *setbg16_(char *p, struct TtyRgb bg) { return setansibgfg(p, bg.xt, -1u); } -char *setfg16_(char *p, struct TtyRgb fg) { return setansibgfg(p, -1u, fg.xt); } +char *setbg16_(char *p, struct TtyRgb bg) { + return setansibgfg(p, bg.xt, -1u); +} +char *setfg16_(char *p, struct TtyRgb fg) { + return setansibgfg(p, -1u, fg.xt); +} char *setbgfg16_(char *p, struct TtyRgb bg, struct TtyRgb fg) { return setansibgfg(p, bg.xt, fg.xt); } diff --git a/examples/env.c b/examples/env.c index f3395ab36..5e607ddad 100644 --- a/examples/env.c +++ b/examples/env.c @@ -1,9 +1,9 @@ -#include "libc/stdio/stdio.h" #include "libc/runtime/runtime.h" +#include "libc/stdio/stdio.h" int main(int argc, char* argv[]) { fprintf(stderr, "%s (%s)\n", argv[0], GetProgramExecutableName()); - for (char **p = environ; *p; ++p) { + for (char** p = environ; *p; ++p) { printf("%s\n", *p); } return 0; diff --git a/examples/hiredis.c b/examples/hiredis.c index 749cc61db..727e23ce6 100644 --- a/examples/hiredis.c +++ b/examples/hiredis.c @@ -7,11 +7,11 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif -#include "libc/runtime/runtime.h" +#include "third_party/hiredis/hiredis.h" #include "libc/fmt/conv.h" +#include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" -#include "third_party/hiredis/hiredis.h" /** * @fileoverview Demo of using hiredis to connect to a Redis server diff --git a/examples/parsefloat.c b/examples/parsefloat.c index ea0fb87d1..c9f049aef 100644 --- a/examples/parsefloat.c +++ b/examples/parsefloat.c @@ -1,31 +1,31 @@ #include -#define PARSE_AND_PRINT(type, scan_fmt, print_fmt, str) \ - do { \ - type val; int ret; \ - ret = sscanf(str, scan_fmt, &val); \ - printf("\"%s\" => " print_fmt " = %d\n", str, val, ret); \ +#define PARSE_AND_PRINT(type, scan_fmt, print_fmt, str) \ + do { \ + type val; \ + int ret; \ + ret = sscanf(str, scan_fmt, &val); \ + printf("\"%s\" => " print_fmt " = %d\n", str, val, ret); \ } while (0) -int main() -{ - PARSE_AND_PRINT(float, "%f", "%f", "0.3715"); - PARSE_AND_PRINT(float, "%f", "%f", ".3715"); - PARSE_AND_PRINT(float, "%f", "%f", "3715"); - PARSE_AND_PRINT(float, "%f", "%f", "111.11"); - PARSE_AND_PRINT(float, "%f", "%f", "-2.22"); - PARSE_AND_PRINT(float, "%f", "%f", "Nan"); - PARSE_AND_PRINT(float, "%f", "%f", "nAn(2)"); - PARSE_AND_PRINT(float, "%f", "%f", "-NAN(_asdfZXCV1234_)"); - PARSE_AND_PRINT(float, "%f", "%f", "-nan"); - PARSE_AND_PRINT(float, "%f", "%f", "+nan"); - PARSE_AND_PRINT(float, "%f", "%f", "inF"); - PARSE_AND_PRINT(float, "%f", "%f", "iNfINiTy"); - PARSE_AND_PRINT(float, "%f", "%f", "+inf"); - PARSE_AND_PRINT(float, "%f", "%f", "-inf"); - PARSE_AND_PRINT(float, "%f", "%f", "0X1.BC70A3D70A3D7P+6"); - PARSE_AND_PRINT(float, "%f", "%f", "1.18973e+4932zzz"); - PARSE_AND_PRINT(float, "%f", "%.10f", " -0.0000000123junk"); - PARSE_AND_PRINT(float, "%f", "%f", "junk"); - return 0; +int main() { + PARSE_AND_PRINT(float, "%f", "%f", "0.3715"); + PARSE_AND_PRINT(float, "%f", "%f", ".3715"); + PARSE_AND_PRINT(float, "%f", "%f", "3715"); + PARSE_AND_PRINT(float, "%f", "%f", "111.11"); + PARSE_AND_PRINT(float, "%f", "%f", "-2.22"); + PARSE_AND_PRINT(float, "%f", "%f", "Nan"); + PARSE_AND_PRINT(float, "%f", "%f", "nAn(2)"); + PARSE_AND_PRINT(float, "%f", "%f", "-NAN(_asdfZXCV1234_)"); + PARSE_AND_PRINT(float, "%f", "%f", "-nan"); + PARSE_AND_PRINT(float, "%f", "%f", "+nan"); + PARSE_AND_PRINT(float, "%f", "%f", "inF"); + PARSE_AND_PRINT(float, "%f", "%f", "iNfINiTy"); + PARSE_AND_PRINT(float, "%f", "%f", "+inf"); + PARSE_AND_PRINT(float, "%f", "%f", "-inf"); + PARSE_AND_PRINT(float, "%f", "%f", "0X1.BC70A3D70A3D7P+6"); + PARSE_AND_PRINT(float, "%f", "%f", "1.18973e+4932zzz"); + PARSE_AND_PRINT(float, "%f", "%.10f", " -0.0000000123junk"); + PARSE_AND_PRINT(float, "%f", "%f", "junk"); + return 0; } diff --git a/examples/unbourne.c b/examples/unbourne.c index 536af38b5..821025df7 100644 --- a/examples/unbourne.c +++ b/examples/unbourne.c @@ -2569,7 +2569,8 @@ static int shlex() { case 'y': case 'z': p = buf; - while (buf++, is_in_name(*buf)); + while (buf++, is_in_name(*buf)) + ; yylval.name = stalloc(buf - p + 1); *(char *)mempcpy(yylval.name, p, buf - p) = 0; value = ARITH_VAR; @@ -2993,7 +2994,7 @@ static const char *updatepwd(const char *dir) { lim = (char *)stackblock() + 1; if (*dir != '/') { if (new[-1] != '/') USTPUTC('/', new); - if (new > lim && *lim == '/') lim++; + if (new > lim &&*lim == '/') lim++; } else { USTPUTC('/', new); cdcomppath++; @@ -7449,7 +7450,8 @@ static int ulimitcmd(int argc, char **argv) { what = optc; } } - for (l = limits; l->option != what; l++); + for (l = limits; l->option != what; l++) + ; set = *argptr ? 1 : 0; if (set) { char *p = *argptr; @@ -7662,7 +7664,8 @@ static void setparam(char **argv) { char **newparam; char **ap; int nparam; - for (nparam = 0; argv[nparam]; nparam++); + for (nparam = 0; argv[nparam]; nparam++) + ; ap = newparam = ckmalloc((nparam + 1) * sizeof *ap); while (*argv) { *ap++ = savestr(*argv++); @@ -7702,7 +7705,8 @@ static int shiftcmd(int argc, char **argv) { if (shellparam.malloc) ckfree(*ap1); } ap2 = shellparam.p; - while ((*ap2++ = *ap1++) != NULL); + while ((*ap2++ = *ap1++) != NULL) + ; shellparam.optind = 1; shellparam.optoff = -1; INTON; @@ -8308,7 +8312,8 @@ static void parsefname(void) { if (heredoclist == NULL) heredoclist = here; else { - for (p = heredoclist; p->next; p = p->next); + for (p = heredoclist; p->next; p = p->next) + ; p->next = here; } } else if (n->type == NTOFD || n->type == NFROMFD) { @@ -8431,7 +8436,8 @@ static int xxreadtoken(void) { case '\t': continue; case '#': - while ((c = pgetc()) != '\n' && c != PEOF); + while ((c = pgetc()) != '\n' && c != PEOF) + ; pungetc(); continue; case '\n': @@ -8551,7 +8557,7 @@ static int readtoken1(int firstc, char const *syntax, char *eofmark, quotef = 0; bqlist = NULL; STARTSTACKSTR(out); -loop: { /* for each line, until end of word */ +loop : { /* for each line, until end of word */ CHECKEND(); /* set c to PEOF if at end of here document */ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to USTPUTC */ @@ -8699,7 +8705,7 @@ endword: * is called, c is set to the first character of the next input line. If * we are at the end of the here document, this routine sets the c to PEOF. */ -checkend: { +checkend : { if (realeofmark(eofmark)) { int markloc; char *p; @@ -8740,7 +8746,7 @@ checkend: { * specifying the fd to be redirected. The variable "c" contains the * first character of the redirection operator. */ -parseredir: { +parseredir : { char fd = *out; union node *np; np = (union node *)stalloc(sizeof(struct nfile)); @@ -8796,7 +8802,7 @@ parseredir: { * Parse a substitution. At this point, we have read the dollar sign * and nothing else. */ -parsesub: { +parsesub : { int subtype; int typeloc; char *p; @@ -8908,7 +8914,7 @@ parsesub: { * list of commands (passed by reference), and savelen is the number of * characters on the top of the stack which must be preserved. */ -parsebackq: { +parsebackq : { struct nodelist **nlpp; union node *n; char *str; @@ -9000,7 +9006,7 @@ parsebackq: { /* * Parse an arithmetic expansion (indicate start of one and set state) */ -parsearith: { +parsearith : { synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)), ARISYNTAX); synstack->dblquote = 1; diff --git a/examples/walk.c b/examples/walk.c index 09df2ddfd..fa4372ed2 100644 --- a/examples/walk.c +++ b/examples/walk.c @@ -9,11 +9,11 @@ #endif #include "libc/errno.h" #include "libc/runtime/runtime.h" +#include "libc/stdio/ftw.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/sysv/consts/exit.h" #include "libc/sysv/consts/s.h" -#include "libc/stdio/ftw.h" /** * @fileoverview Directory walker example. diff --git a/libc/calls/dup.c b/libc/calls/dup.c index af23647e9..caab149ee 100644 --- a/libc/calls/dup.c +++ b/libc/calls/dup.c @@ -23,8 +23,8 @@ #include "libc/dce.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" -#include "libc/sysv/errfuns.h" #include "libc/runtime/zipos.internal.h" +#include "libc/sysv/errfuns.h" /** * Duplicates file descriptor. diff --git a/libc/calls/dup2.c b/libc/calls/dup2.c index a1c370879..23e19e7d3 100644 --- a/libc/calls/dup2.c +++ b/libc/calls/dup2.c @@ -74,7 +74,7 @@ int dup2(int oldfd, int newfd) { if (!(rc = read(oldfd, 0, 0))) rc = oldfd; } else #endif - if (!IsWindows()) { + if (!IsWindows()) { if (__isfdkind(oldfd, kFdZip) || __isfdkind(newfd, kFdZip)) { if (__vforked) { return enotsup(); diff --git a/libc/calls/ioctl.c b/libc/calls/ioctl.c index 9416c03c7..a973bf560 100644 --- a/libc/calls/ioctl.c +++ b/libc/calls/ioctl.c @@ -24,7 +24,6 @@ #include "libc/calls/termios.h" #include "libc/dce.h" #include "libc/errno.h" -#include "libc/serialize.h" #include "libc/intrin/cmpxchg.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" @@ -42,6 +41,7 @@ #include "libc/nt/winsock.h" #include "libc/runtime/runtime.h" #include "libc/runtime/stack.h" +#include "libc/serialize.h" #include "libc/sock/internal.h" #include "libc/sock/struct/ifconf.h" #include "libc/sock/struct/ifreq.h" diff --git a/libc/calls/isapemagic.c b/libc/calls/isapemagic.c index fa4f8b75e..a1ca56460 100644 --- a/libc/calls/isapemagic.c +++ b/libc/calls/isapemagic.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/proc/execve.internal.h" +#include "libc/serialize.h" /** * Returns true if executable image is supported by APE Loader. diff --git a/libc/calls/linkat.c b/libc/calls/linkat.c index d2a780d0b..1b87e3093 100644 --- a/libc/calls/linkat.c +++ b/libc/calls/linkat.c @@ -24,8 +24,8 @@ #include "libc/intrin/describeflags.internal.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" -#include "libc/sysv/errfuns.h" #include "libc/runtime/zipos.internal.h" +#include "libc/sysv/errfuns.h" /** * Creates hard filesystem link. diff --git a/libc/calls/mkdirat.c b/libc/calls/mkdirat.c index fbc1d51c3..d23facbf7 100644 --- a/libc/calls/mkdirat.c +++ b/libc/calls/mkdirat.c @@ -24,9 +24,9 @@ #include "libc/intrin/describeflags.internal.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" +#include "libc/runtime/zipos.internal.h" #include "libc/sysv/consts/at.h" #include "libc/sysv/errfuns.h" -#include "libc/runtime/zipos.internal.h" /** * Creates directory a.k.a. folder. diff --git a/libc/calls/openat-metal.c b/libc/calls/openat-metal.c index fa2b45b82..bdf2768ed 100644 --- a/libc/calls/openat-metal.c +++ b/libc/calls/openat-metal.c @@ -27,13 +27,13 @@ #include "libc/mem/mem.h" #include "libc/runtime/pc.internal.h" #include "libc/runtime/runtime.h" +#include "libc/runtime/zipos.internal.h" #include "libc/str/str.h" #include "libc/sysv/consts/at.h" #include "libc/sysv/consts/map.h" #include "libc/sysv/consts/o.h" #include "libc/sysv/consts/prot.h" #include "libc/sysv/errfuns.h" -#include "libc/runtime/zipos.internal.h" #ifdef __x86_64__ diff --git a/libc/calls/renameat.c b/libc/calls/renameat.c index d00c82941..02106a4e8 100644 --- a/libc/calls/renameat.c +++ b/libc/calls/renameat.c @@ -24,9 +24,9 @@ #include "libc/intrin/describeflags.internal.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" +#include "libc/runtime/zipos.internal.h" #include "libc/sysv/consts/at.h" #include "libc/sysv/errfuns.h" -#include "libc/runtime/zipos.internal.h" /** * Renames files relative to directories. diff --git a/libc/calls/ttyname.c b/libc/calls/ttyname.c index 9a2ff2a5a..31b1fc202 100644 --- a/libc/calls/ttyname.c +++ b/libc/calls/ttyname.c @@ -17,10 +17,10 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/stdio/sysparam.h" #include "libc/errno.h" #include "libc/log/log.h" #include "libc/paths.h" +#include "libc/stdio/sysparam.h" /** * Returns name of terminal. diff --git a/libc/calls/unlinkat.c b/libc/calls/unlinkat.c index a1fe186eb..939c77091 100644 --- a/libc/calls/unlinkat.c +++ b/libc/calls/unlinkat.c @@ -26,9 +26,9 @@ #include "libc/intrin/describeflags.internal.h" #include "libc/intrin/strace.internal.h" #include "libc/intrin/weaken.h" +#include "libc/runtime/zipos.internal.h" #include "libc/sysv/consts/s.h" #include "libc/sysv/errfuns.h" -#include "libc/runtime/zipos.internal.h" /** * Deletes inode and maybe the file too. diff --git a/libc/intrin/float16.c b/libc/intrin/float16.c index 476a2f6c9..7da05312d 100644 --- a/libc/intrin/float16.c +++ b/libc/intrin/float16.c @@ -22,7 +22,7 @@ */ #define asint(x) ((union pun){x}).i -#define isnan(x) (((x) & 0x7fff) > 0x7c00) +#define isnan(x) (((x)&0x7fff) > 0x7c00) union pun { _Float16 f; diff --git a/libc/intrin/mman.greg.c b/libc/intrin/mman.greg.c index 6c886df53..4dfcc54a2 100644 --- a/libc/intrin/mman.greg.c +++ b/libc/intrin/mman.greg.c @@ -45,7 +45,7 @@ #ifdef __x86_64__ #define INVERT(x) (BANE + PHYSICAL((uintptr_t)(x))) -#define NOPAGE ((uint64_t) - 1) +#define NOPAGE ((uint64_t)-1) #define APE_STACK_VADDR \ ({ \ diff --git a/libc/intrin/stackchkfail.c b/libc/intrin/stackchkfail.c index 914e16482..b58f32c4f 100644 --- a/libc/intrin/stackchkfail.c +++ b/libc/intrin/stackchkfail.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/errno.h" #include "libc/intrin/kprintf.h" #include "libc/runtime/internal.h" -#include "libc/errno.h" #include "libc/runtime/runtime.h" __attribute__((__weak__)) void __stack_chk_fail(void) { diff --git a/libc/intrin/strlen.c b/libc/intrin/strlen.c index 72a32c33d..c2fa3282a 100644 --- a/libc/intrin/strlen.c +++ b/libc/intrin/strlen.c @@ -30,7 +30,7 @@ static __vex size_t __strlen(const char *s) { while (!m) m = __builtin_ia32_pmovmskb128(*++p == z); return (const char *)p + __builtin_ctzl(m) - s; #else -#define ONES ((word) - 1 / 255) +#define ONES ((word)-1 / 255) #define BANE (ONES * (255 / 2 + 1)) typedef unsigned long mayalias word; word w; diff --git a/libc/irq/acpi-fadt.c b/libc/irq/acpi-fadt.c index cab665855..f29fbaf48 100644 --- a/libc/irq/acpi-fadt.c +++ b/libc/irq/acpi-fadt.c @@ -62,8 +62,8 @@ textstartup void _AcpiFadtInit(void) { _Static_assert(offsetof(AcpiTableFadt, Dsdt) == 40); _Static_assert(offsetof(AcpiTableFadt, BootFlags) == 109); _Static_assert(offsetof(AcpiTableFadt, XDsdt) == 140); - if (length >= offsetof(AcpiTableFadt, BootFlags) + sizeof(fadt->BootFlags)) - { + if (length >= + offsetof(AcpiTableFadt, BootFlags) + sizeof(fadt->BootFlags)) { _AcpiBootFlags = flags = fadt->BootFlags; KINFOF("FADT: boot flags %#x", (unsigned)flags); } diff --git a/libc/irq/acpi-xsdt.c b/libc/irq/acpi-xsdt.c index 14c6acecf..e1900cbd7 100644 --- a/libc/irq/acpi-xsdt.c +++ b/libc/irq/acpi-xsdt.c @@ -26,7 +26,6 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/intrin/atomic.h" -#include "libc/serialize.h" #include "libc/intrin/directmap.internal.h" #include "libc/intrin/kprintf.h" #include "libc/irq/acpi.internal.h" @@ -34,6 +33,7 @@ #include "libc/macros.internal.h" #include "libc/nt/efi.h" #include "libc/runtime/pc.internal.h" +#include "libc/serialize.h" #include "libc/str/str.h" #include "libc/sysv/consts/map.h" #include "libc/sysv/consts/prot.h" diff --git a/libc/log/appendresourcereport.c b/libc/log/appendresourcereport.c index cf9dca0e5..ed6b839d4 100644 --- a/libc/log/appendresourcereport.c +++ b/libc/log/appendresourcereport.c @@ -18,10 +18,10 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/rusage.h" #include "libc/fmt/itoa.h" -#include "libc/serialize.h" #include "libc/log/log.h" #include "libc/math.h" #include "libc/runtime/clktck.h" +#include "libc/serialize.h" #include "libc/stdio/append.h" struct State { diff --git a/libc/log/watch.c b/libc/log/watch.c index b7048f608..a258484cd 100644 --- a/libc/log/watch.c +++ b/libc/log/watch.c @@ -16,12 +16,12 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/intrin/kprintf.h" #include "libc/log/backtrace.internal.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" #include "libc/runtime/symbols.internal.h" +#include "libc/serialize.h" #include "libc/sysv/errfuns.h" #ifdef __x86_64__ diff --git a/libc/runtime/zipos-fcntl.c b/libc/runtime/zipos-fcntl.c index 939ce56fa..bcb738061 100644 --- a/libc/runtime/zipos-fcntl.c +++ b/libc/runtime/zipos-fcntl.c @@ -30,8 +30,7 @@ static int __zipos_dupfd(int fd, int cmd, int start) { int rc; if (start < 0) return einval(); if (IsWindows()) { - return sys_dup_nt(fd, -1, (cmd == F_DUPFD_CLOEXEC ? _O_CLOEXEC : 0), - start); + return sys_dup_nt(fd, -1, (cmd == F_DUPFD_CLOEXEC ? _O_CLOEXEC : 0), start); } rc = sys_fcntl(fd, cmd, start, __sys_fcntl); if (rc != -1) { diff --git a/libc/runtime/zipos-mmap.c b/libc/runtime/zipos-mmap.c index 0f27cdfd7..1480c7cb8 100644 --- a/libc/runtime/zipos-mmap.c +++ b/libc/runtime/zipos-mmap.c @@ -50,7 +50,7 @@ * @return virtual base address of new mapping, or MAP_FAILED w/ errno */ void *__zipos_mmap(void *addr, size_t size, int prot, int flags, - struct ZiposHandle *h, int64_t off) { + struct ZiposHandle *h, int64_t off) { if (off < 0) { STRACE("negative zipos mmap offset"); diff --git a/libc/runtime/zipos-notat.c b/libc/runtime/zipos-notat.c index 5c8e46e5a..0bdaef544 100644 --- a/libc/runtime/zipos-notat.c +++ b/libc/runtime/zipos-notat.c @@ -17,8 +17,8 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/internal.h" -#include "libc/sysv/errfuns.h" #include "libc/runtime/zipos.internal.h" +#include "libc/sysv/errfuns.h" int __zipos_notat(int dirfd, const char *path) { struct ZiposUri zipname; diff --git a/libc/sock/epoll.c b/libc/sock/epoll.c index 4c86e35e1..c2f3d265c 100644 --- a/libc/sock/epoll.c +++ b/libc/sock/epoll.c @@ -127,7 +127,7 @@ https://github.com/piscisaureus/wepoll"); } while (0) #define CONTAINOF(ptr, type, member) \ - ((type *)((uintptr_t)(ptr) - offsetof(type, member))) + ((type *)((uintptr_t)(ptr)-offsetof(type, member))) #define TREE__ROTATE(cis, trans) \ struct TreeNode *p = node; \ diff --git a/libc/sock/gethostips.c b/libc/sock/gethostips.c index ee00e78c4..9c5f415f9 100644 --- a/libc/sock/gethostips.c +++ b/libc/sock/gethostips.c @@ -20,11 +20,11 @@ #include "libc/calls/syscall-sysv.internal.h" #include "libc/calls/syscall_support-nt.internal.h" #include "libc/dce.h" -#include "libc/serialize.h" #include "libc/macros.internal.h" #include "libc/mem/mem.h" #include "libc/nt/errors.h" #include "libc/nt/iphlpapi.h" +#include "libc/serialize.h" #include "libc/sock/sock.h" #include "libc/str/str.h" #include "libc/sysv/consts/af.h" diff --git a/libc/stdio/vcscanf.c b/libc/stdio/vcscanf.c index f58f21e74..f48e48d15 100644 --- a/libc/stdio/vcscanf.c +++ b/libc/stdio/vcscanf.c @@ -551,9 +551,10 @@ int __vcscanf(int callback(void *), // items = -1; goto Done; } else if (rawmode && j != width) { - /* The C standard says that %c "matches a sequence of characters of - * **exactly** the number specified by the field width". If we have - * fewer characters, what we've just read is invalid. */ + /* The C standard says that %c "matches a sequence of characters + * of + * **exactly** the number specified by the field width". If we + * have fewer characters, what we've just read is invalid. */ goto Done; } else if (!rawmode && j < bufsize) { if (charbytes == sizeof(char)) { diff --git a/libc/str/iswpunct.c b/libc/str/iswpunct.c index 6ba67e833..96c16f34b 100644 --- a/libc/str/iswpunct.c +++ b/libc/str/iswpunct.c @@ -372,76 +372,76 @@ int iswpunct(wint_t c) { case u'⹍': // PARAGRAPHUS MARK (0x2e4d Po) case u'⹎': // PUNCTUS ELEVATUS MARK (0x2e4e Po) case u'⹏': // CORNISH VERSE DIVIDER (0x2e4f Po) - case u'、': // IDEOGRAPHIC COMMA (0x3001 Po) - case u'。': // IDEOGRAPHIC FULL STOP (0x3002 Po) - case u'〃': // DITTO MARK (0x3003 Po) - case u'〈': // LEFT ANGLE BRACKET (0x3008 Ps) - case u'〉': // RIGHT ANGLE BRACKET (0x3009 Pe) - case u'《': // LEFT DOUBLE ANGLE BRACKET (0x300a Ps) - case u'》': // RIGHT DOUBLE ANGLE BRACKET (0x300b Pe) - case u'「': // LEFT CORNER BRACKET (0x300c Ps) - case u'」': // RIGHT CORNER BRACKET (0x300d Pe) - case u'『': // LEFT WHITE CORNER BRACKET (0x300e Ps) - case u'』': // RIGHT WHITE CORNER BRACKET (0x300f Pe) - case u'【': // LEFT BLACK LENTICULAR BRACKET (0x3010 Ps) - case u'】': // RIGHT BLACK LENTICULAR BRACKET (0x3011 Pe) - case u'〔': // LEFT TORTOISE SHELL BRACKET (0x3014 Ps) - case u'〕': // RIGHT TORTOISE SHELL BRACKET (0x3015 Pe) - case u'〖': // LEFT WHITE LENTICULAR BRACKET (0x3016 Ps) - case u'〗': // RIGHT WHITE LENTICULAR BRACKET (0x3017 Pe) - case u'〘': // LEFT WHITE TORTOISE SHELL BRACKET (0x3018 Ps) - case u'〙': // RIGHT WHITE TORTOISE SHELL BRACKET (0x3019 Pe) - case u'〚': // LEFT WHITE SQUARE BRACKET (0x301a Ps) - case u'〛': // RIGHT WHITE SQUARE BRACKET (0x301b Pe) - case u'〜': // WAVE DASH (0x301c Pd) - case u'〝': // REVERSED DOUBLE PRIME QUOTATION MARK (0x301d Ps) - case u'〞': // DOUBLE PRIME QUOTATION MARK (0x301e Pe) - case u'〟': // LOW DOUBLE PRIME QUOTATION MARK (0x301f Pe) - case u'〰': // WAVY DASH (0x3030 Pd) - case u'〽': // PART ALTERNATION MARK (0x303d Po) - case u'゠': // KATAKANA-HIRAGANA DOUBLE HYPHEN (0x30a0 Pd) - case u'・': // KATAKANA MIDDLE DOT (0x30fb Po) - case u'꓾': // LISU PUNCTUATION COMMA (0xa4fe Po) - case u'꓿': // LISU PUNCTUATION FULL STOP (0xa4ff Po) - case u'꘍': // VAI COMMA (0xa60d Po) - case u'꘎': // VAI FULL STOP (0xa60e Po) - case u'꘏': // VAI QUESTION MARK (0xa60f Po) - case u'꙾': // CYRILLIC KAVYKA (0xa67e Po) - case u'꡴': // PHAGS-PA SINGLE HEAD MARK (0xa874 Po) - case u'꡵': // PHAGS-PA DOUBLE HEAD MARK (0xa875 Po) - case u'꡶': // PHAGS-PA MARK SHAD (0xa876 Po) - case u'꡷': // PHAGS-PA MARK DOUBLE SHAD (0xa877 Po) - case u'꣎': // SAURASHTRA DANDA (0xa8ce Po) - case u'꣏': // SAURASHTRA DOUBLE DANDA (0xa8cf Po) - case u'꣸': // DEVANAGARI SIGN PUSHPIKA (0xa8f8 Po) - case u'꣹': // DEVANAGARI GAP FILLER (0xa8f9 Po) - case u'꣺': // DEVANAGARI CARET (0xa8fa Po) - case u'꣼': // DEVANAGARI SIGN SIDDHAM (0xa8fc Po) - case u'꧁': // JAVANESE LEFT RERENGGAN (0xa9c1 Po) - case u'꧂': // JAVANESE RIGHT RERENGGAN (0xa9c2 Po) - case u'꧃': // JAVANESE PADA ANDAP (0xa9c3 Po) - case u'꧄': // JAVANESE PADA MADYA (0xa9c4 Po) - case u'꧅': // JAVANESE PADA LUHUR (0xa9c5 Po) - case u'꧆': // JAVANESE PADA WINDU (0xa9c6 Po) - case u'꧇': // JAVANESE PADA PANGKAT (0xa9c7 Po) - case u'꧈': // JAVANESE PADA LINGSA (0xa9c8 Po) - case u'꧉': // JAVANESE PADA LUNGSI (0xa9c9 Po) - case u'꧊': // JAVANESE PADA ADEG (0xa9ca Po) - case u'꧋': // JAVANESE PADA ADEG ADEG (0xa9cb Po) - case u'꧌': // JAVANESE PADA PISELEH (0xa9cc Po) - case u'꧍': // JAVANESE TURNED PADA PISELEH (0xa9cd Po) - case u'꧞': // JAVANESE PADA TIRTA TUMETES (0xa9de Po) - case u'꧟': // JAVANESE PADA ISEN-ISEN (0xa9df Po) - case u'꩜': // CHAM PUNCTUATION SPIRAL (0xaa5c Po) - case u'꩝': // CHAM PUNCTUATION DANDA (0xaa5d Po) - case u'꩞': // CHAM PUNCTUATION DOUBLE DANDA (0xaa5e Po) - case u'꩟': // CHAM PUNCTUATION TRIPLE DANDA (0xaa5f Po) - case u'꫞': // TAI VIET SYMBOL HO HOI (0xaade Po) - case u'꫟': // TAI VIET SYMBOL KOI KOI (0xaadf Po) - case u'꫰': // MEETEI MAYEK CHEIKHAN (0xaaf0 Po) - case u'꫱': // MEETEI MAYEK AHANG KHUDAM (0xaaf1 Po) - case u'꯫': // MEETEI MAYEK CHEIKHEI (0xabeb Po) - case u'︐': // PRESENTATION FORM FOR VERTICAL COMMA (0xfe10 Po) + case u'、': // IDEOGRAPHIC COMMA (0x3001 Po) + case u'。': // IDEOGRAPHIC FULL STOP (0x3002 Po) + case u'〃': // DITTO MARK (0x3003 Po) + case u'〈': // LEFT ANGLE BRACKET (0x3008 Ps) + case u'〉': // RIGHT ANGLE BRACKET (0x3009 Pe) + case u'《': // LEFT DOUBLE ANGLE BRACKET (0x300a Ps) + case u'》': // RIGHT DOUBLE ANGLE BRACKET (0x300b Pe) + case u'「': // LEFT CORNER BRACKET (0x300c Ps) + case u'」': // RIGHT CORNER BRACKET (0x300d Pe) + case u'『': // LEFT WHITE CORNER BRACKET (0x300e Ps) + case u'』': // RIGHT WHITE CORNER BRACKET (0x300f Pe) + case u'【': // LEFT BLACK LENTICULAR BRACKET (0x3010 Ps) + case u'】': // RIGHT BLACK LENTICULAR BRACKET (0x3011 Pe) + case u'〔': // LEFT TORTOISE SHELL BRACKET (0x3014 Ps) + case u'〕': // RIGHT TORTOISE SHELL BRACKET (0x3015 Pe) + case u'〖': // LEFT WHITE LENTICULAR BRACKET (0x3016 Ps) + case u'〗': // RIGHT WHITE LENTICULAR BRACKET (0x3017 Pe) + case u'〘': // LEFT WHITE TORTOISE SHELL BRACKET (0x3018 Ps) + case u'〙': // RIGHT WHITE TORTOISE SHELL BRACKET (0x3019 Pe) + case u'〚': // LEFT WHITE SQUARE BRACKET (0x301a Ps) + case u'〛': // RIGHT WHITE SQUARE BRACKET (0x301b Pe) + case u'〜': // WAVE DASH (0x301c Pd) + case u'〝': // REVERSED DOUBLE PRIME QUOTATION MARK (0x301d Ps) + case u'〞': // DOUBLE PRIME QUOTATION MARK (0x301e Pe) + case u'〟': // LOW DOUBLE PRIME QUOTATION MARK (0x301f Pe) + case u'〰': // WAVY DASH (0x3030 Pd) + case u'〽': // PART ALTERNATION MARK (0x303d Po) + case u'゠': // KATAKANA-HIRAGANA DOUBLE HYPHEN (0x30a0 Pd) + case u'・': // KATAKANA MIDDLE DOT (0x30fb Po) + case u'꓾': // LISU PUNCTUATION COMMA (0xa4fe Po) + case u'꓿': // LISU PUNCTUATION FULL STOP (0xa4ff Po) + case u'꘍': // VAI COMMA (0xa60d Po) + case u'꘎': // VAI FULL STOP (0xa60e Po) + case u'꘏': // VAI QUESTION MARK (0xa60f Po) + case u'꙾': // CYRILLIC KAVYKA (0xa67e Po) + case u'꡴': // PHAGS-PA SINGLE HEAD MARK (0xa874 Po) + case u'꡵': // PHAGS-PA DOUBLE HEAD MARK (0xa875 Po) + case u'꡶': // PHAGS-PA MARK SHAD (0xa876 Po) + case u'꡷': // PHAGS-PA MARK DOUBLE SHAD (0xa877 Po) + case u'꣎': // SAURASHTRA DANDA (0xa8ce Po) + case u'꣏': // SAURASHTRA DOUBLE DANDA (0xa8cf Po) + case u'꣸': // DEVANAGARI SIGN PUSHPIKA (0xa8f8 Po) + case u'꣹': // DEVANAGARI GAP FILLER (0xa8f9 Po) + case u'꣺': // DEVANAGARI CARET (0xa8fa Po) + case u'꣼': // DEVANAGARI SIGN SIDDHAM (0xa8fc Po) + case u'꧁': // JAVANESE LEFT RERENGGAN (0xa9c1 Po) + case u'꧂': // JAVANESE RIGHT RERENGGAN (0xa9c2 Po) + case u'꧃': // JAVANESE PADA ANDAP (0xa9c3 Po) + case u'꧄': // JAVANESE PADA MADYA (0xa9c4 Po) + case u'꧅': // JAVANESE PADA LUHUR (0xa9c5 Po) + case u'꧆': // JAVANESE PADA WINDU (0xa9c6 Po) + case u'꧇': // JAVANESE PADA PANGKAT (0xa9c7 Po) + case u'꧈': // JAVANESE PADA LINGSA (0xa9c8 Po) + case u'꧉': // JAVANESE PADA LUNGSI (0xa9c9 Po) + case u'꧊': // JAVANESE PADA ADEG (0xa9ca Po) + case u'꧋': // JAVANESE PADA ADEG ADEG (0xa9cb Po) + case u'꧌': // JAVANESE PADA PISELEH (0xa9cc Po) + case u'꧍': // JAVANESE TURNED PADA PISELEH (0xa9cd Po) + case u'꧞': // JAVANESE PADA TIRTA TUMETES (0xa9de Po) + case u'꧟': // JAVANESE PADA ISEN-ISEN (0xa9df Po) + case u'꩜': // CHAM PUNCTUATION SPIRAL (0xaa5c Po) + case u'꩝': // CHAM PUNCTUATION DANDA (0xaa5d Po) + case u'꩞': // CHAM PUNCTUATION DOUBLE DANDA (0xaa5e Po) + case u'꩟': // CHAM PUNCTUATION TRIPLE DANDA (0xaa5f Po) + case u'꫞': // TAI VIET SYMBOL HO HOI (0xaade Po) + case u'꫟': // TAI VIET SYMBOL KOI KOI (0xaadf Po) + case u'꫰': // MEETEI MAYEK CHEIKHAN (0xaaf0 Po) + case u'꫱': // MEETEI MAYEK AHANG KHUDAM (0xaaf1 Po) + case u'꯫': // MEETEI MAYEK CHEIKHEI (0xabeb Po) + case u'︐': // PRESENTATION FORM FOR VERTICAL COMMA (0xfe10 Po) case u'︑': // PRESENTATION FORM FOR VERTICAL IDEOGRAPHIC COMMA (0xfe11 Po) case u'︒': // PRESENTATION FORM FOR VERTICAL IDEO FULL STOP (0xfe12 Po) case u'︓': // PRESENTATION FORM FOR VERTICAL COLON (0xfe13 Po) diff --git a/libc/str/lz4cpy.c b/libc/str/lz4cpy.c index 8897518fd..43032ba19 100644 --- a/libc/str/lz4cpy.c +++ b/libc/str/lz4cpy.c @@ -16,10 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/intrin/pushpop.internal.h" #include "libc/intrin/repmovsb.h" #include "libc/nexgen32e/kompressor.h" +#include "libc/serialize.h" #include "libc/str/str.h" /** diff --git a/libc/str/wctype.c b/libc/str/wctype.c index 182f47d5b..588439a25 100644 --- a/libc/str/wctype.c +++ b/libc/str/wctype.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/macros.internal.h" +#include "libc/serialize.h" #include "libc/str/str.h" static const char kWcTypeNames[][8] = { diff --git a/libc/thread/sem_open.c b/libc/thread/sem_open.c index 3415a70c2..41ab6615f 100644 --- a/libc/thread/sem_open.c +++ b/libc/thread/sem_open.c @@ -48,7 +48,7 @@ static struct Semaphores { char *path; bool dead; int refs; - } * list; + } *list; } g_semaphores; static void sem_open_lock(void) { diff --git a/libc/time/strptime.c b/libc/time/strptime.c index 63d9020ac..36080c7b6 100644 --- a/libc/time/strptime.c +++ b/libc/time/strptime.c @@ -40,7 +40,8 @@ char *strptime(const char *s, const char *f, struct tm *tm) { while (*f) { if (*f != '%') { if (isspace(*f)) { - for (; *s && isspace(*s); s++); + for (; *s && isspace(*s); s++) + ; } else if (*s != *f) { return 0; } else { @@ -133,7 +134,8 @@ char *strptime(const char *s, const char *f, struct tm *tm) { goto numeric_range; case 'n': case 't': - for (; *s && isspace(*s); s++); + for (; *s && isspace(*s); s++) + ; break; case 'p': ex = "AM"; diff --git a/net/http/findcontenttype.c b/net/http/findcontenttype.c index 8437a4b3f..3d24dcacb 100644 --- a/net/http/findcontenttype.c +++ b/net/http/findcontenttype.c @@ -17,9 +17,9 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" -#include "libc/serialize.h" #include "libc/intrin/bswap.h" #include "libc/macros.internal.h" +#include "libc/serialize.h" #include "libc/str/str.h" #include "libc/str/tab.internal.h" #include "net/http/http.h" diff --git a/net/http/isacceptablepath.c b/net/http/isacceptablepath.c index 2c1bef544..682bf9c90 100644 --- a/net/http/isacceptablepath.c +++ b/net/http/isacceptablepath.c @@ -68,9 +68,8 @@ bool IsAcceptablePath(const char *data, size_t size) { } if (y == '/') { if (x == '.' && // allow /.well-known/ in the first position - (p - data > 2 || - size < 13 || - memcmp(data, "/.well-known/", 13) != 0)) return false; + (p - data > 2 || size < 13 || memcmp(data, "/.well-known/", 13) != 0)) + return false; if (x == '/' && t) return false; } y = x; diff --git a/net/http/isnocompressext.c b/net/http/isnocompressext.c index e5670f83d..014391520 100644 --- a/net/http/isnocompressext.c +++ b/net/http/isnocompressext.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/intrin/bswap.h" #include "libc/macros.internal.h" +#include "libc/serialize.h" #include "libc/str/str.h" #include "libc/str/tab.internal.h" #include "net/http/http.h" diff --git a/net/turfwar/blackhole.c b/net/turfwar/blackhole.c index 0c4b925e9..a1c75025f 100644 --- a/net/turfwar/blackhole.c +++ b/net/turfwar/blackhole.c @@ -18,9 +18,9 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/errno.h" -#include "libc/serialize.h" #include "libc/intrin/kprintf.h" #include "libc/runtime/runtime.h" +#include "libc/serialize.h" #include "libc/sock/sock.h" #include "libc/sock/struct/sockaddr.h" #include "libc/str/str.h" diff --git a/net/turfwar/blackholed.c b/net/turfwar/blackholed.c index 776267a02..f25d4d583 100644 --- a/net/turfwar/blackholed.c +++ b/net/turfwar/blackholed.c @@ -26,12 +26,12 @@ #include "libc/errno.h" #include "libc/fmt/conv.h" #include "libc/fmt/itoa.h" -#include "libc/serialize.h" #include "libc/intrin/kprintf.h" #include "libc/intrin/safemacros.internal.h" #include "libc/mem/mem.h" #include "libc/mem/sortedints.internal.h" #include "libc/runtime/runtime.h" +#include "libc/serialize.h" #include "libc/sock/sock.h" #include "libc/sock/struct/sockaddr.h" #include "libc/str/str.h" diff --git a/test/dsp/core/illumination_test.c b/test/dsp/core/illumination_test.c index da113648c..491f61315 100644 --- a/test/dsp/core/illumination_test.c +++ b/test/dsp/core/illumination_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "dsp/core/core.h" #include "dsp/core/illumination.h" +#include "dsp/core/core.h" #include "libc/log/log.h" #include "libc/math.h" #include "libc/testlib/ezbench.h" diff --git a/test/libc/calls/sigtimedwait_test.c b/test/libc/calls/sigtimedwait_test.c index d6260f302..50e323c6e 100644 --- a/test/libc/calls/sigtimedwait_test.c +++ b/test/libc/calls/sigtimedwait_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/calls/calls.h" #include "libc/calls/sigtimedwait.h" +#include "libc/calls/calls.h" #include "libc/calls/struct/siginfo.h" #include "libc/calls/struct/siginfo.internal.h" #include "libc/calls/struct/sigset.h" diff --git a/test/libc/fmt/zleb64_test.c b/test/libc/fmt/zleb64_test.c index 78491b5ca..e521f347b 100644 --- a/test/libc/fmt/zleb64_test.c +++ b/test/libc/fmt/zleb64_test.c @@ -18,8 +18,8 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/fmt/leb128.h" #include "libc/limits.h" -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/testlib/testlib.h" TEST(zleb64, testZero) { diff --git a/test/libc/intrin/describegidlist_test.c b/test/libc/intrin/describegidlist_test.c index 1b9d61376..98c6a3408 100644 --- a/test/libc/intrin/describegidlist_test.c +++ b/test/libc/intrin/describegidlist_test.c @@ -23,8 +23,8 @@ TEST(DescribeGidList, test) { uint32_t list[] = {8, 67, 530, 9}; uint32_t biglist[] = {8, 67, 530, 9, 8, 67, 530, 9, 8, 67, 530, 9, - 8, 67, 530, 9, 8, 67, 530, 9, 8, 67, 530, 9, - 8, 67, 530, 9, 8, 67, 530, 9, 8, 67, 530, 9}; + 8, 67, 530, 9, 8, 67, 530, 9, 8, 67, 530, 9, + 8, 67, 530, 9, 8, 67, 530, 9, 8, 67, 530, 9}; EXPECT_STREQ("n/a", DescribeGidList(-1, sizeof(list) / sizeof(list[0]), list)); EXPECT_STREQ("n/a", DescribeGidList(0, -1, list)); diff --git a/test/libc/intrin/lockipc_test.c b/test/libc/intrin/lockipc_test.c index f9111c997..4123c09af 100644 --- a/test/libc/intrin/lockipc_test.c +++ b/test/libc/intrin/lockipc_test.c @@ -30,7 +30,7 @@ struct SharedMemory { pthread_mutex_t mutex; volatile long x; -} * shm; +}* shm; void Worker(void) { long t; diff --git a/test/libc/mem/malloc_test.c b/test/libc/mem/malloc_test.c index 327975b69..0fee5c836 100644 --- a/test/libc/mem/malloc_test.c +++ b/test/libc/mem/malloc_test.c @@ -26,7 +26,6 @@ #include "libc/intrin/safemacros.internal.h" #include "libc/macros.internal.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/runtime/internal.h" #include "libc/runtime/memtrack.internal.h" diff --git a/test/libc/mem/prog/sock.c b/test/libc/mem/prog/sock.c index 686937c03..914be959c 100644 --- a/test/libc/mem/prog/sock.c +++ b/test/libc/mem/prog/sock.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/errno.h" #include "libc/sock/sock.h" +#include "libc/errno.h" #include "libc/sysv/consts/af.h" #include "libc/sysv/consts/sock.h" diff --git a/test/libc/mem/qsort_test.c b/test/libc/mem/qsort_test.c index 197653bdd..81f211bb5 100644 --- a/test/libc/mem/qsort_test.c +++ b/test/libc/mem/qsort_test.c @@ -19,7 +19,6 @@ #include "libc/macros.internal.h" #include "libc/mem/alg.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/stdio/rand.h" diff --git a/test/libc/nexgen32e/strsak32_test.c b/test/libc/nexgen32e/strsak32_test.c index 18e0be763..4508ed735 100644 --- a/test/libc/nexgen32e/strsak32_test.c +++ b/test/libc/nexgen32e/strsak32_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/nexgen32e/nexgen32e.h" #include "libc/mem/gc.h" +#include "libc/nexgen32e/nexgen32e.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/libc/proc/handkill_test.c b/test/libc/proc/handkill_test.c index 4d2872fcf..dd8601609 100644 --- a/test/libc/proc/handkill_test.c +++ b/test/libc/proc/handkill_test.c @@ -41,7 +41,7 @@ struct SharedMemory { atomic_bool ready; atomic_bool got_signal; atomic_bool handler_returned; -} * shm; +} *shm; void OnSig(int sig) { signal(SIGUSR1, SIG_DFL); diff --git a/test/libc/proc/sched_getaffinity_test.c b/test/libc/proc/sched_getaffinity_test.c index 23abc1fe9..5c1cb3ef8 100644 --- a/test/libc/proc/sched_getaffinity_test.c +++ b/test/libc/proc/sched_getaffinity_test.c @@ -23,8 +23,8 @@ #include "libc/fmt/conv.h" #include "libc/intrin/popcnt.h" #include "libc/intrin/safemacros.internal.h" -#include "libc/runtime/runtime.h" #include "libc/proc/posix_spawn.h" +#include "libc/runtime/runtime.h" #include "libc/testlib/subprocess.h" #include "libc/testlib/testlib.h" #include "libc/thread/thread.h" diff --git a/test/libc/stdio/crypt_test.c b/test/libc/stdio/crypt_test.c index b3c4d50ff..c61963435 100644 --- a/test/libc/stdio/crypt_test.c +++ b/test/libc/stdio/crypt_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/testlib/testlib.h" #include "third_party/musl/crypt.h" +#include "libc/testlib/testlib.h" TEST(crypt, test) { // consistent with python crypt.crypt() diff --git a/test/libc/stdio/devrand_test.c b/test/libc/stdio/devrand_test.c index 0eca6ac64..f0b238232 100644 --- a/test/libc/stdio/devrand_test.c +++ b/test/libc/stdio/devrand_test.c @@ -17,9 +17,9 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" +#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/stdio/rand.h" -#include "libc/mem/gc.h" #include "libc/str/str.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/stdio/dumphexc_test.c b/test/libc/stdio/dumphexc_test.c index 5ad6d0f0d..cd8868f44 100644 --- a/test/libc/stdio/dumphexc_test.c +++ b/test/libc/stdio/dumphexc_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/stdio/hex.internal.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/libc/stdio/fgetln_test.c b/test/libc/stdio/fgetln_test.c index 90890256d..14857cb61 100644 --- a/test/libc/stdio/fgetln_test.c +++ b/test/libc/stdio/fgetln_test.c @@ -18,7 +18,6 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" diff --git a/test/libc/stdio/iconv_test.c b/test/libc/stdio/iconv_test.c index 15684679d..9b47df98c 100644 --- a/test/libc/stdio/iconv_test.c +++ b/test/libc/stdio/iconv_test.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" -#include "libc/mem/gc.h" #include "libc/stdio/iconv.h" +#include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/stdio/joinstrlist_test.c b/test/libc/stdio/joinstrlist_test.c index d81eba1ef..bd990cf18 100644 --- a/test/libc/stdio/joinstrlist_test.c +++ b/test/libc/stdio/joinstrlist_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/mem/mem.h" +#include "libc/serialize.h" #include "libc/stdio/append.h" #include "libc/stdio/strlist.internal.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/stdio/rand_test.c b/test/libc/stdio/rand_test.c index 0ec7b0b3a..d8a6829a1 100644 --- a/test/libc/stdio/rand_test.c +++ b/test/libc/stdio/rand_test.c @@ -17,8 +17,8 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/stdio/rand.h" -#include "libc/serialize.h" #include "libc/mem/mem.h" +#include "libc/serialize.h" #include "libc/str/str.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/stdio/vappendf_test.c b/test/libc/stdio/vappendf_test.c index 72c49c936..c3894660f 100644 --- a/test/libc/stdio/vappendf_test.c +++ b/test/libc/stdio/vappendf_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/serialize.h" #include "libc/mem/mem.h" +#include "libc/serialize.h" #include "libc/stdio/append.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" diff --git a/test/libc/thread/pthread_atfork_test.c b/test/libc/thread/pthread_atfork_test.c index 06b87cded..dc977b9aa 100644 --- a/test/libc/thread/pthread_atfork_test.c +++ b/test/libc/thread/pthread_atfork_test.c @@ -19,7 +19,6 @@ #include "libc/calls/calls.h" #include "libc/dce.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/runtime/internal.h" #include "libc/runtime/runtime.h" diff --git a/test/libc/thread/pthread_create_test.c b/test/libc/thread/pthread_create_test.c index bb6c974bb..d6880be12 100644 --- a/test/libc/thread/pthread_create_test.c +++ b/test/libc/thread/pthread_create_test.c @@ -29,7 +29,6 @@ #include "libc/limits.h" #include "libc/macros.internal.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/nexgen32e/nexgen32e.h" #include "libc/nexgen32e/vendor.internal.h" diff --git a/test/libc/thread/pthread_rwlock_rdlock_test.c b/test/libc/thread/pthread_rwlock_rdlock_test.c index 9c7b8c165..e7ad11cc3 100644 --- a/test/libc/thread/pthread_rwlock_rdlock_test.c +++ b/test/libc/thread/pthread_rwlock_rdlock_test.c @@ -18,7 +18,6 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/atomic.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/testlib/testlib.h" #include "libc/thread/thread.h" diff --git a/test/libc/tinymath/measureentropy_test.c b/test/libc/tinymath/measureentropy_test.c index 75389c14f..0c9ec1a96 100644 --- a/test/libc/tinymath/measureentropy_test.c +++ b/test/libc/tinymath/measureentropy_test.c @@ -17,8 +17,8 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" -#include "libc/stdio/rand.h" #include "libc/mem/gc.h" +#include "libc/stdio/rand.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/x/utf16to8_test.c b/test/libc/x/utf16to8_test.c index fc7196566..e359df03f 100644 --- a/test/libc/x/utf16to8_test.c +++ b/test/libc/x/utf16to8_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/x/utf8to16_test.c b/test/libc/x/utf8to16_test.c index ce3c21072..cdd3d99d1 100644 --- a/test/libc/x/utf8to16_test.c +++ b/test/libc/x/utf8to16_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/libc/x/utf8to32_test.c b/test/libc/x/utf8to32_test.c index 9cdfa2647..d6e8635ca 100644 --- a/test/libc/x/utf8to32_test.c +++ b/test/libc/x/utf8to32_test.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/mem/shuffle.internal.h" -#include "libc/mem/gc.h" #include "libc/stdio/rand.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/net/http/decodelatin1_test.c b/test/net/http/decodelatin1_test.c index e2a40c909..bbdcfb701 100644 --- a/test/net/http/decodelatin1_test.c +++ b/test/net/http/decodelatin1_test.c @@ -17,8 +17,8 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/net/http/encodehttpheadervalue_test.c b/test/net/http/encodehttpheadervalue_test.c index faa1c40d5..2100c3779 100644 --- a/test/net/http/encodehttpheadervalue_test.c +++ b/test/net/http/encodehttpheadervalue_test.c @@ -17,8 +17,8 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/errno.h" -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" diff --git a/test/net/http/escapehtml_test.c b/test/net/http/escapehtml_test.c index 95cf2729e..7eebca47c 100644 --- a/test/net/http/escapehtml_test.c +++ b/test/net/http/escapehtml_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/net/http/escapejsstringliteral_test.c b/test/net/http/escapejsstringliteral_test.c index c71718b77..865738262 100644 --- a/test/net/http/escapejsstringliteral_test.c +++ b/test/net/http/escapejsstringliteral_test.c @@ -18,11 +18,11 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/log/check.h" -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/stdio/stdio.h" -#include "libc/temp.h" #include "libc/str/str.h" +#include "libc/temp.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/net/http/escapeurlparam_test.c b/test/net/http/escapeurlparam_test.c index c6fffedb7..1d914740d 100644 --- a/test/net/http/escapeurlparam_test.c +++ b/test/net/http/escapeurlparam_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/net/http/indentlines_test.c b/test/net/http/indentlines_test.c index 79599d678..e8f9ce5c9 100644 --- a/test/net/http/indentlines_test.c +++ b/test/net/http/indentlines_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" diff --git a/test/net/http/tokenbucket_test.c b/test/net/http/tokenbucket_test.c index 749ccd5b9..7726fa518 100644 --- a/test/net/http/tokenbucket_test.c +++ b/test/net/http/tokenbucket_test.c @@ -16,6 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "net/http/tokenbucket.h" #include "libc/assert.h" #include "libc/atomic.h" #include "libc/calls/struct/timespec.h" @@ -28,7 +29,6 @@ #include "libc/testlib/ezbench.h" #include "libc/testlib/testlib.h" #include "net/http/http.h" -#include "net/http/tokenbucket.h" #define TB_CIDR 22 #define TB_BYTES (1u << TB_CIDR) diff --git a/test/net/http/underlong_test.c b/test/net/http/underlong_test.c index 246aafe97..a9fbc5c41 100644 --- a/test/net/http/underlong_test.c +++ b/test/net/http/underlong_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" diff --git a/test/tool/args/args_test.c b/test/tool/args/args_test.c index 4ddcd3088..ec57b1044 100644 --- a/test/tool/args/args_test.c +++ b/test/tool/args/args_test.c @@ -16,10 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/args/args.h" #include "libc/mem/mem.h" #include "libc/runtime/runtime.h" #include "libc/testlib/testlib.h" -#include "tool/args/args.h" void FreeZipArgs(void); int LoadZipArgsImpl(int *, char ***, char *); diff --git a/test/tool/build/lib/interner_test.c b/test/tool/build/lib/interner_test.c index 23d2966fe..b26709ae7 100644 --- a/test/tool/build/lib/interner_test.c +++ b/test/tool/build/lib/interner_test.c @@ -16,15 +16,15 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/mem.h" +#include "tool/build/lib/interner.h" #include "libc/mem/gc.h" +#include "libc/mem/mem.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/fastrandomstring.h" #include "libc/testlib/hyperion.h" #include "libc/testlib/testlib.h" -#include "tool/build/lib/interner.h" TEST(interner, test) { struct Interner *t = defer(freeinterner, newinterner()); diff --git a/test/tool/build/lib/stripcomponents_test.c b/test/tool/build/lib/stripcomponents_test.c index 875f6858f..0809fdd23 100644 --- a/test/tool/build/lib/stripcomponents_test.c +++ b/test/tool/build/lib/stripcomponents_test.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/testlib/testlib.h" #include "tool/build/lib/stripcomponents.h" +#include "libc/testlib/testlib.h" TEST(StripComponents, test) { EXPECT_STREQ("", StripComponents("", 0)); diff --git a/test/tool/viz/lib/fun_test.c b/test/tool/viz/lib/fun_test.c index 64fbcffb2..93bd0b25c 100644 --- a/test/tool/viz/lib/fun_test.c +++ b/test/tool/viz/lib/fun_test.c @@ -18,8 +18,8 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/log/check.h" #include "libc/macros.internal.h" -#include "libc/stdio/rand.h" #include "libc/mem/gc.h" +#include "libc/stdio/rand.h" #include "libc/str/str.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/testlib.h" diff --git a/test/tool/viz/lib/halfblit_test.c b/test/tool/viz/lib/halfblit_test.c index c0689c80a..20230e91d 100644 --- a/test/tool/viz/lib/halfblit_test.c +++ b/test/tool/viz/lib/halfblit_test.c @@ -16,11 +16,11 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/viz/lib/halfblit.h" #include "libc/fmt/bing.internal.h" #include "libc/mem/gc.h" #include "libc/testlib/testlib.h" #include "libc/x/x.h" -#include "tool/viz/lib/halfblit.h" TEST(halfblit, test_4x4_to_2x2) { EXPECT_BINEQ(u" ☺" diff --git a/tool/args/args.c b/tool/args/args.c index 0d7a298de..cfb88fd59 100644 --- a/tool/args/args.c +++ b/tool/args/args.c @@ -92,12 +92,11 @@ int LoadZipArgsImpl(int *argc, char ***argv, char *data) { start = 0; } - if (!founddots) - { - founddots = true; - for (i = 1; i < *argc; ++i) { - AddZipArg(&n, &args, (*argv)[i]); - } + if (!founddots) { + founddots = true; + for (i = 1; i < *argc; ++i) { + AddZipArg(&n, &args, (*argv)[i]); + } } if (founddots || *argc <= 1) { diff --git a/tool/build/ar.c b/tool/build/ar.c index e89109b01..16ec2d7f1 100644 --- a/tool/build/ar.c +++ b/tool/build/ar.c @@ -29,11 +29,11 @@ #include "libc/fmt/itoa.h" #include "libc/fmt/libgen.h" #include "libc/fmt/magnumstrs.internal.h" -#include "libc/serialize.h" #include "libc/intrin/bsr.h" #include "libc/limits.h" #include "libc/macros.internal.h" #include "libc/runtime/runtime.h" +#include "libc/serialize.h" #include "libc/stdckdint.h" #include "libc/str/str.h" #include "libc/sysv/consts/map.h" diff --git a/tool/build/lib/elfwriter_zip.c b/tool/build/lib/elfwriter_zip.c index 9afa5a0f7..03cfad2a2 100644 --- a/tool/build/lib/elfwriter_zip.c +++ b/tool/build/lib/elfwriter_zip.c @@ -22,7 +22,6 @@ #include "libc/limits.h" #include "libc/log/check.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/nexgen32e/crc32.h" #include "libc/nt/enum/fileflagandattributes.h" diff --git a/tool/build/lib/interner.c b/tool/build/lib/interner.c index 85a22d7d2..584d22747 100644 --- a/tool/build/lib/interner.c +++ b/tool/build/lib/interner.c @@ -33,7 +33,7 @@ struct InternerObject { struct InternerHash { unsigned hash; /* 0 means empty */ unsigned index; - } * p; + } *p; }; static void rehash(struct InternerObject *it) { diff --git a/tool/build/lib/javadown.c b/tool/build/lib/javadown.c index 2c46c385e..564508ce7 100644 --- a/tool/build/lib/javadown.c +++ b/tool/build/lib/javadown.c @@ -27,7 +27,7 @@ struct Lines { struct Line { char *p; size_t n; - } * p; + } *p; }; static char *SkipEmptyFirstLine(char *p) { diff --git a/tool/build/pecheck.c b/tool/build/pecheck.c index e6284a360..01c0c5e69 100644 --- a/tool/build/pecheck.c +++ b/tool/build/pecheck.c @@ -17,7 +17,6 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/serialize.h" #include "libc/limits.h" #include "libc/nt/struct/imageimportbyname.internal.h" #include "libc/nt/struct/imageimportdescriptor.internal.h" @@ -25,6 +24,7 @@ #include "libc/nt/struct/imageoptionalheader.internal.h" #include "libc/nt/struct/imagesectionheader.internal.h" #include "libc/runtime/runtime.h" +#include "libc/serialize.h" #include "libc/stdckdint.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" diff --git a/tool/build/reboot.c b/tool/build/reboot.c index d6d686bed..77d324430 100644 --- a/tool/build/reboot.c +++ b/tool/build/reboot.c @@ -7,11 +7,11 @@ │ • http://creativecommons.org/publicdomain/zero/1.0/ │ ╚─────────────────────────────────────────────────────────────────*/ #endif +#include "libc/sysv/consts/reboot.h" #include "libc/calls/calls.h" #include "libc/runtime/runtime.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" -#include "libc/sysv/consts/reboot.h" int main(int argc, char *argv[]) { char line[8] = {0}; diff --git a/tool/decode/lib/disassemblehex.c b/tool/decode/lib/disassemblehex.c index 201cc96a8..4d1c7fb3a 100644 --- a/tool/decode/lib/disassemblehex.c +++ b/tool/decode/lib/disassemblehex.c @@ -16,10 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/decode/lib/disassemblehex.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" #include "libc/str/tab.internal.h" -#include "tool/decode/lib/disassemblehex.h" static size_t countzeroes(const uint8_t *data, size_t size) { size_t i; diff --git a/tool/decode/lib/elfidnames.c b/tool/decode/lib/elfidnames.c index 21388ace5..734d9f3aa 100644 --- a/tool/decode/lib/elfidnames.c +++ b/tool/decode/lib/elfidnames.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/decode/lib/elfidnames.h" #include "libc/elf/def.h" #include "libc/elf/elf.h" -#include "tool/decode/lib/elfidnames.h" const struct IdName kElfTypeNames[] = { {ET_NONE, "ET_NONE"}, diff --git a/tool/decode/lib/ntfileflagnames.c b/tool/decode/lib/ntfileflagnames.c index 56d6f1ba5..d4cf7761b 100644 --- a/tool/decode/lib/ntfileflagnames.c +++ b/tool/decode/lib/ntfileflagnames.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/nt/enum/fileflagandattributes.h" #include "tool/decode/lib/ntfileflagnames.h" +#include "libc/nt/enum/fileflagandattributes.h" const struct IdName kNtFileFlagNames[] = { {kNtFileAttributeReadonly, "kNtFileAttributeReadonly"}, diff --git a/tool/decode/lib/peidnames.c b/tool/decode/lib/peidnames.c index 2b78c2cf0..71e30ff73 100644 --- a/tool/decode/lib/peidnames.c +++ b/tool/decode/lib/peidnames.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/nt/pedef.internal.h" #include "tool/decode/lib/peidnames.h" +#include "libc/nt/pedef.internal.h" const struct IdName kNtImageFileMachineNames[] = { {kNtImageFileMachineUnknown, "kNtImageFileMachineUnknown"}, diff --git a/tool/decode/lib/titlegen.c b/tool/decode/lib/titlegen.c index d45e064ca..7c7e758c5 100644 --- a/tool/decode/lib/titlegen.c +++ b/tool/decode/lib/titlegen.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/decode/lib/titlegen.h" #include "libc/stdio/stdio.h" #include "libc/str/str.h" -#include "tool/decode/lib/titlegen.h" const struct Modeline kModelineAsm = { " mode:asm; indent-tabs-mode:t; tab-width:8; coding:utf-8 ", diff --git a/tool/decode/lib/zipnames.c b/tool/decode/lib/zipnames.c index 6cf872046..a5d834ff4 100644 --- a/tool/decode/lib/zipnames.c +++ b/tool/decode/lib/zipnames.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/decode/lib/zipnames.h" #include "libc/nt/enum/fileflagandattributes.h" #include "libc/zip.internal.h" -#include "tool/decode/lib/zipnames.h" const struct IdName kZipCompressionNames[] = { {kZipCompressionNone, "kZipCompressionNone"}, diff --git a/tool/decode/pe2.c b/tool/decode/pe2.c index f960f29b7..156a7c9dc 100644 --- a/tool/decode/pe2.c +++ b/tool/decode/pe2.c @@ -22,7 +22,6 @@ #include "libc/fmt/libgen.h" #include "libc/intrin/safemacros.internal.h" #include "libc/mem/gc.h" -#include "libc/mem/gc.h" #include "libc/mem/mem.h" #include "libc/nt/struct/imagedosheader.internal.h" #include "libc/nt/struct/imagentheaders.internal.h" diff --git a/tool/net/ljson.c b/tool/net/ljson.c index 8ac0b5d36..48445360e 100644 --- a/tool/net/ljson.c +++ b/tool/net/ljson.c @@ -17,12 +17,12 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "tool/net/ljson.h" -#include "libc/serialize.h" #include "libc/intrin/likely.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" #include "libc/runtime/stack.h" +#include "libc/serialize.h" #include "libc/stdckdint.h" #include "libc/str/str.h" #include "libc/str/tab.internal.h" diff --git a/tool/plinko/lib/error.c b/tool/plinko/lib/error.c index 128122521..23283af96 100644 --- a/tool/plinko/lib/error.c +++ b/tool/plinko/lib/error.c @@ -16,9 +16,9 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/plinko/lib/error.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" -#include "tool/plinko/lib/error.h" #include "tool/plinko/lib/plinko.h" #include "tool/plinko/lib/printf.h" #include "tool/plinko/lib/stack.h" diff --git a/tool/plinko/lib/histo.c b/tool/plinko/lib/histo.c index d8dc55fc6..50dd270d9 100644 --- a/tool/plinko/lib/histo.c +++ b/tool/plinko/lib/histo.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/assert.h" #include "tool/plinko/lib/histo.h" +#include "libc/assert.h" #include "tool/plinko/lib/plinko.h" #include "tool/plinko/lib/printf.h" diff --git a/tool/plinko/lib/print.c b/tool/plinko/lib/print.c index 2ba74c126..0e0301071 100644 --- a/tool/plinko/lib/print.c +++ b/tool/plinko/lib/print.c @@ -16,10 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/plinko/lib/print.h" #include "tool/build/lib/case.h" #include "tool/plinko/lib/char.h" #include "tool/plinko/lib/plinko.h" -#include "tool/plinko/lib/print.h" #include "tool/plinko/lib/tree.h" int PrintDot(int fd) { diff --git a/tool/viz/lib/formatstringtable-code.c b/tool/viz/lib/formatstringtable-code.c index 4ab9b5ff3..1034dc875 100644 --- a/tool/viz/lib/formatstringtable-code.c +++ b/tool/viz/lib/formatstringtable-code.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/safemacros.internal.h" #include "libc/fmt/itoa.h" +#include "libc/intrin/safemacros.internal.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/glyphs.c b/tool/viz/lib/glyphs.c index 4f4483eb0..f23a32ae9 100644 --- a/tool/viz/lib/glyphs.c +++ b/tool/viz/lib/glyphs.c @@ -53,7 +53,8 @@ // from the space left below, seen by overimposing an underline ⠿_ // along the 3 dots, the Y axis is least 1,0,1,0,1,0,0,1 so 8 steps // -// Problem: fonts are taller than wider, and terminals are traditionally 80x24, so +// Problem: fonts are taller than wider, and terminals are traditionally 80x24, +// so // - we shouldn't use square glyphs, 8x16 seems to be the minimal size // - we should adapt the conversion to BMP to avoid accidental Y downsampling diff --git a/tool/viz/lib/halfblit.c b/tool/viz/lib/halfblit.c index 5a3a1ae15..8ca4f8f63 100644 --- a/tool/viz/lib/halfblit.c +++ b/tool/viz/lib/halfblit.c @@ -16,8 +16,8 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/log/check.h" #include "tool/viz/lib/halfblit.h" +#include "libc/log/check.h" void *halfblit(size_t n, void *block) { unsigned y, x; diff --git a/tool/viz/lib/stringbuilder.c b/tool/viz/lib/stringbuilder.c index 79c13c604..21ec232cd 100644 --- a/tool/viz/lib/stringbuilder.c +++ b/tool/viz/lib/stringbuilder.c @@ -16,14 +16,15 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "tool/viz/lib/stringbuilder.h" #include "libc/log/check.h" #include "libc/macros.internal.h" #include "libc/mem/mem.h" #include "libc/str/str.h" #include "libc/x/x.h" -#include "tool/viz/lib/stringbuilder.h" -static dontinline void StringBuilderGrow(size_t need, struct StringBuilder *sb) { +static dontinline void StringBuilderGrow(size_t need, + struct StringBuilder *sb) { size_t n2; n2 = MAX(16, sb->n); while (sb->i + need > n2) n2 += n2 >> 1; diff --git a/tool/viz/life.c b/tool/viz/life.c index c01118719..6b71d1803 100644 --- a/tool/viz/life.c +++ b/tool/viz/life.c @@ -225,10 +225,10 @@ static char16_t statusline16[256]; #define GODOWN(x) ((x) << 8) #define GORIGHT(x) (((x) & ~RIGHT) << 1) #define GOLEFT(x) (((x) & ~LEFT) >> 1) -#define LEFTMOST(x) ((x) & LEFT) -#define RIGHTMOST(x) ((x) & RIGHT) -#define TOPMOST(x) ((x) & TOP) -#define BOTMOST(x) ((x) & BOTTOM) +#define LEFTMOST(x) ((x)&LEFT) +#define RIGHTMOST(x) ((x)&RIGHT) +#define TOPMOST(x) ((x)&TOP) +#define BOTMOST(x) ((x)&BOTTOM) #define ADD(X) \ do { \ diff --git a/tool/viz/maxmind.c b/tool/viz/maxmind.c index e7e469b7a..2d9954e68 100644 --- a/tool/viz/maxmind.c +++ b/tool/viz/maxmind.c @@ -17,18 +17,20 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/serialize.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/mem/gc.h" #include "libc/mem/mem.h" +#include "libc/serialize.h" #include "libc/stdio/stdio.h" #include "net/http/http.h" #include "net/http/ip.h" #include "third_party/maxmind/maxminddb.h" -#define PATH(...) \ - (const char *const[]) { __VA_ARGS__, 0 } +#define PATH(...) \ + (const char *const[]) { \ + __VA_ARGS__, 0 \ + } MMDB_s *ipdb, *asdb;