summaryrefslogtreecommitdiff
path: root/include/my_getopt.h
diff options
context:
space:
mode:
authorunknown <jani@a80-186-24-72.elisa-laajakaista.fi>2004-07-08 17:12:42 +0300
committerunknown <jani@a80-186-24-72.elisa-laajakaista.fi>2004-07-08 17:12:42 +0300
commit85c57e7048362f91b42015f41cc9831673f288ee (patch)
tree7ffa28a0902a9ee83d45aad1f1632fe0199bbce5 /include/my_getopt.h
parent1a22b760b36178cac5b2ae2b5c9ddb14d12e956b (diff)
downloadmariadb-git-85c57e7048362f91b42015f41cc9831673f288ee.tar.gz
Fixed Bug#4451. According to C/C++ standards, enums should not be used
out of their range.
Diffstat (limited to 'include/my_getopt.h')
-rw-r--r--include/my_getopt.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 3b4551b445e..11ecc66fac3 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -16,8 +16,17 @@
C_MODE_START
-enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_INT, GET_UINT, GET_LONG,
- GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC };
+#define GET_NO_ARG 1
+#define GET_BOOL 2
+#define GET_INT 3
+#define GET_UINT 4
+#define GET_LONG 5
+#define GET_ULONG 6
+#define GET_LL 7
+#define GET_ULL 8
+#define GET_STR 9
+#define GET_STR_ALLOC 10
+
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
struct my_option
@@ -28,7 +37,7 @@ struct my_option
gptr *value; /* The variable value */
gptr *u_max_value; /* The user def. max variable value */
const char **str_values; /* Pointer to possible values */
- enum get_opt_var_type var_type;
+ ulong var_type;
enum get_opt_arg_type arg_type;
longlong def_value; /* Default value */
longlong min_value; /* Min allowed value */