From ef1b34dcd28a47d1917e78dce7870a4d4871678e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 15 May 2014 01:14:31 -0700 Subject: [PATCH] Initialize some variables when declaring them --- Alc/backends/alsa.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c index 4b798b42..0712a412 100644 --- a/Alc/backends/alsa.c +++ b/Alc/backends/alsa.c @@ -677,15 +677,14 @@ static ALCboolean ALCplaybackAlsa_reset(ALCplaybackAlsa *self) unsigned int periodLen, bufferLen; snd_pcm_sw_params_t *sp = NULL; snd_pcm_hw_params_t *hp = NULL; + snd_pcm_format_t format = -1; snd_pcm_access_t access; - snd_pcm_format_t format; unsigned int periods; unsigned int rate; const char *funcerr; int allowmmap; int err; - format = -1; switch(device->FmtType) { case DevFmtByte: @@ -951,7 +950,7 @@ static ALCenum ALCcaptureAlsa_open(ALCcaptureAlsa *self, const ALCchar *name) snd_pcm_uframes_t bufferSizeInFrames; snd_pcm_uframes_t periodSizeInFrames; ALboolean needring = AL_FALSE; - snd_pcm_format_t format; + snd_pcm_format_t format = -1; const char *funcerr; int err; @@ -992,7 +991,6 @@ static ALCenum ALCcaptureAlsa_open(ALCcaptureAlsa *self, const ALCchar *name) /* Free alsa's global config tree. Otherwise valgrind reports a ton of leaks. */ snd_config_update_free_global(); - format = -1; switch(device->FmtType) { case DevFmtByte: -- 2.11.4.GIT