mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Apply clang-format update to repo (#1154)
Commit bc6c183
introduced a bunch of discrepancies between what files
look like in the repo and what clang-format says they should look like.
However, there were already a few discrepancies prior to that. Most of
these discrepancies seemed to be unintentional, but a few of them were
load-bearing (e.g., a #include that violated header ordering needing
something to have been #defined by a 'later' #include.)
I opted to take what I hope is a relatively smooth-brained approach: I
reverted the .clang-format change, ran clang-format on the whole repo,
reapplied the .clang-format change, reran clang-format again, and then
reverted the commit that contained the first run. Thus the full effect
of this PR should only be to apply the changed formatting rules to the
repo, and from skimming the results, this seems to be the case.
My work can be checked by applying the short, manual commits, and then
rerunning the command listed in the autogenerated commits (those whose
messages I have prefixed auto:) and seeing if your results agree.
It might be that the other diffs should be fixed at some point but I'm
leaving that aside for now.
fd '\.c(c|pp)?$' --print0| xargs -0 clang-format -i
This commit is contained in:
parent
342d0c81e5
commit
6e6fc38935
863 changed files with 9201 additions and 4627 deletions
|
@ -873,11 +873,13 @@ void PrintDebruijn(int x, int head, int depth, FILE* f) {
|
|||
} else {
|
||||
fputwc(L'λ', f);
|
||||
}
|
||||
if (!(0 <= x && x < TERMS)) goto Overflow;
|
||||
if (!(0 <= x && x < TERMS))
|
||||
goto Overflow;
|
||||
} while (mem[x] == ABS);
|
||||
fputc(' ', f);
|
||||
}
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS)) goto Overflow;
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS))
|
||||
goto Overflow;
|
||||
if (mem[x] == APP) {
|
||||
fputc('[', f);
|
||||
PrintDebruijn(x + 2, 1, depth, f);
|
||||
|
@ -1162,11 +1164,13 @@ void PrintLambda(int x, int head, int depth, int apps, FILE* f) {
|
|||
do {
|
||||
++x;
|
||||
fputwc(ALPHABET[depth++], f);
|
||||
if (!(0 <= x && x < TERMS)) goto Overflow;
|
||||
if (!(0 <= x && x < TERMS))
|
||||
goto Overflow;
|
||||
} while (mem[x] == ABS);
|
||||
fputc('.', f);
|
||||
}
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS)) goto Overflow;
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS))
|
||||
goto Overflow;
|
||||
if (mem[x] == VAR) {
|
||||
if (0 <= x + 1 && x + 1 < TERMS) {
|
||||
PrintVar(depth - 1 - mem[x + 1], f);
|
||||
|
@ -1182,7 +1186,8 @@ void PrintLambda(int x, int head, int depth, int apps, FILE* f) {
|
|||
}
|
||||
PrintLambda(x + 2, 1, depth, apps + 1, f);
|
||||
if (!(x + 2 + mem[x + 1] < TERMS && mem[x + 2 + mem[x + 1]] == APP)) {
|
||||
if (safer || !noname) fputc(' ', f);
|
||||
if (safer || !noname)
|
||||
fputc(' ', f);
|
||||
}
|
||||
PrintLambda(x + 2 + mem[x + 1], 0, depth, apps + 1, f);
|
||||
} else if (mem[x] == IOP) {
|
||||
|
@ -1230,10 +1235,12 @@ void PrintBinary(int x, int head, int depth, FILE* f) {
|
|||
++depth;
|
||||
fputc('0', f);
|
||||
fputc('0', f);
|
||||
if (!(0 <= x && x < TERMS)) goto Overflow;
|
||||
if (!(0 <= x && x < TERMS))
|
||||
goto Overflow;
|
||||
} while (mem[x] == ABS);
|
||||
}
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS)) goto Overflow;
|
||||
if (!(0 <= (x + 1) && (x + 1) < TERMS))
|
||||
goto Overflow;
|
||||
if (mem[x] == VAR) {
|
||||
if (0 <= x + 1 && x + 1 < TERMS) {
|
||||
PrintVar(mem[x + 1], f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue