1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:47:44 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -18,7 +18,7 @@ TEST_CASE(test_nonexistent_pledge)
TEST_CASE(test_pledge_argument_validation)
{
const auto long_argument = String::repeated('a', 2048);
auto const long_argument = String::repeated('a', 2048);
auto res = pledge(long_argument.characters(), "stdio");
EXPECT_EQ(res, -1);

View file

@ -13,7 +13,7 @@
int main(int, char**)
{
constexpr const char* path = "/tmp/foo";
constexpr char const* path = "/tmp/foo";
int rc = symlink("bar", path);
if (rc < 0) {
perror("symlink");

View file

@ -16,7 +16,7 @@
#include <sys/wait.h>
#include <unistd.h>
volatile bool hax = false;
bool volatile hax = false;
int main()
{

View file

@ -32,7 +32,7 @@ static bool is_nosys_syscall(int fn)
return fn == SC_futex || fn == SC_emuctl;
}
static bool is_bad_idea(int fn, const size_t* direct_sc_args, const size_t* fake_sc_params, const char* some_string)
static bool is_bad_idea(int fn, size_t const* direct_sc_args, size_t const* fake_sc_params, char const* some_string)
{
switch (fn) {
case SC_mprotect:
@ -78,7 +78,7 @@ static void do_systematic_tests()
VERIFY(rc == -ENOSYS);
}
static void randomize_from(size_t* buffer, size_t len, const Vector<size_t>& values)
static void randomize_from(size_t* buffer, size_t len, Vector<size_t> const& values)
{
for (size_t i = 0; i < len; ++i) {
buffer[i] = values[get_random_uniform(values.size())];
@ -122,7 +122,7 @@ static void do_random_tests()
size_t direct_sc_args[3] = { 0 };
// Isolate to a separate region to make corruption less likely, because we will write to it:
auto* fake_sc_params = reinterpret_cast<size_t*>(mmap(nullptr, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_RANDOMIZED, 0, 0));
const char* some_string = "Hello, world!";
char const* some_string = "Hello, world!";
Vector<size_t> interesting_values = {
0,
1,
@ -134,7 +134,7 @@ static void do_random_tests()
0xffffffff,
};
dbgln("Doing a few random syscalls with:");
for (const auto& interesting_value : interesting_values) {
for (auto const& interesting_value : interesting_values) {
dbgln(" {0} ({0:p})", interesting_value);
}
for (size_t i = 0; i < fuzz_syscall_count; ++i) {

View file

@ -55,7 +55,7 @@ static void fork_into(void(fn)())
static void thread_into(void* (*fn)(void*))
{
pthread_t tid;
const int rc = pthread_create(&tid, nullptr, fn, nullptr);
int const rc = pthread_create(&tid, nullptr, fn, nullptr);
if (rc < 0) {
perror("pthread_create");
exit(1);
@ -64,7 +64,7 @@ static void thread_into(void* (*fn)(void*))
static void sleep_steps(useconds_t steps)
{
const int rc = usleep(steps * STEP_SIZE);
int const rc = usleep(steps * STEP_SIZE);
if (rc < 0) {
perror("usleep");
VERIFY_NOT_REACHED();

View file

@ -67,7 +67,7 @@ int main()
return 1;
}
//cleanup
// cleanup
munmap(map1, 6 * PAGE_SIZE);
outln("PASS");

View file

@ -19,7 +19,7 @@ static void signal_printer(int)
typedef struct yank_shared_t {
timespec* remaining_sleep;
// TODO: Be nice and use thread ID
//pthread_t sleeper_thread;
// pthread_t sleeper_thread;
} yank_shared_t;
static void* yanker_fn(void* shared_)

View file

@ -14,7 +14,7 @@
#include <unistd.h>
struct worker_t {
const char* name;
char const* name;
int count;
pthread_t thread;
pthread_mutex_t lock;
@ -45,7 +45,7 @@ static void* run_worker(void* args)
return nullptr;
}
static void init_worker(worker_t* worker, const char* name, long int wait_time)
static void init_worker(worker_t* worker, char const* name, long int wait_time)
{
worker->name = name;
worker->wait_time = wait_time;

View file

@ -57,7 +57,7 @@ static void fork_into(void (*fn)(void*), void* arg)
exit(1);
}
if (rc > 0) {
const int disown_rc = disown(rc);
int const disown_rc = disown(rc);
if (disown_rc < 0) {
perror("disown");
dbgln("This might cause PA1 to remain in the Zombie state, "
@ -73,7 +73,7 @@ static void fork_into(void (*fn)(void*), void* arg)
static void sleep_steps(useconds_t steps)
{
const int rc = usleep(steps * STEP_SIZE);
int const rc = usleep(steps * STEP_SIZE);
if (rc < 0) {
perror("usleep");
VERIFY_NOT_REACHED();

View file

@ -17,7 +17,7 @@ volatile ucontext_t saved_ucontext;
siginfo_t* sig_info_addr;
ucontext_t* ucontext_addr;
void* stack_ptr;
volatile bool signal_was_delivered = false;
bool volatile signal_was_delivered = false;
static void signal_handler(int sig, siginfo_t* sig_info, void* u_context)
{

View file

@ -13,7 +13,7 @@
int main(int argc, char** argv)
{
const char* target = nullptr;
char const* target = nullptr;
int max_file_size = 1024 * 1024;
int count = 1024;

View file

@ -60,7 +60,7 @@ bool write_block(int fd, int seed, off_t block, AK::ByteBuffer& buffer)
int main(int argc, char** argv)
{
const char* target = nullptr;
char const* target = nullptr;
int min_block_offset = 0;
int block_length = 2048;
int block_size = 512;