Fix warnings.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@959 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-05-24 13:23:15 +00:00
parent 2843b1a318
commit 3fa19ab457
8 changed files with 42 additions and 18 deletions

View file

@ -38,6 +38,13 @@
#define PA_SYMBOL_USAGE "pa__get_usage"
#define PA_SYMBOL_VERSION "pa__get_version"
/* 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);
}
pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl) {
pa_modinfo *i;
const char* (*func)(void);
@ -45,16 +52,16 @@ pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl) {
i = pa_xnew0(pa_modinfo, 1);
if ((func = (const char* (*)(void)) lt_dlsym(dl, PA_SYMBOL_AUTHOR)))
if ((func = (const char* (*)(void)) lt_dlsym_fn(dl, PA_SYMBOL_AUTHOR)))
i->author = pa_xstrdup(func());
if ((func = (const char* (*)(void)) lt_dlsym(dl, PA_SYMBOL_DESCRIPTION)))
if ((func = (const char* (*)(void)) lt_dlsym_fn(dl, PA_SYMBOL_DESCRIPTION)))
i->description = pa_xstrdup(func());
if ((func = (const char* (*)(void)) lt_dlsym(dl, PA_SYMBOL_USAGE)))
if ((func = (const char* (*)(void)) lt_dlsym_fn(dl, PA_SYMBOL_USAGE)))
i->usage = pa_xstrdup(func());
if ((func = (const char* (*)(void)) lt_dlsym(dl, PA_SYMBOL_VERSION)))
if ((func = (const char* (*)(void)) lt_dlsym_fn(dl, PA_SYMBOL_VERSION)))
i->version = pa_xstrdup(func());
return i;

View file

@ -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;
}

View file

@ -22,6 +22,10 @@
USA.
***/
#ifndef HAVE_PIPE
int pipe(int filedes[2]);
#endif
#endif

View file

@ -515,7 +515,6 @@ static int esd_proto_server_info(struct connection *c, PA_GCC_UNUSED esd_proto_t
}
static int esd_proto_all_info(struct connection *c, esd_proto_t request, const void *data, size_t length) {
uint8_t *response;
size_t t, k, s;
struct connection *conn;
uint32_t idx = PA_IDXSET_INVALID;
@ -585,7 +584,6 @@ static int esd_proto_all_info(struct connection *c, esd_proto_t request, const v
}
assert(t == s*(nsamples+1)+k);
response += k;
t -= k;
connection_write(c, terminator, k);

View file

@ -48,7 +48,7 @@ static int random_proper(void *ret_data, size_t length) {
#else /* OS_IS_WIN32 */
int fd, ret;
int fd, ret = -1;
ssize_t r = 0;
const char **device;

View file

@ -107,9 +107,10 @@ static void internal_io_event(pa_mainloop_api *m, pa_io_event *e, int fd, PA_GCC
/* Add a new IO source for the specified X11 internal connection */
static pa_x11_internal* x11_internal_add(pa_x11_wrapper *w, int fd) {
pa_x11_internal *i;
assert(i && fd >= 0);
assert(fd >= 0);
i = pa_xmalloc(sizeof(pa_x11_internal));
assert(i);
i->wrapper = w;
i->io_event = w->core->mainloop->io_new(w->core->mainloop, fd, PA_IO_EVENT_INPUT, internal_io_event, w);
i->fd = fd;