mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
Various fixes for build warnings
This commit is contained in:
parent
53695b83dc
commit
9cbf19b59b
5 changed files with 7 additions and 13 deletions
|
|
@ -32,12 +32,6 @@
|
|||
#include <pulsecore/memblock.h>
|
||||
#include <pulsecore/sample-util.h>
|
||||
|
||||
static float swap_float(float a) {
|
||||
uint32_t *b = (uint32_t*) &a;
|
||||
*b = PA_UINT32_SWAP(*b);
|
||||
return a;
|
||||
}
|
||||
|
||||
static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
|
||||
void *d;
|
||||
unsigned i;
|
||||
|
|
@ -96,7 +90,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
|
|||
float *u = d;
|
||||
|
||||
for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
|
||||
printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : swap_float(*u));
|
||||
printf("%1.5f ", ss->format == PA_SAMPLE_FLOAT32NE ? *u : PA_FLOAT32_SWAP(*u));
|
||||
u++;
|
||||
}
|
||||
|
||||
|
|
@ -188,7 +182,7 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
|
|||
|
||||
if (ss->format == PA_SAMPLE_FLOAT32RE) {
|
||||
for (i = 0; i < 10; i++)
|
||||
u[i] = swap_float(float_samples[i]);
|
||||
u[i] = PA_FLOAT32_SWAP(float_samples[i]);
|
||||
} else
|
||||
memcpy(d, float_samples, sizeof(float_samples));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue