mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Type: remove unnecessary enum typedefs
This commit is contained in:
parent
b1fe483b05
commit
e3c0da2e15
1 changed files with 6 additions and 6 deletions
12
src/Type.h
12
src/Type.h
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
// BRO types.
|
// BRO types.
|
||||||
|
|
||||||
typedef enum {
|
enum TypeTag {
|
||||||
TYPE_VOID, // 0
|
TYPE_VOID, // 0
|
||||||
TYPE_BOOL, // 1
|
TYPE_BOOL, // 1
|
||||||
TYPE_INT, // 2
|
TYPE_INT, // 2
|
||||||
|
@ -42,25 +42,25 @@ typedef enum {
|
||||||
TYPE_TYPE, // 24
|
TYPE_TYPE, // 24
|
||||||
TYPE_ERROR // 25
|
TYPE_ERROR // 25
|
||||||
#define NUM_TYPES (int(TYPE_ERROR) + 1)
|
#define NUM_TYPES (int(TYPE_ERROR) + 1)
|
||||||
} TypeTag;
|
};
|
||||||
|
|
||||||
constexpr bool is_network_order(TypeTag tag) noexcept
|
constexpr bool is_network_order(TypeTag tag) noexcept
|
||||||
{
|
{
|
||||||
return tag == TYPE_PORT;
|
return tag == TYPE_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef enum {
|
enum function_flavor {
|
||||||
FUNC_FLAVOR_FUNCTION,
|
FUNC_FLAVOR_FUNCTION,
|
||||||
FUNC_FLAVOR_EVENT,
|
FUNC_FLAVOR_EVENT,
|
||||||
FUNC_FLAVOR_HOOK
|
FUNC_FLAVOR_HOOK
|
||||||
} function_flavor;
|
};
|
||||||
|
|
||||||
typedef enum {
|
enum InternalTypeTag {
|
||||||
TYPE_INTERNAL_VOID,
|
TYPE_INTERNAL_VOID,
|
||||||
TYPE_INTERNAL_INT, TYPE_INTERNAL_UNSIGNED, TYPE_INTERNAL_DOUBLE,
|
TYPE_INTERNAL_INT, TYPE_INTERNAL_UNSIGNED, TYPE_INTERNAL_DOUBLE,
|
||||||
TYPE_INTERNAL_STRING, TYPE_INTERNAL_ADDR, TYPE_INTERNAL_SUBNET,
|
TYPE_INTERNAL_STRING, TYPE_INTERNAL_ADDR, TYPE_INTERNAL_SUBNET,
|
||||||
TYPE_INTERNAL_OTHER, TYPE_INTERNAL_ERROR
|
TYPE_INTERNAL_OTHER, TYPE_INTERNAL_ERROR
|
||||||
} InternalTypeTag;
|
};
|
||||||
|
|
||||||
constexpr InternalTypeTag to_internal_type_tag(TypeTag tag) noexcept
|
constexpr InternalTypeTag to_internal_type_tag(TypeTag tag) noexcept
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue