From abbce9ed560d16bd76a84b30d4f4f731f0b56dc0 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 22 Dec 2017 15:03:24 +0200 Subject: [PATCH] Fixed compiler warnings in guess_malloc_library --- mysys/guess_malloc_library.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mysys/guess_malloc_library.c b/mysys/guess_malloc_library.c index 2e640757e11..70e3c7ca0f2 100644 --- a/mysys/guess_malloc_library.c +++ b/mysys/guess_malloc_library.c @@ -20,8 +20,13 @@ #include #include +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 @@ -33,9 +38,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; @@ -45,9 +48,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;