diff options
| author | 2022-04-30 14:47:39 +0100 | |
|---|---|---|
| committer | 2022-04-30 14:47:39 +0100 | |
| commit | 0e7883dd962f16bbac1dd0b4b6a33de3c19ceca1 (patch) | |
| tree | 920e48fe77edffaa8fa6143ac921e5f08daf2eeb | |
| parent | Make the extban enums 8-bit. (diff) | |
| download | inspircd++-0e7883dd962f16bbac1dd0b4b6a33de3c19ceca1.tar.gz inspircd++-0e7883dd962f16bbac1dd0b4b6a33de3c19ceca1.tar.bz2 inspircd++-0e7883dd962f16bbac1dd0b4b6a33de3c19ceca1.zip | |
Format enums with an underlying type like classes.
| -rw-r--r-- | include/ctables.h | 6 | ||||
| -rw-r--r-- | include/modules/regex.h | 3 | ||||
| -rw-r--r-- | include/users.h | 6 | ||||
| -rw-r--r-- | src/modules/m_dnsbl.cpp | 6 | ||||
| -rw-r--r-- | src/modules/m_knock.cpp | 3 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/main.h | 3 |
6 files changed, 18 insertions, 9 deletions
diff --git a/include/ctables.h b/include/ctables.h index d29360e94..63dc2c36c 100644 --- a/include/ctables.h +++ b/include/ctables.h @@ -27,7 +27,8 @@ #pragma once /** Used to indicate the type of a command. */ -enum class CmdAccess : uint8_t +enum class CmdAccess + : uint8_t { /* The command has no special attributes. */ NORMAL = 0, @@ -40,7 +41,8 @@ enum class CmdAccess : uint8_t }; /** Used to indicate the result of trying to execute a command. */ -enum class CmdResult : uint8_t +enum class CmdResult + : uint8_t { /** The command exists and its execution succeeded. */ SUCCESS = 0, diff --git a/include/modules/regex.h b/include/modules/regex.h index 2fc0b2b4a..acb14e480 100644 --- a/include/modules/regex.h +++ b/include/modules/regex.h @@ -37,7 +37,8 @@ namespace Regex typedef std::shared_ptr<Pattern> PatternPtr; /** The options to use when matching a pattern. */ - enum PatternOptions : uint8_t + enum PatternOptions + : uint8_t { /** No special matching options apply. */ OPT_NONE = 0, diff --git a/include/users.h b/include/users.h index 484b24156..a249b6da6 100644 --- a/include/users.h +++ b/include/users.h @@ -62,7 +62,8 @@ public: typedef std::shared_ptr<ConnectClass> Ptr; /** An enumeration of possible types of connect class. */ - enum Type : uint8_t + enum Type + : uint8_t { /** The class defines who is allowed to connect to the server. */ ALLOW = 0, @@ -282,7 +283,8 @@ public: }; /** An enumeration of all possible types of user. */ - enum Type : uint8_t + enum Type + : uint8_t { /** The user is connected to the local server. */ TYPE_LOCAL = 0, diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 96f11d8c3..94ded04b4 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -34,7 +34,8 @@ class DNSBLEntry final { public: - enum class Action : uint8_t + enum class Action + : uint8_t { // G-line users who's IP address is in the DNSBL. GLINE, @@ -52,7 +53,8 @@ public: ZLINE, }; - enum class Type : uint8_t + enum class Type + : uint8_t { // DNSBL results will be compared against the specified bit mask. BITMASK, diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 0e347e078..a24019cd8 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -41,7 +41,8 @@ enum }; // Actions which can be taken when a user knocks on a channel. -enum KnockNotify : uint8_t +enum KnockNotify + : uint8_t { // Send a notice when a user knocks on a channel. KN_SEND_NOTICE = 1, diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index 4beabf967..c78bdd4e1 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -45,7 +45,8 @@ * If you introduce new protocol versions please document them here: * https://docs.inspircd.org/spanningtree/changes */ -enum ProtocolVersion : uint16_t +enum ProtocolVersion + : uint16_t { /** The linking protocol version introduced in InspIRCd v3.0. */ PROTO_INSPIRCD_3 = 1205, |
