From c58f73f3be2f1818c7e83c578a66099addd4e767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 22:33:53 -0500 Subject: [PATCH 1/5] retab: fix damage --- libc/time/localtime.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/time/localtime.c b/libc/time/localtime.c index 604309c53..c90686b2c 100644 --- a/libc/time/localtime.c +++ b/libc/time/localtime.c @@ -118,7 +118,7 @@ static const char gmt[] = "GMT"; #endif struct ttinfo { /* time type information */ - int32_t tt_utoff; /* UT offset in seconds */ + int32_t tt_utoff; /* UT offset in seconds */ bool tt_isdst; /* used to set tm_isdst */ int tt_desigidx; /* abbreviation list index */ bool tt_ttisstd; /* transition is std time */ @@ -127,7 +127,7 @@ struct ttinfo { /* time type information */ struct lsinfo { /* leap second information */ time_t ls_trans; /* transition time */ - int32_t ls_corr; /* correction to apply */ + int32_t ls_corr; /* correction to apply */ }; #define SMALLEST(a, b) (((a) < (b)) ? (a) : (b)) @@ -1093,8 +1093,8 @@ localtime_tzparse(const char *name, struct state *sp, struct state *basep) size_t stdlen; size_t dstlen; size_t charcnt; - int32_t stdoffset; - int32_t dstoffset; + int32_t stdoffset; + int32_t dstoffset; register char * cp; register bool load_ok; time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN; From 7f557854090d642f1e7d81ec63e69e6abfc36392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 22:35:38 -0500 Subject: [PATCH 2/5] retab: stray spaces --- libc/mem/qsort.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/mem/qsort.c b/libc/mem/qsort.c index 4ca7ae375..ca96a532a 100644 --- a/libc/mem/qsort.c +++ b/libc/mem/qsort.c @@ -63,7 +63,7 @@ static inline void swapfunc(char *, char *, size_t, int); TYPE t = *pi; \ *pi++ = *pj; \ *pj++ = t; \ - } while (--i > 0); \ + } while (--i > 0); \ } static inline void @@ -110,7 +110,7 @@ med3(char *a, char *b, char *c, CMPPAR) { return CMP(a, b) < 0 ? (CMP(b, c) < 0 ? b : (CMP(a, c) < 0 ? c : a )) - :(CMP(b, c) > 0 ? b : (CMP(a, c) < 0 ? a : c )); + :(CMP(b, c) > 0 ? b : (CMP(a, c) < 0 ? a : c )); } static void From 91b6e6d8cdb02d7479f704811d2162318c0eb4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 22:38:37 -0500 Subject: [PATCH 3/5] modeline: et, retab --- third_party/musl/grp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/third_party/musl/grp.c b/third_party/musl/grp.c index 591fac239..cd7e106f8 100644 --- a/third_party/musl/grp.c +++ b/third_party/musl/grp.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ Musl Libc │ @@ -47,7 +47,7 @@ static unsigned atou(char **s) { } int __getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, - char ***mem, size_t *nmem, struct group **res) { + char ***mem, size_t *nmem, struct group **res) { ssize_t l; char *s, *mems; size_t i; @@ -104,8 +104,8 @@ end: } int __getgr_a(const char *name, gid_t gid, struct group *gr, char **buf, - size_t *size, char ***mem, size_t *nmem, - struct group **res) { + size_t *size, char ***mem, size_t *nmem, + struct group **res) { FILE *f; int rv = 0; int cs; From 71e62451863767a841f56cbac985a10ed692b9c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 22:34:23 -0500 Subject: [PATCH 4/5] modeline: et --- ape/aarch64.lds | 2 +- ape/ape.lds | 2 +- ape/loader.lds | 2 +- dsp/mpeg/idct.c | 2 +- dsp/mpeg/macroblock.c | 2 +- dsp/mpeg/mpeg1.c | 2 +- dsp/mpeg/slowrgb.c | 2 +- libc/time/strptime.c | 2 +- libc/tinymath/exp2f_data.c | 2 +- third_party/musl/fnmatch.c | 2 +- third_party/musl/glob.c | 2 +- tool/net/largon2.c | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ape/aarch64.lds b/ape/aarch64.lds index adf105572..9866ac748 100644 --- a/ape/aarch64.lds +++ b/ape/aarch64.lds @@ -1,5 +1,5 @@ /*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ -│ vi: set noet sts=2 sw=2 fenc=utf-8 :vi │ +│ vi: set et sts=2 sw=2 fenc=utf-8 :vi │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/thread/tls.h" diff --git a/ape/ape.lds b/ape/ape.lds index 873c347a1..30b5b69ac 100644 --- a/ape/ape.lds +++ b/ape/ape.lds @@ -1,5 +1,5 @@ /*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ -│ vi: set noet sts=2 sw=2 fenc=utf-8 :vi │ +│ vi: set et sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ │ diff --git a/ape/loader.lds b/ape/loader.lds index 035840e31..a27d29a12 100644 --- a/ape/loader.lds +++ b/ape/loader.lds @@ -1,5 +1,5 @@ /*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ -│ vi: set noet sts=2 sw=2 fenc=utf-8 :vi │ +│ vi: set et sts=2 sw=2 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2023 Justine Alexandra Roberts Tunney │ │ │ diff --git a/dsp/mpeg/idct.c b/dsp/mpeg/idct.c index 06645d8e1..87c17ae6a 100644 --- a/dsp/mpeg/idct.c +++ b/dsp/mpeg/idct.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=4 sw=4 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=4 sw=4 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer │ │ Dominic Szablewski - https://phoboslab.org │ diff --git a/dsp/mpeg/macroblock.c b/dsp/mpeg/macroblock.c index c94c3994b..10dee49ee 100644 --- a/dsp/mpeg/macroblock.c +++ b/dsp/mpeg/macroblock.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=4 sw=4 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=4 sw=4 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer │ │ Dominic Szablewski - https://phoboslab.org │ diff --git a/dsp/mpeg/mpeg1.c b/dsp/mpeg/mpeg1.c index 873b5ab6d..f9c29910b 100644 --- a/dsp/mpeg/mpeg1.c +++ b/dsp/mpeg/mpeg1.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=4 sw=4 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=4 sw=4 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer │ │ Dominic Szablewski - https://phoboslab.org │ diff --git a/dsp/mpeg/slowrgb.c b/dsp/mpeg/slowrgb.c index 73b1881cd..16c819c38 100644 --- a/dsp/mpeg/slowrgb.c +++ b/dsp/mpeg/slowrgb.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=4 sw=4 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=4 sw=4 fenc=utf-8 :vi │ ╞══════════════════════════════════════════════════════════════════════════════╡ │ PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer │ │ Dominic Szablewski - https://phoboslab.org │ diff --git a/libc/time/strptime.c b/libc/time/strptime.c index dddfa9555..74c558466 100644 --- a/libc/time/strptime.c +++ b/libc/time/strptime.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=2 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=2 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ Musl Libc │ diff --git a/libc/tinymath/exp2f_data.c b/libc/tinymath/exp2f_data.c index 809c5905d..94442cc73 100644 --- a/libc/tinymath/exp2f_data.c +++ b/libc/tinymath/exp2f_data.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ Musl Libc │ diff --git a/third_party/musl/fnmatch.c b/third_party/musl/fnmatch.c index 2537ff408..ed04f5c21 100644 --- a/third_party/musl/fnmatch.c +++ b/third_party/musl/fnmatch.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ Musl Libc │ diff --git a/third_party/musl/glob.c b/third_party/musl/glob.c index 4cb9e47e7..c7156ccb3 100644 --- a/third_party/musl/glob.c +++ b/third_party/musl/glob.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ Musl Libc │ diff --git a/tool/net/largon2.c b/tool/net/largon2.c index 19e8cf433..e4a6a5c6f 100644 --- a/tool/net/largon2.c +++ b/tool/net/largon2.c @@ -1,5 +1,5 @@ /*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ -│ vi: set noet ft=c ts=8 sw=8 fenc=utf-8 :vi │ +│ vi: set et ft=c ts=8 sw=8 fenc=utf-8 :vi │ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ │ largon2 │ From 2bce8a37ecffbb368b9c5444168c6bb7b9652532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 16 Dec 2023 22:39:26 -0500 Subject: [PATCH 5/5] spaces -> tab --- libc/intrin/kpollnames.S | 2 +- libc/nexgen32e/blink_linux_aarch64.S | 2 +- libc/nexgen32e/blink_xnu_aarch64.S | 2 +- libc/tinymath/expm1f.c | 10 ++-- libc/tinymath/ktan.c | 26 ++++----- third_party/musl/res_msend.c | 86 ++++++++++++++-------------- third_party/musl/resolvconf.c | 2 +- 7 files changed, 65 insertions(+), 65 deletions(-) diff --git a/libc/intrin/kpollnames.S b/libc/intrin/kpollnames.S index 5d763e46b..21e0d4038 100644 --- a/libc/intrin/kpollnames.S +++ b/libc/intrin/kpollnames.S @@ -31,7 +31,7 @@ .balign 4 .underrun kPollNames: - .e POLLNVAL "POLLNVAL" + .e POLLNVAL "POLLNVAL" .e POLLWRNORM "POLLWRNORM" .e POLLWRBAND "POLLWRBAND" .e POLLRDNORM "POLLRDNORM" diff --git a/libc/nexgen32e/blink_linux_aarch64.S b/libc/nexgen32e/blink_linux_aarch64.S index e85295581..586281e91 100644 --- a/libc/nexgen32e/blink_linux_aarch64.S +++ b/libc/nexgen32e/blink_linux_aarch64.S @@ -36,7 +36,7 @@ blink_linux_aarch64: .endobj blink_linux_aarch64,globl blink_linux_aarch64_size = . - blink_linux_aarch64 - .section .emush,"a",@progbits + .section .emush,"a",@progbits .ascii "if [ \"$s\" = Linux ]; then\n" .ascii "if [ \"$m\" = aarch64 ] || [ \"$m\" = arm64 ]; then\n" .ascii "if ! [ -x \"$e\" ]; then\n" diff --git a/libc/nexgen32e/blink_xnu_aarch64.S b/libc/nexgen32e/blink_xnu_aarch64.S index f589916a5..bef3e8247 100644 --- a/libc/nexgen32e/blink_xnu_aarch64.S +++ b/libc/nexgen32e/blink_xnu_aarch64.S @@ -36,7 +36,7 @@ blink_xnu_aarch64: .endobj blink_xnu_aarch64,globl blink_xnu_aarch64_size = . - blink_xnu_aarch64 - .section .emush,"a",@progbits + .section .emush,"a",@progbits .ascii "if [ \"$s\" = Darwin ] && [ \"$m\" = arm64 ]; then\n" .ascii "if ! [ -x \"$e\" ]; then\n" .ascii "echo \"extracting blink-darwin-aarch64 to ${e}\" >&2\n" diff --git a/libc/tinymath/expm1f.c b/libc/tinymath/expm1f.c index 6500aec27..e9e3b8530 100644 --- a/libc/tinymath/expm1f.c +++ b/libc/tinymath/expm1f.c @@ -81,11 +81,11 @@ expm1f(float x) /* filter out huge and non-finite argument */ if(hx >= 0x4195b844) { /* if |x|>=27*ln2 */ if(hx >= 0x42b17218) { /* if |x|>=88.721... */ - if(hx>0x7f800000) + if(hx>0x7f800000) return x+x; /* NaN */ if(hx==0x7f800000) return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */ - if(x > o_threshold) return huge*huge; /* overflow */ + if(x > o_threshold) return huge*huge; /* overflow */ } if(xsb!=0) { /* x < -27*ln2, return -1.0 with inexact */ if(x+tiny<(float)0.0) /* raise inexact */ @@ -132,14 +132,14 @@ expm1f(float x) else return one+(float)2.0*(x-e); } if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ - y = one-(e-x); + y = one-(e-x); if (k == 128) y = y*2.0F*0x1p127F; else y = y*twopk; - return y-one; + return y-one; } t = one; if(k<23) { - SET_FLOAT_WORD(t,0x3f800000 - (0x1000000>>k)); /* t=1-2^-k */ + SET_FLOAT_WORD(t,0x3f800000 - (0x1000000>>k)); /* t=1-2^-k */ y = t-(e-x); y = y*twopk; } else { diff --git a/libc/tinymath/ktan.c b/libc/tinymath/ktan.c index 695c6b70e..1d7da7d8e 100644 --- a/libc/tinymath/ktan.c +++ b/libc/tinymath/ktan.c @@ -90,19 +90,19 @@ asm(".include \"libc/disclaimer.inc\""); #define INSERT(d,hi,lo) (d)=ASDOUBLE((uint64_t)(hi)<<32|(uint32_t)(lo)) static const double T[] = { - 3.33333333333334091986e-01, /* 3FD55555, 55555563 */ - 1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */ - 5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */ - 2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */ - 8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */ - 3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */ - 1.45620945432529025516e-03, /* 3F57DBC8, FEE08315 */ - 5.88041240820264096874e-04, /* 3F4344D8, F2F26501 */ - 2.46463134818469906812e-04, /* 3F3026F7, 1A8D1068 */ - 7.81794442939557092300e-05, /* 3F147E88, A03792A6 */ - 7.14072491382608190305e-05, /* 3F12B80F, 32F0A7E9 */ - -1.85586374855275456654e-05, /* BEF375CB, DB605373 */ - 2.59073051863633712884e-05, /* 3EFB2A70, 74BF7AD4 */ + 3.33333333333334091986e-01, /* 3FD55555, 55555563 */ + 1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */ + 5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */ + 2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */ + 8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */ + 3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */ + 1.45620945432529025516e-03, /* 3F57DBC8, FEE08315 */ + 5.88041240820264096874e-04, /* 3F4344D8, F2F26501 */ + 2.46463134818469906812e-04, /* 3F3026F7, 1A8D1068 */ + 7.81794442939557092300e-05, /* 3F147E88, A03792A6 */ + 7.14072491382608190305e-05, /* 3F12B80F, 32F0A7E9 */ + -1.85586374855275456654e-05, /* BEF375CB, DB605373 */ + 2.59073051863633712884e-05, /* 3EFB2A70, 74BF7AD4 */ }, pio4 = 7.85398163397448278999e-01, /* 3FE921FB, 54442D18 */ pio4lo = 3.06161699786838301793e-17; /* 3C81A626, 33145C07 */ diff --git a/third_party/musl/res_msend.c b/third_party/musl/res_msend.c index 8671d74c9..b76c7124c 100644 --- a/third_party/musl/res_msend.c +++ b/third_party/musl/res_msend.c @@ -53,7 +53,7 @@ static void cleanup(void *p) struct pollfd *pfd = p; for (int i=0; pfd[i].fd >= -1; i++) if (pfd[i].fd >= 0) - close(pfd[i].fd); + close(pfd[i].fd); } static unsigned long mtime() @@ -299,51 +299,51 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries, } for (i=0; i>8, qlens[i] }, .iov_len = 2 }, - { .iov_base = (void *)queries[i], .iov_len = qlens[i] } } - }; - step_mh(&mh, qpos[i]); - r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL); - if (r < 0) goto out; - qpos[i] += r; - if (qpos[i] == qlens[i]+2) - pfd[i].events = POLLIN; - } - } + if (pfd[i].revents & POLLOUT) { + struct msghdr mh = { + .msg_iovlen = 2, + .msg_iov = (struct iovec [2]){ + { .iov_base = (uint8_t[]){ qlens[i]>>8, qlens[i] }, .iov_len = 2 }, + { .iov_base = (void *)queries[i], .iov_len = qlens[i] } } + }; + step_mh(&mh, qpos[i]); + r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL); + if (r < 0) goto out; + qpos[i] += r; + if (qpos[i] == qlens[i]+2) + pfd[i].events = POLLIN; + } + } for (i=0; i