Skip to content

Commit

Permalink
Meta: Tweak .clang-format to not wrap braces after enums.
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jun 7, 2019
1 parent 9145917 commit 39d1a9a
Show file tree
Hide file tree
Showing 97 changed files with 186 additions and 312 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ IndentPPDirectives: AfterHash
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterEnum: true
3 changes: 1 addition & 2 deletions AK/AKString.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ class String {
{
}

enum class CaseSensitivity
{
enum class CaseSensitivity {
CaseInsensitive,
CaseSensitive,
};
Expand Down
3 changes: 1 addition & 2 deletions AK/ByteBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ class ByteBufferImpl : public Retainable<ByteBufferImpl> {
void grow(int size);

private:
enum ConstructionMode
{
enum ConstructionMode {
Uninitialized,
Copy,
Wrap,
Expand Down
3 changes: 1 addition & 2 deletions AK/RetainPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ namespace AK {
template<typename T>
class RetainPtr {
public:
enum AdoptTag
{
enum AdoptTag {
Adopt
};

Expand Down
3 changes: 1 addition & 2 deletions AK/Retained.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ inline void release_if_not_null(T* ptr)
template<typename T>
class CONSUMABLE(unconsumed) Retained {
public:
enum AdoptTag
{
enum AdoptTag {
Adopt
};

Expand Down
6 changes: 2 additions & 4 deletions AK/StdLibExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,14 @@ struct RemovePointer<T* const volatile> {

template<typename T, typename U>
struct IsSame {
enum
{
enum {
value = 0
};
};

template<typename T>
struct IsSame<T, T> {
enum
{
enum {
value = 1
};
};
Expand Down
9 changes: 3 additions & 6 deletions AK/StringImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace AK {

enum ShouldChomp
{
enum ShouldChomp {
NoChomp,
Chomp
};
Expand Down Expand Up @@ -40,17 +39,15 @@ class StringImpl : public Retainable<StringImpl> {
}

private:
enum ConstructTheEmptyStringImplTag
{
enum ConstructTheEmptyStringImplTag {
ConstructTheEmptyStringImpl
};
explicit StringImpl(ConstructTheEmptyStringImplTag)
: m_characters("")
{
}

enum ConstructWithInlineBufferTag
{
enum ConstructWithInlineBufferTag {
ConstructWithInlineBuffer
};
StringImpl(ConstructWithInlineBufferTag, ssize_t length);
Expand Down
8 changes: 2 additions & 6 deletions AK/Types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <AK/IterationDecision.h>

#ifdef __serenity__
typedef unsigned char byte;
typedef unsigned short word;
Expand Down Expand Up @@ -48,12 +50,6 @@ constexpr unsigned KB = 1024;
constexpr unsigned MB = KB * KB;
constexpr unsigned GB = KB * KB * KB;

enum class IterationDecision
{
Continue,
Abort
};

namespace std {
typedef decltype(nullptr) nullptr_t;
}
3 changes: 1 addition & 2 deletions Applications/FileManager/DirectoryView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class DirectoryView final : public GStackWidget {
Function<void(const StringView&)> on_status_message;
Function<void(int done, int total)> on_thumbnail_progress;

enum ViewMode
{
enum ViewMode {
Invalid,
List,
Icon
Expand Down
3 changes: 1 addition & 2 deletions Applications/IRCClient/IRCChannelMemberListModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ class IRCChannel;

class IRCChannelMemberListModel final : public GModel {
public:
enum Column
{
enum Column {
Name
};
static Retained<IRCChannelMemberListModel> create(IRCChannel& channel) { return adopt(*new IRCChannelMemberListModel(channel)); }
Expand Down
6 changes: 2 additions & 4 deletions Applications/IRCClient/IRCClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#define IRC_DEBUG

enum IRCNumeric
{
enum IRCNumeric {
RPL_WHOISUSER = 311,
RPL_WHOISSERVER = 312,
RPL_WHOISOPERATOR = 313,
Expand Down Expand Up @@ -106,8 +105,7 @@ void IRCClient::process_line(ByteBuffer&& line)
Vector<char, 32> prefix;
Vector<char, 32> command;
Vector<char, 256> current_parameter;
enum
{
enum {
Start,
InPrefix,
InCommand,
Expand Down
3 changes: 1 addition & 2 deletions Applications/IRCClient/IRCLogBufferModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ class IRCLogBuffer;

class IRCLogBufferModel final : public GModel {
public:
enum Column
{
enum Column {
Timestamp = 0,
Name,
Text,
Expand Down
3 changes: 1 addition & 2 deletions Applications/IRCClient/IRCWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class GTextEditor;

class IRCWindow : public GWidget {
public:
enum Type
{
enum Type {
Server,
Channel,
Query,
Expand Down
3 changes: 1 addition & 2 deletions Applications/IRCClient/IRCWindowListModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class IRCWindow;

class IRCWindowListModel final : public GModel {
public:
enum Column
{
enum Column {
Name,
};

Expand Down
3 changes: 1 addition & 2 deletions Applications/ProcessManager/ProcessModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class GraphWidget;

class ProcessModel final : public GModel {
public:
enum Column
{
enum Column {
Icon = 0,
Name,
CPU,
Expand Down
6 changes: 2 additions & 4 deletions Applications/Terminal/Terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ class Terminal final : public GFrame {
byte foreground_color;
byte background_color;

enum Flags
{
enum Flags {
NoAttributes = 0x00,
Bold = 0x01,
Italic = 0x02,
Expand Down Expand Up @@ -160,8 +159,7 @@ class Terminal final : public GFrame {
void execute_escape_sequence(byte final);
void execute_xterm_command();

enum EscapeState
{
enum EscapeState {
Normal,
ExpectBracket,
ExpectParameter,
Expand Down
3 changes: 1 addition & 2 deletions DevTools/VisualBuilder/VBWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class VBForm;
class VBProperty;
class VBWidgetPropertyModel;

enum class Direction
{
enum class Direction {
None,
Left,
UpLeft,
Expand Down
3 changes: 1 addition & 2 deletions DevTools/VisualBuilder/VBWidgetPropertyModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ class VBProperty;

class VBWidgetPropertyModel : public GModel {
public:
enum Column
{
enum Column {
Name = 0,
Value,
__Count
Expand Down
3 changes: 1 addition & 2 deletions DevTools/VisualBuilder/VBWidgetType.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

enum class VBWidgetType
{
enum class VBWidgetType {
None = 0,
GWidget,
GButton,
Expand Down
3 changes: 1 addition & 2 deletions Games/Minesweeper/Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ class Field final : public GFrame {
template<typename Callback>
void for_each_square(Callback);

enum class Face
{
enum class Face {
Default,
Good,
Bad
Expand Down
2 changes: 1 addition & 1 deletion Kernel/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions Kernel/FileSystem/FIFO.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class FileDescription;

class FIFO final : public File {
public:
enum class Direction : byte
{
enum class Direction : byte {
Neither,
Reader,
Writer
Expand Down
2 changes: 1 addition & 1 deletion Kernel/FileSystem/FileDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions Kernel/FileSystem/ProcFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
#include <Kernel/kmalloc.h>
#include <LibC/errno_numbers.h>

enum ProcParentDirectory
{
enum ProcParentDirectory {
PDI_AbstractRoot = 0,
PDI_Root,
PDI_Root_sys,
PDI_PID,
PDI_PID_fd,
};

enum ProcFileType
{
enum ProcFileType {
FI_Invalid = 0,

FI_Root = 1, // directory
Expand Down Expand Up @@ -601,8 +599,7 @@ ByteBuffer procfs$inodes(InodeIdentifier)
struct SysVariableData final : public ProcFSInodeCustomData {
virtual ~SysVariableData() override {}

enum Type
{
enum Type {
Invalid,
Boolean,
String,
Expand Down
3 changes: 1 addition & 2 deletions Kernel/KResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#include <AK/Assertions.h>
#include <LibC/errno_numbers.h>

enum KSuccessTag
{
enum KSuccessTag {
KSuccess
};

Expand Down
6 changes: 2 additions & 4 deletions Kernel/KeyCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

#include <AK/Types.h>

enum KeyCode : byte
{
enum KeyCode : byte {
Key_Invalid = 0,
Key_Escape,
Key_Tab,
Expand Down Expand Up @@ -114,8 +113,7 @@ enum KeyCode : byte
Key_Shift = Key_LeftShift,
};

enum KeyModifier
{
enum KeyModifier {
Mod_None = 0x00,
Mod_Alt = 0x01,
Mod_Ctrl = 0x02,
Expand Down
6 changes: 2 additions & 4 deletions Kernel/Net/ARP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Net/EtherType.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#include <AK/Types.h>

struct EtherType {
enum : word
{
enum : word {
ARP = 0x0806,
IPv4 = 0x0800,
};
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Net/ICMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include <Kernel/Net/MACAddress.h>

struct ICMPType {
enum
{
enum {
EchoReply = 0,
EchoRequest = 8,
};
Expand Down
3 changes: 1 addition & 2 deletions Kernel/Net/IPv4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 39d1a9a

Please sign in to comment.