From e3c0da2e15014e1e63aad8c63cafe41bd1c2025c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 8 Feb 2020 12:51:40 +0100 Subject: [PATCH] Type: remove unnecessary enum typedefs --- src/Type.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Type.h b/src/Type.h index e46c050395..f81f0e7790 100644 --- a/src/Type.h +++ b/src/Type.h @@ -14,7 +14,7 @@ // BRO types. -typedef enum { +enum TypeTag { TYPE_VOID, // 0 TYPE_BOOL, // 1 TYPE_INT, // 2 @@ -42,25 +42,25 @@ typedef enum { TYPE_TYPE, // 24 TYPE_ERROR // 25 #define NUM_TYPES (int(TYPE_ERROR) + 1) -} TypeTag; +}; constexpr bool is_network_order(TypeTag tag) noexcept { return tag == TYPE_PORT; } -typedef enum { +enum function_flavor { FUNC_FLAVOR_FUNCTION, FUNC_FLAVOR_EVENT, FUNC_FLAVOR_HOOK -} function_flavor; +}; -typedef enum { +enum InternalTypeTag { TYPE_INTERNAL_VOID, TYPE_INTERNAL_INT, TYPE_INTERNAL_UNSIGNED, TYPE_INTERNAL_DOUBLE, TYPE_INTERNAL_STRING, TYPE_INTERNAL_ADDR, TYPE_INTERNAL_SUBNET, TYPE_INTERNAL_OTHER, TYPE_INTERNAL_ERROR -} InternalTypeTag; +}; constexpr InternalTypeTag to_internal_type_tag(TypeTag tag) noexcept {