diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-05-24 13:23:15 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-05-24 13:23:15 +0000 |
commit | 3fa19ab457ff71d148a6dff5eb7362582e82ce61 (patch) | |
tree | 8c155d9feebaab58a9b1208f9c72429ecce7b1c0 /src/polypcore/module.c | |
parent | 2843b1a318aa1a01da465031d713ca2238b39d4c (diff) |
Fix warnings.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@959 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/polypcore/module.c')
-rw-r--r-- | src/polypcore/module.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/polypcore/module.c b/src/polypcore/module.c index 0286bba8..b938750c 100644 --- a/src/polypcore/module.c +++ b/src/polypcore/module.c @@ -44,6 +44,13 @@ #define UNLOAD_POLL_TIME 2 +/* lt_dlsym() violates ISO C, so confide the breakage into this function to + * avoid warnings. */ +typedef void (*fnptr)(void); +static inline fnptr lt_dlsym_fn(lt_dlhandle handle, const char *symbol) { + return (fnptr) (long) lt_dlsym(handle, symbol); +} + static void timeout_callback(pa_mainloop_api *m, pa_time_event*e, PA_GCC_UNUSED const struct timeval *tv, void *userdata) { pa_core *c = userdata; struct timeval ntv; @@ -75,12 +82,12 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) { goto fail; } - if (!(m->init = (int (*)(pa_core *_c, pa_module*_m)) lt_dlsym(m->dl, PA_SYMBOL_INIT))) { + if (!(m->init = (int (*)(pa_core *_c, pa_module*_m)) lt_dlsym_fn(m->dl, PA_SYMBOL_INIT))) { pa_log(__FILE__": Failed to load module \"%s\": symbol \""PA_SYMBOL_INIT"\" not found.", name); goto fail; } - if (!(m->done = (void (*)(pa_core *_c, pa_module*_m)) lt_dlsym(m->dl, PA_SYMBOL_DONE))) { + if (!(m->done = (void (*)(pa_core *_c, pa_module*_m)) lt_dlsym_fn(m->dl, PA_SYMBOL_DONE))) { pa_log(__FILE__": Failed to load module \"%s\": symbol \""PA_SYMBOL_DONE"\" not found.", name); goto fail; } |