From: Andre Noll Date: Sat, 7 Nov 2009 13:06:55 +0000 (+0100) Subject: alsa: Avoid using 0 as a NULL pointer. X-Git-Tag: v0.4.0~1^2^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d7f96d2c7c718e3f7d4834fb25b6939a355a0e19 alsa: Avoid using 0 as a NULL pointer. Found by sparse. --- diff --git a/alsa_write.c b/alsa_write.c index d7828945..53c97384 100644 --- a/alsa_write.c +++ b/alsa_write.c @@ -79,18 +79,19 @@ static int alsa_init(struct private_alsa_write_data *pad, pad->channels) < 0) return -E_CHANNEL_COUNT; if (snd_pcm_hw_params_set_rate_near(pad->handle, hwparams, - &pad->samplerate, 0) < 0) + &pad->samplerate, NULL) < 0) return -E_SET_RATE; - err = snd_pcm_hw_params_get_buffer_time_max(hwparams, &pad->buffer_time, 0); + err = snd_pcm_hw_params_get_buffer_time_max(hwparams, + &pad->buffer_time, NULL); if (err < 0 || !pad->buffer_time) return -E_GET_BUFFER_TIME; PARA_INFO_LOG("buffer time: %d\n", pad->buffer_time); if (snd_pcm_hw_params_set_buffer_time_near(pad->handle, hwparams, - &pad->buffer_time, 0) < 0) + &pad->buffer_time, NULL) < 0) return -E_SET_BUFFER_TIME; if (snd_pcm_hw_params(pad->handle, hwparams) < 0) return -E_HW_PARAMS; - snd_pcm_hw_params_get_period_size(hwparams, &period_size, 0); + snd_pcm_hw_params_get_period_size(hwparams, &period_size, NULL); snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size); PARA_INFO_LOG("buffer size: %lu, period_size: %lu\n", buffer_size, period_size);