[pulseaudio-discuss] [PATCH 2/2] endianmacros: Replace borked PA_FLOAT32_SWAP() with PA_READ_FLOAT32RE() / PA_WRITE_FLOAT32RE()

Felipe Sateler fsateler at debian.org
Wed Sep 3 08:57:23 PDT 2014


Hi,

On Wed, Sep 3, 2014 at 6:44 AM, Peter Meerwald <pmeerw at pmeerw.net> wrote:
>
>> I was considering whether "const void *p"  should instead be a "const float
>> *p" (in the function prototypes), but maybe not - a reversed float cannot be
>> considered a float anymore, due to the NaN problems you describe below.
>>
>> OTOH, that leaves us with a few float pointers in the callers to these
>> functions, which should perhaps be converted to void* too, but then you can't
>> index them...

Note also that p must be 4-byte aligned, otherwise it will fail with
SIGBUS on architectures with strict alignment requirements and be
slower elsewhere. I don't see a problem in the current code with a
quick look, but maybe this should be documented?

>>
>> So hey, it fixes a bug, and I assume you have run the relevant tests and they
>> succeeded. So while it's slightly inconsistent to mix float* and void*, this
>> one is acked too.
>
> thank you for looking at this; I'll wait for an Ack by Felipe before
> applying

Tonight I'll push the patch to the build farm, lets see if we finally
have it running everywhere.

-- 

Saludos,
Felipe Sateler


More information about the pulseaudio-discuss mailing list