Merge branches 'et-but-tabs' and 'noet-but-spaces' into modelines-extra

This commit is contained in:
Jōshin 2023-12-16 22:52:45 -05:00
commit db38547c6c
No known key found for this signature in database
22 changed files with 87 additions and 87 deletions

View file

@ -1,5 +1,5 @@
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ /*-*- 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" #include "libc/thread/tls.h"

View file

@ -1,5 +1,5 @@
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ /*-*- 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 │ │ Copyright 2020 Justine Alexandra Roberts Tunney │
│ │ │ │

View file

@ -1,5 +1,5 @@
/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ /*-*- 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 │ │ Copyright 2023 Justine Alexandra Roberts Tunney │
│ │ │ │

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ /*-*- 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 PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer
Dominic Szablewski - https://phoboslab.org │ Dominic Szablewski - https://phoboslab.org │

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ /*-*- 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 PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer
Dominic Szablewski - https://phoboslab.org │ Dominic Szablewski - https://phoboslab.org │

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ /*-*- 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 PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer
Dominic Szablewski - https://phoboslab.org │ Dominic Szablewski - https://phoboslab.org │

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:4;tab-width:4;coding:utf-8 -*-│ /*-*- 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 PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer
Dominic Szablewski - https://phoboslab.org │ Dominic Szablewski - https://phoboslab.org │

View file

@ -31,7 +31,7 @@
.balign 4 .balign 4
.underrun .underrun
kPollNames: kPollNames:
.e POLLNVAL "POLLNVAL" .e POLLNVAL "POLLNVAL"
.e POLLWRNORM "POLLWRNORM" .e POLLWRNORM "POLLWRNORM"
.e POLLWRBAND "POLLWRBAND" .e POLLWRBAND "POLLWRBAND"
.e POLLRDNORM "POLLRDNORM" .e POLLRDNORM "POLLRDNORM"

View file

@ -63,7 +63,7 @@ static inline void swapfunc(char *, char *, size_t, int);
TYPE t = *pi; \ TYPE t = *pi; \
*pi++ = *pj; \ *pi++ = *pj; \
*pj++ = t; \ *pj++ = t; \
} while (--i > 0); \ } while (--i > 0); \
} }
static inline void static inline void
@ -110,7 +110,7 @@ med3(char *a, char *b, char *c, CMPPAR)
{ {
return CMP(a, b) < 0 ? 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 ? 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 static void

View file

@ -36,7 +36,7 @@ blink_linux_aarch64:
.endobj blink_linux_aarch64,globl .endobj blink_linux_aarch64,globl
blink_linux_aarch64_size = . - blink_linux_aarch64 blink_linux_aarch64_size = . - blink_linux_aarch64
.section .emush,"a",@progbits .section .emush,"a",@progbits
.ascii "if [ \"$s\" = Linux ]; then\n" .ascii "if [ \"$s\" = Linux ]; then\n"
.ascii "if [ \"$m\" = aarch64 ] || [ \"$m\" = arm64 ]; then\n" .ascii "if [ \"$m\" = aarch64 ] || [ \"$m\" = arm64 ]; then\n"
.ascii "if ! [ -x \"$e\" ]; then\n" .ascii "if ! [ -x \"$e\" ]; then\n"

View file

@ -36,7 +36,7 @@ blink_xnu_aarch64:
.endobj blink_xnu_aarch64,globl .endobj blink_xnu_aarch64,globl
blink_xnu_aarch64_size = . - blink_xnu_aarch64 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 [ \"$s\" = Darwin ] && [ \"$m\" = arm64 ]; then\n"
.ascii "if ! [ -x \"$e\" ]; then\n" .ascii "if ! [ -x \"$e\" ]; then\n"
.ascii "echo \"extracting blink-darwin-aarch64 to ${e}\" >&2\n" .ascii "echo \"extracting blink-darwin-aarch64 to ${e}\" >&2\n"

View file

@ -118,7 +118,7 @@ static const char gmt[] = "GMT";
#endif #endif
struct ttinfo { /* time type information */ 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 */ bool tt_isdst; /* used to set tm_isdst */
int tt_desigidx; /* abbreviation list index */ int tt_desigidx; /* abbreviation list index */
bool tt_ttisstd; /* transition is std time */ bool tt_ttisstd; /* transition is std time */
@ -127,7 +127,7 @@ struct ttinfo { /* time type information */
struct lsinfo { /* leap second information */ struct lsinfo { /* leap second information */
time_t ls_trans; /* transition time */ 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)) #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 stdlen;
size_t dstlen; size_t dstlen;
size_t charcnt; size_t charcnt;
int32_t stdoffset; int32_t stdoffset;
int32_t dstoffset; int32_t dstoffset;
register char * cp; register char * cp;
register bool load_ok; register bool load_ok;
time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN; time_t atlo = TIME_T_MIN, leaplo = TIME_T_MIN;

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ /*-*- 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 Musl Libc

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ /*-*- 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 Musl Libc

View file

@ -81,11 +81,11 @@ expm1f(float x)
/* filter out huge and non-finite argument */ /* filter out huge and non-finite argument */
if(hx >= 0x4195b844) { /* if |x|>=27*ln2 */ if(hx >= 0x4195b844) { /* if |x|>=27*ln2 */
if(hx >= 0x42b17218) { /* if |x|>=88.721... */ if(hx >= 0x42b17218) { /* if |x|>=88.721... */
if(hx>0x7f800000) if(hx>0x7f800000)
return x+x; /* NaN */ return x+x; /* NaN */
if(hx==0x7f800000) if(hx==0x7f800000)
return (xsb==0)? x:-1.0;/* exp(+-inf)={inf,-1} */ 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(xsb!=0) { /* x < -27*ln2, return -1.0 with inexact */
if(x+tiny<(float)0.0) /* raise inexact */ if(x+tiny<(float)0.0) /* raise inexact */
@ -132,14 +132,14 @@ expm1f(float x)
else return one+(float)2.0*(x-e); else return one+(float)2.0*(x-e);
} }
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */ 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; if (k == 128) y = y*2.0F*0x1p127F;
else y = y*twopk; else y = y*twopk;
return y-one; return y-one;
} }
t = one; t = one;
if(k<23) { 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 = t-(e-x);
y = y*twopk; y = y*twopk;
} else { } else {

View file

@ -90,19 +90,19 @@ asm(".include \"libc/disclaimer.inc\"");
#define INSERT(d,hi,lo) (d)=ASDOUBLE((uint64_t)(hi)<<32|(uint32_t)(lo)) #define INSERT(d,hi,lo) (d)=ASDOUBLE((uint64_t)(hi)<<32|(uint32_t)(lo))
static const double T[] = { static const double T[] = {
3.33333333333334091986e-01, /* 3FD55555, 55555563 */ 3.33333333333334091986e-01, /* 3FD55555, 55555563 */
1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */ 1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */
5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */ 5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */
2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */ 2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */
8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */ 8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */
3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */ 3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */
1.45620945432529025516e-03, /* 3F57DBC8, FEE08315 */ 1.45620945432529025516e-03, /* 3F57DBC8, FEE08315 */
5.88041240820264096874e-04, /* 3F4344D8, F2F26501 */ 5.88041240820264096874e-04, /* 3F4344D8, F2F26501 */
2.46463134818469906812e-04, /* 3F3026F7, 1A8D1068 */ 2.46463134818469906812e-04, /* 3F3026F7, 1A8D1068 */
7.81794442939557092300e-05, /* 3F147E88, A03792A6 */ 7.81794442939557092300e-05, /* 3F147E88, A03792A6 */
7.14072491382608190305e-05, /* 3F12B80F, 32F0A7E9 */ 7.14072491382608190305e-05, /* 3F12B80F, 32F0A7E9 */
-1.85586374855275456654e-05, /* BEF375CB, DB605373 */ -1.85586374855275456654e-05, /* BEF375CB, DB605373 */
2.59073051863633712884e-05, /* 3EFB2A70, 74BF7AD4 */ 2.59073051863633712884e-05, /* 3EFB2A70, 74BF7AD4 */
}, },
pio4 = 7.85398163397448278999e-01, /* 3FE921FB, 54442D18 */ pio4 = 7.85398163397448278999e-01, /* 3FE921FB, 54442D18 */
pio4lo = 3.06161699786838301793e-17; /* 3C81A626, 33145C07 */ pio4lo = 3.06161699786838301793e-17; /* 3C81A626, 33145C07 */

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ /*-*- 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 Musl Libc

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ /*-*- 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 Musl Libc

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ /*-*- 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 Musl Libc
@ -47,7 +47,7 @@ static unsigned atou(char **s) {
} }
int __getgrent_a(FILE *f, struct group *gr, char **line, size_t *size, 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; ssize_t l;
char *s, *mems; char *s, *mems;
size_t i; size_t i;
@ -104,8 +104,8 @@ end:
} }
int __getgr_a(const char *name, gid_t gid, struct group *gr, char **buf, int __getgr_a(const char *name, gid_t gid, struct group *gr, char **buf,
size_t *size, char ***mem, size_t *nmem, size_t *size, char ***mem, size_t *nmem,
struct group **res) { struct group **res) {
FILE *f; FILE *f;
int rv = 0; int rv = 0;
int cs; int cs;

View file

@ -53,7 +53,7 @@ static void cleanup(void *p)
struct pollfd *pfd = p; struct pollfd *pfd = p;
for (int i=0; pfd[i].fd >= -1; i++) for (int i=0; pfd[i].fd >= -1; i++)
if (pfd[i].fd >= 0) if (pfd[i].fd >= 0)
close(pfd[i].fd); close(pfd[i].fd);
} }
static unsigned long mtime() static unsigned long mtime()
@ -299,51 +299,51 @@ int __res_msend_rc(int nqueries, const unsigned char *const *queries,
} }
for (i=0; i<nqueries; i++) { for (i=0; i<nqueries; i++) {
if (pfd[i].revents & POLLOUT) { if (pfd[i].revents & POLLOUT) {
struct msghdr mh = { struct msghdr mh = {
.msg_iovlen = 2, .msg_iovlen = 2,
.msg_iov = (struct iovec [2]){ .msg_iov = (struct iovec [2]){
{ .iov_base = (uint8_t[]){ qlens[i]>>8, qlens[i] }, .iov_len = 2 }, { .iov_base = (uint8_t[]){ qlens[i]>>8, qlens[i] }, .iov_len = 2 },
{ .iov_base = (void *)queries[i], .iov_len = qlens[i] } } { .iov_base = (void *)queries[i], .iov_len = qlens[i] } }
}; };
step_mh(&mh, qpos[i]); step_mh(&mh, qpos[i]);
r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL); r = sendmsg(pfd[i].fd, &mh, MSG_NOSIGNAL);
if (r < 0) goto out; if (r < 0) goto out;
qpos[i] += r; qpos[i] += r;
if (qpos[i] == qlens[i]+2) if (qpos[i] == qlens[i]+2)
pfd[i].events = POLLIN; pfd[i].events = POLLIN;
} }
} }
for (i=0; i<nqueries; i++) { for (i=0; i<nqueries; i++) {
if (pfd[i].revents & POLLIN) { if (pfd[i].revents & POLLIN) {
struct msghdr mh = { struct msghdr mh = {
.msg_iovlen = 2, .msg_iovlen = 2,
.msg_iov = (struct iovec [2]){ .msg_iov = (struct iovec [2]){
{ .iov_base = alen_buf[i], .iov_len = 2 }, { .iov_base = alen_buf[i], .iov_len = 2 },
{ .iov_base = answers[i], .iov_len = asize } } { .iov_base = answers[i], .iov_len = asize } }
}; };
step_mh(&mh, apos[i]); step_mh(&mh, apos[i]);
r = recvmsg(pfd[i].fd, &mh, 0); r = recvmsg(pfd[i].fd, &mh, 0);
if (r <= 0) goto out; if (r <= 0) goto out;
apos[i] += r; apos[i] += r;
if (apos[i] < 2) continue; if (apos[i] < 2) continue;
int alen = alen_buf[i][0]*256 + alen_buf[i][1]; int alen = alen_buf[i][0]*256 + alen_buf[i][1];
if (alen < 13) goto out; if (alen < 13) goto out;
if (apos[i] < alen+2 && apos[i] < asize+2) if (apos[i] < alen+2 && apos[i] < asize+2)
continue; continue;
int rcode = answers[i][3] & 15; int rcode = answers[i][3] & 15;
if (rcode != 0 && rcode != 3) if (rcode != 0 && rcode != 3)
goto out; goto out;
/* Storing the length here commits the accepted answer. /* Storing the length here commits the accepted answer.
* Immediately close TCP socket so as not to consume * Immediately close TCP socket so as not to consume
* resources we no longer need. */ * resources we no longer need. */
alens[i] = alen; alens[i] = alen;
close(pfd[i].fd); close(pfd[i].fd);
pfd[i].fd = -1; pfd[i].fd = -1;
} }
} }
} }
out: out:
pthread_cleanup_pop(1); pthread_cleanup_pop(1);

View file

@ -128,7 +128,7 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
} else { } else {
return -1; return -1;
} }
} }
while (fgets(line, sizeof line, f)) { while (fgets(line, sizeof line, f)) {
char *p, *z; char *p, *z;

View file

@ -1,5 +1,5 @@
/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ /*-*- 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 largon2