From b604290803a0832ac337faf7619b93b2968e8d50 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 11 Aug 2008 15:17:30 +0200 Subject: adhere to struct gcc aliasing rules --- src/pulsecore/sample-util.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/pulsecore/sample-util.c') diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c index b42b79d1..5a93367e 100644 --- a/src/pulsecore/sample-util.c +++ b/src/pulsecore/sample-util.c @@ -559,19 +559,15 @@ size_t pa_mix( if (PA_UNLIKELY(cv <= 0) || PA_UNLIKELY(!!mute) || PA_UNLIKELY(linear[channel] <= 0)) v = 0; - else { - uint32_t z = *(uint32_t*) m->ptr; - z = PA_UINT32_SWAP(z); - v = *((float*) &z); - v *= cv; - } + else + v = PA_FLOAT32_SWAP(*(float*) m->ptr) *cv; sum += v; m->ptr = (uint8_t*) m->ptr + sizeof(float); } sum *= linear[channel]; - *((uint32_t*) data) = PA_UINT32_SWAP(*(uint32_t*) &sum); + *((float*) data) = PA_FLOAT32_SWAP(sum); data = (uint8_t*) data + sizeof(float); -- cgit