mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 22:38:30 +00:00
Make improvements
- Introduce portable sched_getcpu() api - Support GCC's __target_clones__ feature - Make fma() go faster on x86 in default mode - Remove some asan checks from core libraries - WinMain() now ensures $HOME and $USER are defined
This commit is contained in:
parent
d5225a693b
commit
2ab9e9f7fd
192 changed files with 2809 additions and 932 deletions
|
@ -2569,8 +2569,7 @@ 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;
|
||||
|
@ -2994,7 +2993,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++;
|
||||
|
@ -6565,6 +6564,10 @@ struct job *makejob(union node *node, int nprocs) {
|
|||
return jp;
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 12
|
||||
#pragma GCC diagnostic ignored "-Wuse-after-free"
|
||||
#endif
|
||||
|
||||
static struct job *growjobtab(void) {
|
||||
unsigned len;
|
||||
long offset;
|
||||
|
@ -7446,8 +7449,7 @@ 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;
|
||||
|
@ -7660,8 +7662,7 @@ 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++);
|
||||
|
@ -7701,8 +7702,7 @@ 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,8 +8308,7 @@ 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) {
|
||||
|
@ -8432,8 +8431,7 @@ static int xxreadtoken(void) {
|
|||
case '\t':
|
||||
continue;
|
||||
case '#':
|
||||
while ((c = pgetc()) != '\n' && c != PEOF)
|
||||
;
|
||||
while ((c = pgetc()) != '\n' && c != PEOF);
|
||||
pungetc();
|
||||
continue;
|
||||
case '\n':
|
||||
|
@ -8553,7 +8551,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 */
|
||||
|
@ -8701,7 +8699,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;
|
||||
|
@ -8742,7 +8740,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));
|
||||
|
@ -8798,7 +8796,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;
|
||||
|
@ -8910,7 +8908,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;
|
||||
|
@ -9002,7 +9000,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue