]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/options: pin enums to values
authorSage Weil <sage@redhat.com>
Thu, 6 Dec 2018 20:40:53 +0000 (14:40 -0600)
committerSage Weil <sage@redhat.com>
Tue, 18 Dec 2018 20:13:03 +0000 (14:13 -0600)
In case we encode these

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/options.h

index 2d6925c1d897235e90b8eb31bf554c7b7844842f..8b55ac33969d92a1fffe8c6fc974d9ed01653b17 100644 (file)
 
 struct Option {
   enum type_t {
-    TYPE_UINT,
-    TYPE_INT,
-    TYPE_STR,
-    TYPE_FLOAT,
-    TYPE_BOOL,
-    TYPE_ADDR,
-    TYPE_ADDRVEC,
-    TYPE_UUID,
-    TYPE_SIZE,
-    TYPE_SECS,
+    TYPE_UINT = 0,
+    TYPE_INT = 1,
+    TYPE_STR = 2,
+    TYPE_FLOAT = 3,
+    TYPE_BOOL = 4,
+    TYPE_ADDR = 5,
+    TYPE_ADDRVEC = 6,
+    TYPE_UUID = 7,
+    TYPE_SIZE = 8,
+    TYPE_SECS = 9,
   };
 
   const char *type_to_str(type_t t) const {
@@ -47,10 +47,10 @@ struct Option {
    * Development: not for users.  May be dangerous, may not be documented.
    */
   enum level_t {
-    LEVEL_BASIC,
-    LEVEL_ADVANCED,
-    LEVEL_DEV,
-    LEVEL_UNKNOWN,
+    LEVEL_BASIC = 0,
+    LEVEL_ADVANCED = 1,
+    LEVEL_DEV = 2,
+    LEVEL_UNKNOWN = 3,
   };
 
   static const char *level_to_str(level_t l) {