diff options
author | Mats Kindahl <mats.kindahl@oracle.com> | 2010-08-23 15:32:39 +0200 |
---|---|---|
committer | Mats Kindahl <mats.kindahl@oracle.com> | 2010-08-23 15:32:39 +0200 |
commit | b7ed981f3793b4464b99c98b7baa3c511b52b6a5 (patch) | |
tree | c911bc462dcc01e53c97da9113effe39c75fc499 /mysys | |
parent | f57888054936dad42dc75376c87e39d9539f8240 (diff) | |
parent | 8c4d4cc3a6f1fd9852e11e16926a5e98cca5ee03 (diff) | |
download | mariadb-git-b7ed981f3793b4464b99c98b7baa3c511b52b6a5.tar.gz |
Merging with mysql-5.5
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_getopt.c | 30 | ||||
-rw-r--r-- | mysys/stacktrace.c | 4 |
2 files changed, 21 insertions, 13 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index e4b199dab84..1c5bf0b6b1c 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -603,18 +603,24 @@ static int setval(const struct my_option *opts, void *value, char *argument, }; break; case GET_ENUM: - if (((*(uint*)value)= - find_type(argument, opts->typelib, 2) - 1) == (uint)-1) { - /* Accept an integer representation of the enumerated item */ - char *endptr; - uint arg= (uint) strtol(argument, &endptr, 10); - if (*endptr || arg >= opts->typelib->count) + int type= find_type(argument, opts->typelib, 2); + if (type == 0) { - res= EXIT_ARGUMENT_INVALID; - goto ret; - }; - *(uint*)value= arg; + /* + Accept an integer representation of the enumerated item. + */ + char *endptr; + ulong arg= strtoul(argument, &endptr, 10); + if (*endptr || arg >= opts->typelib->count) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + } + *(ulong*)value= arg; + } + else + *(ulong*)value= type - 1; } break; case GET_SET: @@ -1010,7 +1016,7 @@ static void init_one_value(const struct my_option *option, void *variable, *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL); break; case GET_ENUM: - *((uint*) variable)= (uint) value; + *((ulong*) variable)= (ulong) value; break; case GET_UINT: *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL); @@ -1286,7 +1292,7 @@ void my_print_variables(const struct my_option *options) printf("\n"); break; case GET_ENUM: - printf("%s\n", get_type(optp->typelib, *(uint*) value)); + printf("%s\n", get_type(optp->typelib, *(ulong*) value)); break; case GET_STR: case GET_STR_ALLOC: /* fall through */ diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 675910d2b20..ba62062ebc0 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -83,7 +83,9 @@ void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)), #if BACKTRACE_DEMANGLE -char __attribute__ ((weak)) *my_demangle(const char *mangled_name, int *status) +char __attribute__ ((weak)) * +my_demangle(const char *mangled_name __attribute__((unused)), + int *status __attribute__((unused))) { return NULL; } |