From f102ac7a8c62491761b7b3d32baa87dcb665f9ed Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 1 Jan 2010 13:18:49 +0000 Subject: Fix function declarations to avoid casting function pointers. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30164 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libao2/ao_alsa.c') diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 7376c0f18d..ba49231b28 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -263,7 +263,8 @@ static void print_help (void) MSGTR_AO_ALSA_CommandlineHelp); } -static int str_maxlen(strarg_t *str) { +static int str_maxlen(void *strp) { + strarg_t *str = strp; if (str->len > ALSA_DEVICE_SIZE) return 0; return 1; @@ -328,7 +329,7 @@ static int init(int rate_hz, int channels, int format, int flags) snd_pcm_uframes_t boundary; const opt_t subopts[] = { {"block", OPT_ARG_BOOL, &block, NULL}, - {"device", OPT_ARG_STR, &device, (opt_test_f)str_maxlen}, + {"device", OPT_ARG_STR, &device, str_maxlen}, {NULL} }; -- cgit v1.2.3 From 92cd6dc3e916ae4275ff05d2b238fc778cfbfc6b Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 1 Jan 2010 13:23:16 +0000 Subject: Simplify range-checking functions for subopt parsing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30165 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_alsa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libao2/ao_alsa.c') diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index ba49231b28..70cd92198b 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -265,9 +265,7 @@ static void print_help (void) static int str_maxlen(void *strp) { strarg_t *str = strp; - if (str->len > ALSA_DEVICE_SIZE) - return 0; - return 1; + return str->len <= ALSA_DEVICE_SIZE; } static int try_open_device(const char *device, int open_mode, int try_ac3) -- cgit v1.2.3