summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mixer.c5
-rw-r--r--src/pcm.c6
2 files changed, 3 insertions, 8 deletions
diff --git a/src/mixer.c b/src/mixer.c
index 5b07f15..56e2293 100644
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -244,10 +244,7 @@ struct _snd_mixer_selem_id {
int
snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr)
{
- if (!(*ptr = calloc(1, sizeof(**ptr))))
- return -1;
-
- return 0;
+ return ((*ptr = calloc(1, sizeof(**ptr))) ? 0 : -1);
}
void
diff --git a/src/pcm.c b/src/pcm.c
index 36a9bc8..8a5e38a 100644
--- a/src/pcm.c
+++ b/src/pcm.c
@@ -600,8 +600,7 @@ int
snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr)
{
// OpenAL-soft uses this :(
- *ptr = calloc(1, sizeof(**ptr));
- return (*ptr ? 0 : -1);
+ return ((*ptr = calloc(1, sizeof(**ptr))) ? 0 : -1);
}
void
@@ -920,8 +919,7 @@ int
snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr)
{
// OpenAL-soft uses this :(
- *ptr = calloc(1, sizeof(**ptr));
- return (*ptr ? 0 : -1);
+ return ((*ptr = calloc(1, sizeof(**ptr))) ? 0 : -1);
}
void