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/utils | |
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/utils')
-rw-r--r-- | src/utils/padsp.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/utils/padsp.c b/src/utils/padsp.c index 10b08eae..87d0b257 100644 --- a/src/utils/padsp.c +++ b/src/utils/padsp.c @@ -102,11 +102,18 @@ static int (*_open64)(const char *, int, mode_t) = NULL; static FILE* (*_fopen64)(const char *path, const char *mode) = NULL; static int (*_fclose)(FILE *f) = NULL; +/* dlsym() violates ISO C, so confide the breakage into this function to + * avoid warnings. */ +typedef void (*fnptr)(void); +static inline fnptr dlsym_fn(void *handle, const char *symbol) { + return (fnptr) (long) dlsym(handle, symbol); +} + #define LOAD_IOCTL_FUNC() \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_ioctl) \ - _ioctl = (int (*)(int, int, void*)) dlsym(RTLD_NEXT, "ioctl"); \ + _ioctl = (int (*)(int, int, void*)) dlsym_fn(RTLD_NEXT, "ioctl"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -114,7 +121,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_open) \ - _open = (int (*)(const char *, int, mode_t)) dlsym(RTLD_NEXT, "open"); \ + _open = (int (*)(const char *, int, mode_t)) dlsym_fn(RTLD_NEXT, "open"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -122,7 +129,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_open64) \ - _open64 = (int (*)(const char *, int, mode_t)) dlsym(RTLD_NEXT, "open64"); \ + _open64 = (int (*)(const char *, int, mode_t)) dlsym_fn(RTLD_NEXT, "open64"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -130,7 +137,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_close) \ - _close = (int (*)(int)) dlsym(RTLD_NEXT, "close"); \ + _close = (int (*)(int)) dlsym_fn(RTLD_NEXT, "close"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -138,7 +145,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_fopen) \ - _fopen = (FILE* (*)(const char *, const char*)) dlsym(RTLD_NEXT, "fopen"); \ + _fopen = (FILE* (*)(const char *, const char*)) dlsym_fn(RTLD_NEXT, "fopen"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -146,7 +153,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_fopen64) \ - _fopen64 = (FILE* (*)(const char *, const char*)) dlsym(RTLD_NEXT, "fopen64"); \ + _fopen64 = (FILE* (*)(const char *, const char*)) dlsym_fn(RTLD_NEXT, "fopen64"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) @@ -154,7 +161,7 @@ do { \ do { \ pthread_mutex_lock(&func_mutex); \ if (!_fclose) \ - _fclose = (int (*)(FILE *)) dlsym(RTLD_NEXT, "fclose"); \ + _fclose = (int (*)(FILE *)) dlsym_fn(RTLD_NEXT, "fclose"); \ pthread_mutex_unlock(&func_mutex); \ } while(0) |