Skip to content

Commit

Permalink
Fixed compiler warnings in guess_malloc_library
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi authored and dr-m committed Jan 15, 2018
1 parent 39f236a commit abbce9e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mysys/guess_malloc_library.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
#include <stddef.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
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit abbce9e

Please sign in to comment.