From: Kefu Chai Date: Wed, 7 Jun 2017 03:42:32 +0000 (+0800) Subject: common/options: more constness X-Git-Tag: v12.1.2~192^2~39 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc3930a1395d3f6597e9d61e20848f99b9f16dec;p=ceph.git common/options: more constness Signed-off-by: Kefu Chai --- diff --git a/src/common/options.h b/src/common/options.h index e0e097b11b85..743d0b4b7309 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;