From bbe787a0afd51307cdac2c023895c19df31519ca Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 30 Dec 2020 22:44:54 +0100 Subject: Everywhere: Re-format with clang-format-11 Compared to version 10 this fixes a bunch of formatting issues, mostly around structs/classes with attributes like [[gnu::packed]], and incorrect insertion of spaces in parameter types ("T &"/"T &&"). I also removed a bunch of // clang-format off/on and FIXME comments that are no longer relevant - on the other hand it tried to destroy a couple of neatly formatted comments, so I had to add some as well. --- Libraries/LibC/dirent.cpp | 3 +-- Libraries/LibC/net/if.h | 3 +++ Libraries/LibC/regex.h | 2 ++ Libraries/LibC/sys/arch/i386/regs.h | 3 +-- 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'Libraries/LibC') diff --git a/Libraries/LibC/dirent.cpp b/Libraries/LibC/dirent.cpp index 1d6a932371..8e9701177d 100644 --- a/Libraries/LibC/dirent.cpp +++ b/Libraries/LibC/dirent.cpp @@ -64,8 +64,7 @@ int closedir(DIR* dirp) return rc; } -struct [[gnu::packed]] sys_dirent -{ +struct [[gnu::packed]] sys_dirent { ino_t ino; u8 file_type; size_t namelen; diff --git a/Libraries/LibC/net/if.h b/Libraries/LibC/net/if.h index 9161e2def9..b82258a7b0 100644 --- a/Libraries/LibC/net/if.h +++ b/Libraries/LibC/net/if.h @@ -47,6 +47,8 @@ struct ifreq { void* ifru_data; unsigned int ifru_index; } ifr_ifru; + + // clang-format off #define ifr_addr ifr_ifru.ifru_addr // address #define ifr_dstaddr ifr_ifru.ifru_dstaddr // other end of p-to-p link #define ifr_broadaddr ifr_ifru.ifru_broadaddr // broadcast address @@ -63,6 +65,7 @@ struct ifreq { #define ifr_index ifr_ifru.ifru_index // interface index #define ifr_llprio ifr_ifru.ifru_metric // link layer priority #define ifr_hwaddr ifr_ifru.ifru_hwaddr // MAC address + // clang-format on }; __END_DECLS diff --git a/Libraries/LibC/regex.h b/Libraries/LibC/regex.h index 3fbcadecd7..b7e01ae981 100644 --- a/Libraries/LibC/regex.h +++ b/Libraries/LibC/regex.h @@ -101,6 +101,7 @@ enum __RegexAllFlags { __Regex_Last = __Regex_SkipTrimEmptyMatches }; +// clang-format off // Values for the cflags parameter to the regcomp() function: #define REG_EXTENDED __Regex_Extended // Use Extended Regular Expressions. #define REG_ICASE __Regex_Insensitive // Ignore case in match. @@ -114,6 +115,7 @@ enum __RegexAllFlags { //static_assert (sizeof(FlagsUnderlyingType) * 8 >= regex::POSIXFlags::Last << 1), "flags type too small") #define REG_SEARCH __Regex_Last << 1 +// clang-format on int regcomp(regex_t*, const char*, int); int regexec(const regex_t*, const char*, size_t, regmatch_t[], int); diff --git a/Libraries/LibC/sys/arch/i386/regs.h b/Libraries/LibC/sys/arch/i386/regs.h index f22d070949..d15d0fdd86 100644 --- a/Libraries/LibC/sys/arch/i386/regs.h +++ b/Libraries/LibC/sys/arch/i386/regs.h @@ -28,8 +28,7 @@ #include -struct [[gnu::packed]] PtraceRegisters -{ +struct [[gnu::packed]] PtraceRegisters { u32 eax; u32 ecx; u32 edx; -- cgit v1.2.3