Commit abbce9ed authored by Monty's avatar Monty Committed by Marko Mäkelä

Fixed compiler warnings in guess_malloc_library

parent 39f236a2
...@@ -20,8 +20,13 @@ ...@@ -20,8 +20,13 @@
#include <stddef.h> #include <stddef.h>
#include <m_string.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() char *guess_malloc_library()
{ {
tc_version_type tc_version_func;
mallctl_type mallctl_func;
#ifndef HAVE_DLOPEN #ifndef HAVE_DLOPEN
return (char*) MALLOC_LIBRARY; return (char*) MALLOC_LIBRARY;
#else #else
...@@ -33,9 +38,7 @@ char *guess_malloc_library() ...@@ -33,9 +38,7 @@ char *guess_malloc_library()
} }
/* tcmalloc */ /* tcmalloc */
typedef const char* (*tc_version_type)(int*, int*, const char**); tc_version_func= (tc_version_type) dlsym(RTLD_DEFAULT, "tc_version");
tc_version_type tc_version_func =
(tc_version_type) dlsym(RTLD_DEFAULT, "tc_version");
if (tc_version_func) if (tc_version_func)
{ {
int major, minor; int major, minor;
...@@ -45,9 +48,7 @@ char *guess_malloc_library() ...@@ -45,9 +48,7 @@ char *guess_malloc_library()
} }
/* jemalloc */ /* jemalloc */
typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t); mallctl_func= (mallctl_type) dlsym(RTLD_DEFAULT, "mallctl");
mallctl_type mallctl_func =
(mallctl_type) dlsym(RTLD_DEFAULT, "mallctl");
if (mallctl_func) if (mallctl_func)
{ {
char *ver; char *ver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment