summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-08-11 15:17:30 +0200
committerLennart Poettering <lennart@poettering.net>2008-08-11 15:17:30 +0200
commitb604290803a0832ac337faf7619b93b2968e8d50 (patch)
treedc175f0c5bd87c05e7bee7d4d16f54ff737afd5c /src/pulsecore
parentb21840407a844d537de0a750a0d8afb948932db2 (diff)
adhere to struct gcc aliasing rules
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/sample-util.c10
1 files changed, 3 insertions, 7 deletions
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);