1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00

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 <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
int main(int argc, char** argv) int main(int argc, char** argv)

View file

@ -173,7 +173,7 @@ int main(int argc, char** argv)
}).run(run_type); }).run(run_type);
} }
if (do_illegal_instruction|| do_all_crash_types) { if (do_illegal_instruction || do_all_crash_types) {
Crash("Illegal instruction", []() { Crash("Illegal instruction", []() {
asm volatile("ud2"); asm volatile("ud2");
return Crash::Failure::DidNotCrash; return Crash::Failure::DidNotCrash;

View file

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

View file

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

View file

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

View file

@ -37,7 +37,7 @@
if (rc < 0) { \ if (rc < 0) { \
fprintf(stderr, "Expected success: " #syscall "(%p, %zu), got rc=%d, errno=%d\n", (void*)(address), (size_t)(size), rc, errno); \ 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) \ #define EXPECT_EFAULT(syscall, address, size) \
do { \ do { \
@ -45,7 +45,7 @@
if (rc >= 0 || errno != EFAULT) { \ 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); \ 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) \ #define EXPECT_EFAULT_NO_FD(syscall, address, size) \
do { \ do { \
@ -53,8 +53,7 @@
if (rc >= 0 || errno != EFAULT) { \ 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); \ 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**) int main(int, char**)
{ {

View file

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