mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Get rid of some extraneous elses
This commit is contained in:
parent
5c2006c072
commit
cec2afe6cb
18
audio/alsa.c
18
audio/alsa.c
@ -175,13 +175,10 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
eagain_retry = false;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
return written;
|
||||
}
|
||||
else if (frames == -EAGAIN) // Expected if we're running nonblock.
|
||||
{
|
||||
return written;
|
||||
}
|
||||
else if (frames == -EAGAIN) // Expected if we're running nonblock.
|
||||
return written;
|
||||
else if (frames < 0)
|
||||
{
|
||||
RARCH_ERR("[ALSA]: Unknown error occured (%s).\n", snd_strerror(frames));
|
||||
@ -199,6 +196,7 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
|
||||
static bool alsa_stop(void *data)
|
||||
{
|
||||
alsa_t *alsa = (alsa_t*)data;
|
||||
|
||||
if (alsa->can_pause && !alsa->is_paused)
|
||||
{
|
||||
if (snd_pcm_pause(alsa->pcm, 1) == 0)
|
||||
@ -206,11 +204,10 @@ static bool alsa_stop(void *data)
|
||||
alsa->is_paused = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void alsa_set_nonblock_state(void *data, bool state)
|
||||
@ -236,8 +233,7 @@ static bool alsa_start(void *data)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void alsa_free(void *data)
|
||||
|
@ -267,11 +267,10 @@ static bool alsa_qsa_stop(void *data)
|
||||
alsa->is_paused = true;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void alsa_qsa_set_nonblock_state(void *data, bool state)
|
||||
@ -308,9 +307,8 @@ static bool alsa_qsa_start(void *data)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool alsa_qsa_use_float(void *data)
|
||||
|
@ -27,11 +27,11 @@ struct fifo_buffer
|
||||
fifo_buffer_t *fifo_new(size_t size)
|
||||
{
|
||||
fifo_buffer_t *buf = (fifo_buffer_t*)calloc(1, sizeof(*buf));
|
||||
if (buf == NULL)
|
||||
if (!buf)
|
||||
return NULL;
|
||||
|
||||
buf->buffer = (uint8_t*)calloc(1, size + 1);
|
||||
if (buf->buffer == NULL)
|
||||
if (!buf->buffer)
|
||||
{
|
||||
free(buf);
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user