Meta+Userland: Make clang-format-10 clean

This commit is contained in:
Ben Wiederhake 2020-09-18 09:49:51 +02:00 committed by Andreas Kling
parent 934d4d4033
commit a2feef17bf
Notes: sideshowbarker 2024-07-19 02:14:24 +09:00
7 changed files with 27 additions and 31 deletions

View file

@ -31,8 +31,8 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
int main(int argc, char** argv)

View file

@ -115,7 +115,7 @@ int main(int argc, char** argv)
bool do_read_from_uninitialized_malloc_memory = false;
bool do_read_from_freed_memory = false;
bool do_invalid_stack_pointer_on_syscall = false;
bool do_invalid_stack_pointer_on_page_fault = false;
bool do_invalid_stack_pointer_on_page_fault = false;
bool do_syscall_from_writeable_memory = false;
bool do_write_to_freed_memory_still_cached_by_malloc = false;
bool do_read_from_freed_memory_still_cached_by_malloc = false;
@ -173,7 +173,7 @@ int main(int argc, char** argv)
}).run(run_type);
}
if (do_illegal_instruction|| do_all_crash_types) {
if (do_illegal_instruction || do_all_crash_types) {
Crash("Illegal instruction", []() {
asm volatile("ud2");
return Crash::Failure::DidNotCrash;

View file

@ -42,7 +42,8 @@
// The fractional part in the lower 32 bits stores fractional bits times 2 ** 32.
typedef uint64_t NtpTimestamp;
struct [[gnu::packed]] NtpPacket {
struct [[gnu::packed]] NtpPacket
{
uint8_t li_vn_mode;
uint8_t stratum;
int8_t poll;
@ -182,7 +183,7 @@ int main(int argc, char** argv)
iovec iov { &packet, sizeof(packet) };
char control_message_buffer[CMSG_SPACE(sizeof(timeval))];
msghdr msg = { &peer_address, sizeof(peer_address), &iov, 1, control_message_buffer, sizeof(control_message_buffer), 0};
msghdr msg = { &peer_address, sizeof(peer_address), &iov, 1, control_message_buffer, sizeof(control_message_buffer), 0 };
rc = recvmsg(fd, &msg, 0);
if (rc < 0) {
perror("recvmsg");

View file

@ -27,15 +27,11 @@
#include <stdio.h>
#include <unistd.h>
int main(int, char**)
{
if (reboot() < 0){
if (reboot() < 0) {
perror("reboot");
return 1;
}
return 0;
}

View file

@ -25,8 +25,8 @@
*/
#include <AK/Vector.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/Account.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/GetPassword.h>
#include <stdio.h>
#include <string.h>

View file

@ -31,30 +31,29 @@
#include <sys/mman.h>
#include <unistd.h>
#define EXPECT_OK(syscall, address, size) \
do { \
rc = syscall(fd, (void*)(address), (size_t)(size)); \
if (rc < 0) { \
#define EXPECT_OK(syscall, address, size) \
do { \
rc = syscall(fd, (void*)(address), (size_t)(size)); \
if (rc < 0) { \
fprintf(stderr, "Expected success: " #syscall "(%p, %zu), got rc=%d, errno=%d\n", (void*)(address), (size_t)(size), rc, errno); \
} \
} while(0)
} \
} while (0)
#define EXPECT_EFAULT(syscall, address, size) \
do { \
rc = syscall(fd, (void*)(address), (size_t)(size)); \
if (rc >= 0 || errno != EFAULT) { \
#define EXPECT_EFAULT(syscall, address, size) \
do { \
rc = syscall(fd, (void*)(address), (size_t)(size)); \
if (rc >= 0 || errno != EFAULT) { \
fprintf(stderr, "Expected EFAULT: " #syscall "(%p, %zu), got rc=%d, errno=%d\n", (void*)(address), (size_t)(size), rc, errno); \
} \
} while(0)
} \
} while (0)
#define EXPECT_EFAULT_NO_FD(syscall, address, size) \
do { \
rc = syscall((address), (size_t)(size)); \
if (rc >= 0 || errno != EFAULT) { \
#define EXPECT_EFAULT_NO_FD(syscall, address, size) \
do { \
rc = syscall((address), (size_t)(size)); \
if (rc >= 0 || errno != EFAULT) { \
fprintf(stderr, "Expected EFAULT: " #syscall "(%p, %zu), got rc=%d, errno=%d\n", (void*)(address), (size_t)(size), rc, errno); \
} \
} while(0)
} \
} while (0)
int main(int, char**)
{

View file

@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <AK/String.h>
#include <AK/QuickSort.h>
#include <AK/String.h>
#include <AK/Vector.h>
#include <LibCore/ArgsParser.h>
#include <stdio.h>