aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm_byteswap.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-22 19:04:38 +0200
committerMax Kellermann <max@duempel.org>2009-07-22 19:04:38 +0200
commit172a1dbdb9719cd71835d639f15fcac95e549915 (patch)
tree497b2ec1b7bf6d050f407d2edeedcf797f2b4c4b /src/pcm_byteswap.c
parentc5a662f405a28caca2380d1b20fed050b1407ad5 (diff)
downloadmpd-172a1dbdb9719cd71835d639f15fcac95e549915.tar.gz
mpd-172a1dbdb9719cd71835d639f15fcac95e549915.tar.xz
mpd-172a1dbdb9719cd71835d639f15fcac95e549915.zip
pcm_byteswap: converted NULL checks to assertions
It is illegal to pass a NULL buffer to pcm_byteswap_X(). The result of this is that pcm_byteswap_X() never returns NULL.
Diffstat (limited to '')
-rw-r--r--src/pcm_byteswap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pcm_byteswap.c b/src/pcm_byteswap.c
index 6bdec1f24..1c1caeeca 100644
--- a/src/pcm_byteswap.c
+++ b/src/pcm_byteswap.c
@@ -38,8 +38,7 @@ const int16_t *pcm_byteswap_16(struct pcm_buffer *buffer,
unsigned i;
int16_t *buf = pcm_buffer_get(buffer, len);
- if (!buf)
- return NULL;
+ assert(buf != NULL);
for (i = 0; i < len / 2; i++)
buf[i] = swab16(src[i]);
@@ -61,8 +60,7 @@ const int32_t *pcm_byteswap_32(struct pcm_buffer *buffer,
unsigned i;
int32_t *buf = pcm_buffer_get(buffer, len);
- if (!buf)
- return NULL;
+ assert(buf != NULL);
for (i = 0; i < len / 4; i++)
buf[i] = swab32(src[i]);