From bc3930a1395d3f6597e9d61e20848f99b9f16dec Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 7 Jun 2017 11:42:32 +0800 Subject: [PATCH] common/options: more constness Signed-off-by: Kefu Chai --- src/common/options.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/options.h b/src/common/options.h index e0e097b11b8..743d0b4b730 100644 --- a/src/common/options.h +++ b/src/common/options.h @@ -11,14 +11,14 @@ //#include "msg/msg_types.h" struct Option { - typedef enum { + enum type_t { TYPE_INT, TYPE_STR, TYPE_FLOAT, TYPE_BOOL, TYPE_ADDR, TYPE_UUID, - } type_t; + }; const char *type_to_str(type_t t) { switch (t) { @@ -32,11 +32,11 @@ struct Option { } } - typedef enum { + enum level_t { LEVEL_BASIC, LEVEL_ADVANCED, LEVEL_DEV, - } level_t; + }; using value_t = boost::variant< std::string, @@ -45,9 +45,9 @@ struct Option { bool//, //entity_addr_t, /*uuid_d*/>; - std::string name; - type_t type; - level_t level; + const std::string name; + const type_t type; + const level_t level; std::string desc; std::string long_desc; -- 2.39.5