diff options
author | Max Kellermann <max@duempel.org> | 2011-10-20 01:09:23 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-10-20 02:24:25 +0200 |
commit | 72e80db823c3af56293a4835baef577945603f8f (patch) | |
tree | f553ac964c689c79f00adbd27cfc92fc9b496afe /src/pcm_channels.c | |
parent | 7b33c343f860264661c3579a32dea6e875c3266f (diff) | |
download | mpd-72e80db823c3af56293a4835baef577945603f8f.tar.gz mpd-72e80db823c3af56293a4835baef577945603f8f.tar.xz mpd-72e80db823c3af56293a4835baef577945603f8f.zip |
pcm_*: add "restrict" keywords
Allow more compiler optimizations.
Diffstat (limited to 'src/pcm_channels.c')
-rw-r--r-- | src/pcm_channels.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/pcm_channels.c b/src/pcm_channels.c index 0ec1eb527..ec2bd69a5 100644 --- a/src/pcm_channels.c +++ b/src/pcm_channels.c @@ -25,8 +25,9 @@ #include <assert.h> static void -pcm_convert_channels_16_1_to_2(int16_t *dest, const int16_t *src, - const int16_t *src_end) +pcm_convert_channels_16_1_to_2(int16_t *restrict dest, + const int16_t *restrict src, + const int16_t *restrict src_end) { while (src < src_end) { int16_t value = *src++; @@ -37,8 +38,9 @@ pcm_convert_channels_16_1_to_2(int16_t *dest, const int16_t *src, } static void -pcm_convert_channels_16_2_to_1(int16_t *dest, const int16_t *src, - const int16_t *src_end) +pcm_convert_channels_16_2_to_1(int16_t *restrict dest, + const int16_t *restrict src, + const int16_t *restrict src_end) { while (src < src_end) { int32_t a = *src++, b = *src++; @@ -48,9 +50,10 @@ pcm_convert_channels_16_2_to_1(int16_t *dest, const int16_t *src, } static void -pcm_convert_channels_16_n_to_2(int16_t *dest, - unsigned src_channels, const int16_t *src, - const int16_t *src_end) +pcm_convert_channels_16_n_to_2(int16_t *restrict dest, + unsigned src_channels, + const int16_t *restrict src, + const int16_t *restrict src_end) { unsigned c; @@ -98,8 +101,9 @@ pcm_convert_channels_16(struct pcm_buffer *buffer, } static void -pcm_convert_channels_24_1_to_2(int32_t *dest, const int32_t *src, - const int32_t *src_end) +pcm_convert_channels_24_1_to_2(int32_t *restrict dest, + const int32_t *restrict src, + const int32_t *restrict src_end) { while (src < src_end) { int32_t value = *src++; @@ -110,8 +114,9 @@ pcm_convert_channels_24_1_to_2(int32_t *dest, const int32_t *src, } static void -pcm_convert_channels_24_2_to_1(int32_t *dest, const int32_t *src, - const int32_t *src_end) +pcm_convert_channels_24_2_to_1(int32_t *restrict dest, + const int32_t *restrict src, + const int32_t *restrict src_end) { while (src < src_end) { int32_t a = *src++, b = *src++; @@ -121,9 +126,10 @@ pcm_convert_channels_24_2_to_1(int32_t *dest, const int32_t *src, } static void -pcm_convert_channels_24_n_to_2(int32_t *dest, - unsigned src_channels, const int32_t *src, - const int32_t *src_end) +pcm_convert_channels_24_n_to_2(int32_t *restrict dest, + unsigned src_channels, + const int32_t *restrict src, + const int32_t *restrict src_end) { unsigned c; @@ -178,8 +184,9 @@ pcm_convert_channels_32_1_to_2(int32_t *dest, const int32_t *src, } static void -pcm_convert_channels_32_2_to_1(int32_t *dest, const int32_t *src, - const int32_t *src_end) +pcm_convert_channels_32_2_to_1(int32_t *restrict dest, + const int32_t *restrict src, + const int32_t *restrict src_end) { while (src < src_end) { int64_t a = *src++, b = *src++; |