diff options
author | Monty <monty@mariadb.org> | 2017-12-22 15:03:24 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-12-22 16:01:58 +0200 |
commit | 1d9fd4faec03a6cff0c2639d8f1348d1a4d1ebb8 (patch) | |
tree | 887bd40c71c321c8de4dcb765a4e0e554b33ae19 /mysys/guess_malloc_library.c | |
parent | d9e90292eb4de4c8a418e251ec744cfc578ea689 (diff) | |
download | mariadb-git-1d9fd4faec03a6cff0c2639d8f1348d1a4d1ebb8.tar.gz |
Fixed compiler warnings in guess_malloc_library
Diffstat (limited to 'mysys/guess_malloc_library.c')
-rw-r--r-- | mysys/guess_malloc_library.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/mysys/guess_malloc_library.c b/mysys/guess_malloc_library.c index dbcdbc8359b..ed86ae0679c 100644 --- a/mysys/guess_malloc_library.c +++ b/mysys/guess_malloc_library.c @@ -21,8 +21,13 @@ #include "my_global.h" #include <m_string.h> +typedef const char* (*tc_version_type)(int*, int*, const char**); +typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t); + char *guess_malloc_library() { + tc_version_type tc_version_func; + mallctl_type mallctl_func; #ifndef HAVE_DLOPEN return (char*) MALLOC_LIBRARY; #else @@ -34,9 +39,7 @@ char *guess_malloc_library() } /* tcmalloc */ - typedef const char* (*tc_version_type)(int*, int*, const char**); - tc_version_type tc_version_func = - (tc_version_type) dlsym(RTLD_DEFAULT, "tc_version"); + tc_version_func= (tc_version_type) dlsym(RTLD_DEFAULT, "tc_version"); if (tc_version_func) { int major, minor; @@ -46,9 +49,7 @@ char *guess_malloc_library() } /* jemalloc */ - typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t); - mallctl_type mallctl_func = - (mallctl_type) dlsym(RTLD_DEFAULT, "mallctl"); + mallctl_func= (mallctl_type) dlsym(RTLD_DEFAULT, "mallctl"); if (mallctl_func) { char *ver; |