]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/options: more constness
authorKefu Chai <kchai@redhat.com>
Wed, 7 Jun 2017 03:42:32 +0000 (11:42 +0800)
committerJohn Spray <john.spray@redhat.com>
Fri, 21 Jul 2017 10:27:23 +0000 (06:27 -0400)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.h

index e0e097b11b85f475ac0c82e5159e8dbc72f77ee8..743d0b4b7309d7936ad4820c53411f8e132c1130 100644 (file)
 //#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;