mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-26 14:28:30 +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
|
@ -61,9 +61,12 @@ TEST(setrlimit, testCpuLimit) {
|
|||
struct rlimit rlim;
|
||||
struct timespec start;
|
||||
double matrices[3][3][3];
|
||||
if (IsWindows()) return; // of course it doesn't work on windows
|
||||
if (IsXnu()) return; // TODO(jart): it worked before
|
||||
if (IsOpenbsd()) return; // TODO(jart): fix flake
|
||||
if (IsWindows())
|
||||
return; // of course it doesn't work on windows
|
||||
if (IsXnu())
|
||||
return; // TODO(jart): it worked before
|
||||
if (IsOpenbsd())
|
||||
return; // TODO(jart): fix flake
|
||||
ASSERT_NE(-1, (wstatus = xspawn(0)));
|
||||
if (wstatus == -2) {
|
||||
ASSERT_EQ(0, xsigaction(SIGXCPU, OnSigxcpu, 0, 0, 0));
|
||||
|
@ -89,7 +92,8 @@ TEST(setrlimit, testFileSizeLimit) {
|
|||
char junkdata[512];
|
||||
int i, fd, wstatus;
|
||||
struct rlimit rlim;
|
||||
if (IsWindows()) return; /* of course it doesn't work on windows */
|
||||
if (IsWindows())
|
||||
return; /* of course it doesn't work on windows */
|
||||
ASSERT_NE(-1, (wstatus = xspawn(0)));
|
||||
if (wstatus == -2) {
|
||||
ASSERT_EQ(0, xsigaction(SIGXFSZ, OnSigxfsz, 0, 0, 0));
|
||||
|
@ -125,8 +129,10 @@ TEST(setrlimit, testMemoryLimit) {
|
|||
char *p;
|
||||
bool gotsome;
|
||||
int i, wstatus;
|
||||
if (IsXnu()) return;
|
||||
if (IsAsan()) return; /* b/c we use sys_mmap */
|
||||
if (IsXnu())
|
||||
return;
|
||||
if (IsAsan())
|
||||
return; /* b/c we use sys_mmap */
|
||||
ASSERT_NE(-1, (wstatus = xspawn(0)));
|
||||
if (wstatus == -2) {
|
||||
ASSERT_EQ(0, SetKernelEnforcedMemoryLimit(MEM));
|
||||
|
@ -156,10 +162,14 @@ TEST(setrlimit, testMemoryLimit) {
|
|||
TEST(setrlimit, testVirtualMemoryLimit) {
|
||||
char *p;
|
||||
int i, wstatus;
|
||||
if (IsAsan()) return;
|
||||
if (IsXnu()) return; /* doesn't work on darwin */
|
||||
if (IsOpenbsd()) return; /* unavailable on openbsd */
|
||||
if (IsWindows()) return; /* of course it doesn't work on windows */
|
||||
if (IsAsan())
|
||||
return;
|
||||
if (IsXnu())
|
||||
return; /* doesn't work on darwin */
|
||||
if (IsOpenbsd())
|
||||
return; /* unavailable on openbsd */
|
||||
if (IsWindows())
|
||||
return; /* of course it doesn't work on windows */
|
||||
ASSERT_NE(-1, (wstatus = xspawn(0)));
|
||||
if (wstatus == -2) {
|
||||
ASSERT_EQ(0, setrlimit(RLIMIT_AS, &(struct rlimit){MEM, MEM}));
|
||||
|
@ -184,12 +194,18 @@ TEST(setrlimit, testVirtualMemoryLimit) {
|
|||
TEST(setrlimit, testDataMemoryLimit) {
|
||||
char *p;
|
||||
int i, wstatus;
|
||||
if (IsAsan()) return;
|
||||
if (IsXnu()) return; /* doesn't work on darwin */
|
||||
if (IsNetbsd()) return; /* doesn't work on netbsd */
|
||||
if (IsFreebsd()) return; /* doesn't work on freebsd */
|
||||
if (IsLinux()) return; /* doesn't work on gnu/systemd */
|
||||
if (IsWindows()) return; /* of course it doesn't work on windows */
|
||||
if (IsAsan())
|
||||
return;
|
||||
if (IsXnu())
|
||||
return; /* doesn't work on darwin */
|
||||
if (IsNetbsd())
|
||||
return; /* doesn't work on netbsd */
|
||||
if (IsFreebsd())
|
||||
return; /* doesn't work on freebsd */
|
||||
if (IsLinux())
|
||||
return; /* doesn't work on gnu/systemd */
|
||||
if (IsWindows())
|
||||
return; /* of course it doesn't work on windows */
|
||||
ASSERT_NE(-1, (wstatus = xspawn(0)));
|
||||
if (wstatus == -2) {
|
||||
ASSERT_EQ(0, setrlimit(RLIMIT_DATA, &(struct rlimit){MEM, MEM}));
|
||||
|
@ -231,7 +247,8 @@ wontreturn void OnVfork(void *ctx) {
|
|||
TEST(setrlimit, isVforkSafe) {
|
||||
int ws;
|
||||
struct rlimit rlim[2];
|
||||
if (IsWindows()) return; /* of course it doesn't work on windows */
|
||||
if (IsWindows())
|
||||
return; /* of course it doesn't work on windows */
|
||||
ASSERT_EQ(0, getrlimit(RLIMIT_CPU, rlim));
|
||||
ASSERT_NE(-1, (ws = xvspawn(OnVfork, rlim, 0)));
|
||||
EXPECT_TRUE(WIFEXITED(ws));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue