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

Meta: Tweak .clang-format to not wrap braces after enums.

This commit is contained in:
Andreas Kling 2019-06-07 17:13:23 +02:00
parent 9145917bf0
commit 39d1a9ae66
97 changed files with 186 additions and 312 deletions

View file

@ -5,8 +5,8 @@
#include <AK/Retained.h>
#include <AK/Types.h>
#include <Kernel/KResult.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/UnixTypes.h>
#include <Kernel/VirtualAddress.h>
class FileDescription;
class Process;

View file

@ -8,8 +8,7 @@ class FileDescription;
class FIFO final : public File {
public:
enum class Direction : byte
{
enum class Direction : byte {
Neither,
Reader,
Writer

View file

@ -8,8 +8,8 @@
#include <Kernel/FileSystem/Inode.h>
#include <Kernel/FileSystem/InodeMetadata.h>
#include <Kernel/FileSystem/VirtualFileSystem.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/Net/Socket.h>
#include <Kernel/VirtualAddress.h>
class File;
class TTY;

View file

@ -14,8 +14,7 @@
#include <Kernel/kmalloc.h>
#include <LibC/errno_numbers.h>
enum ProcParentDirectory
{
enum ProcParentDirectory {
PDI_AbstractRoot = 0,
PDI_Root,
PDI_Root_sys,
@ -23,8 +22,7 @@ enum ProcParentDirectory
PDI_PID_fd,
};
enum ProcFileType
{
enum ProcFileType {
FI_Invalid = 0,
FI_Root = 1, // directory
@ -601,8 +599,7 @@ ByteBuffer procfs$inodes(InodeIdentifier)
struct SysVariableData final : public ProcFSInodeCustomData {
virtual ~SysVariableData() override {}
enum Type
{
enum Type {
Invalid,
Boolean,
String,

View file

@ -3,8 +3,7 @@
#include <AK/Assertions.h>
#include <LibC/errno_numbers.h>
enum KSuccessTag
{
enum KSuccessTag {
KSuccess
};

View file

@ -2,8 +2,7 @@
#include <AK/Types.h>
enum KeyCode : byte
{
enum KeyCode : byte {
Key_Invalid = 0,
Key_Escape,
Key_Tab,
@ -114,8 +113,7 @@ enum KeyCode : byte
Key_Shift = Key_LeftShift,
};
enum KeyModifier
{
enum KeyModifier {
Mod_None = 0x00,
Mod_Alt = 0x01,
Mod_Ctrl = 0x02,

View file

@ -5,16 +5,14 @@
#include <Kernel/Net/MACAddress.h>
struct ARPOperation {
enum : word
{
enum : word {
Request = 1,
Response = 2,
};
};
struct ARPHardwareType {
enum : word
{
enum : word {
Ethernet = 1,
};
};

View file

@ -3,8 +3,7 @@
#include <AK/Types.h>
struct EtherType {
enum : word
{
enum : word {
ARP = 0x0806,
IPv4 = 0x0800,
};

View file

@ -4,8 +4,7 @@
#include <Kernel/Net/MACAddress.h>
struct ICMPType {
enum
{
enum {
EchoReply = 0,
EchoRequest = 8,
};

View file

@ -5,8 +5,7 @@
#include <AK/NetworkOrdered.h>
#include <AK/Types.h>
enum class IPv4Protocol : word
{
enum class IPv4Protocol : word {
ICMP = 1,
TCP = 6,
UDP = 17,

View file

@ -9,16 +9,14 @@
#include <Kernel/Lock.h>
#include <Kernel/UnixTypes.h>
enum class SocketRole : byte
{
enum class SocketRole : byte {
None,
Listener,
Accepted,
Connected,
Connecting
};
enum class ShouldBlock
{
enum class ShouldBlock {
No = 0,
Yes = 1
};

View file

@ -3,8 +3,7 @@
#include <Kernel/Net/IPv4.h>
struct TCPFlags {
enum : word
{
enum : word {
FIN = 0x01,
SYN = 0x02,
RST = 0x04,

View file

@ -7,8 +7,7 @@ public:
static Retained<TCPSocket> create(int protocol);
virtual ~TCPSocket() override;
enum class State
{
enum class State {
Disconnected,
Connecting,
Connected,

View file

@ -1441,8 +1441,7 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
return current->m_waitee_pid;
}
enum class KernelMemoryCheckResult
{
enum class KernelMemoryCheckResult {
NotInsideKernelMemory,
AccessGranted,
AccessDenied
@ -2654,7 +2653,7 @@ int Process::sys$donate(int tid)
for_each_thread([&](Thread& thread) {
if (thread.tid() == tid) {
beneficiary = &thread;
return IterationDecision::Abort;
return IterationDecision::Break;
}
return IterationDecision::Continue;
});

View file

@ -38,8 +38,7 @@ public:
static Vector<pid_t> all_pids();
static Vector<Process*> all_processes();
enum Priority
{
enum Priority {
IdlePriority,
FirstPriority = IdlePriority,
LowPriority,
@ -48,8 +47,7 @@ public:
LastPriority = HighPriority,
};
enum RingLevel
{
enum RingLevel {
Ring0 = 0,
Ring3 = 3,
};
@ -398,7 +396,7 @@ inline void Process::for_each(Callback callback)
ASSERT_INTERRUPTS_DISABLED();
for (auto* process = g_processes->head(); process;) {
auto* next_process = process->next();
if (callback(*process) == IterationDecision::Abort)
if (callback(*process) == IterationDecision::Break)
break;
process = next_process;
}
@ -427,7 +425,7 @@ inline void Process::for_each_thread(Callback callback) const
for (auto* thread = g_runnable_threads->head(); thread;) {
auto* next_thread = thread->next();
if (thread->pid() == my_pid) {
if (callback(*thread) == IterationDecision::Abort)
if (callback(*thread) == IterationDecision::Break)
break;
}
thread = next_thread;
@ -435,7 +433,7 @@ inline void Process::for_each_thread(Callback callback) const
for (auto* thread = g_nonrunnable_threads->head(); thread;) {
auto* next_thread = thread->next();
if (thread->pid() == my_pid) {
if (callback(*thread) == IterationDecision::Abort)
if (callback(*thread) == IterationDecision::Break)
break;
}
thread = next_thread;

View file

@ -3,7 +3,9 @@
#include <AK/Types.h>
#include <LibC/fd_set.h>
extern "C" { struct timeval; }
extern "C" {
struct timeval;
}
#define ENUMERATE_SYSCALLS \
__ENUMERATE_SYSCALL(sleep) \
@ -114,8 +116,7 @@ extern "C" { struct timeval; }
namespace Syscall {
enum Function
{
enum Function {
#undef __ENUMERATE_SYSCALL
#define __ENUMERATE_SYSCALL(x) SC_##x,
ENUMERATE_SYSCALLS

View file

@ -128,8 +128,7 @@ inline bool is_valid_final_character(byte ch)
return ch >= 0x40 && ch <= 0x7e;
}
enum class VGAColor : byte
{
enum class VGAColor : byte {
Black = 0,
Blue,
Green,
@ -148,8 +147,7 @@ enum class VGAColor : byte
White,
};
enum class ANSIColor : byte
{
enum class ANSIColor : byte {
Black = 0,
Red,
Green,

View file

@ -9,8 +9,7 @@ class VirtualConsole final : public TTY
, public ConsoleImplementation {
AK_MAKE_ETERNAL
public:
enum InitialContents
{
enum InitialContents {
Cleared,
AdoptCurrentVGABuffer
};
@ -73,8 +72,7 @@ private:
void execute_escape_sequence(byte final);
enum EscapeState
{
enum EscapeState {
Normal,
ExpectBracket,
ExpectParameter,

View file

@ -254,8 +254,7 @@ ShouldUnblockThread Thread::dispatch_one_pending_signal()
return dispatch_signal(signal);
}
enum class DefaultSignalAction
{
enum class DefaultSignalAction {
Terminate,
Ignore,
DumpCore,

View file

@ -6,9 +6,9 @@
#include <AK/RetainPtr.h>
#include <AK/Vector.h>
#include <Kernel/KResult.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/UnixTypes.h>
#include <Kernel/VM/Region.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/i386.h>
class Alarm;
@ -17,8 +17,7 @@ class Process;
class Region;
class Thread;
enum class ShouldUnblockThread
{
enum class ShouldUnblockThread {
No = 0,
Yes
};
@ -54,8 +53,7 @@ public:
void finalize();
enum State : byte
{
enum State : byte {
Invalid = 0,
Runnable,
Running,
@ -245,7 +243,7 @@ inline void Thread::for_each_runnable(Callback callback)
ASSERT_INTERRUPTS_DISABLED();
for (auto* thread = g_runnable_threads->head(); thread;) {
auto* next_thread = thread->next();
if (callback(*thread) == IterationDecision::Abort)
if (callback(*thread) == IterationDecision::Break)
return;
thread = next_thread;
}
@ -257,7 +255,7 @@ inline void Thread::for_each_nonrunnable(Callback callback)
ASSERT_INTERRUPTS_DISABLED();
for (auto* thread = g_nonrunnable_threads->head(); thread;) {
auto* next_thread = thread->next();
if (callback(*thread) == IterationDecision::Abort)
if (callback(*thread) == IterationDecision::Break)
return;
thread = next_thread;
}

View file

@ -12,17 +12,16 @@
#include <AK/Vector.h>
#include <AK/Weakable.h>
#include <Kernel/FileSystem/InodeIdentifier.h>
#include <Kernel/VirtualAddress.h>
#include <Kernel/VM/PhysicalPage.h>
#include <Kernel/VM/Region.h>
#include <Kernel/VM/VMObject.h>
#include <Kernel/VirtualAddress.h>
#define PAGE_ROUND_UP(x) ((((dword)(x)) + PAGE_SIZE - 1) & (~(PAGE_SIZE - 1)))
class SynthFSInode;
enum class PageFaultResponse
{
enum class PageFaultResponse {
ShouldCrash,
Continue,
};
@ -55,8 +54,7 @@ public:
bool validate_user_read(const Process&, VirtualAddress) const;
bool validate_user_write(const Process&, VirtualAddress) const;
enum class ShouldZeroFill
{
enum class ShouldZeroFill {
No,
Yes
};
@ -126,8 +124,7 @@ private:
dword raw() const { return *m_pde; }
dword* ptr() { return m_pde; }
enum Flags
{
enum Flags {
Present = 1 << 0,
ReadWrite = 1 << 1,
UserSupervisor = 1 << 2,
@ -177,8 +174,7 @@ private:
dword raw() const { return *m_pte; }
dword* ptr() { return m_pte; }
enum Flags
{
enum Flags {
Present = 1 << 0,
ReadWrite = 1 << 1,
UserSupervisor = 1 << 2,

View file

@ -12,8 +12,7 @@ class Region : public Retainable<Region> {
friend class MemoryManager;
public:
enum Access
{
enum Access {
Read = 1,
Write = 2,
Execute = 4,

View file

@ -49,8 +49,7 @@ union [[gnu::packed]] Descriptor
dword high;
};
enum Type
{
enum Type {
Invalid = 0,
AvailableTSS_16bit = 0x1,
LDT = 0x2,
@ -180,8 +179,7 @@ private:
#define IRQ_VECTOR_BASE 0x50
struct PageFaultFlags {
enum Flags
{
enum Flags {
NotPresent = 0x00,
ProtectionViolation = 0x01,
Read = 0x00,