[pulseaudio-discuss] [PATCH] resampler: Get rid of "cast increases required alignment of target type" warnings.

David Henningsson david.henningsson at canonical.com
Fri Aug 17 05:41:48 PDT 2012


On 08/17/2012 02:39 PM, Tanu Kaskinen wrote:
> On Fri, 2012-08-17 at 13:36 +0200, David Henningsson wrote:
>> On 08/17/2012 01:30 PM, Tanu Kaskinen wrote:
>>> The buffers in question should be properly aligned for any
>>> integer size, so the warnings are false positives.
>>
>> Oh, so there were that many of them. Well, how about
>>
>> static inline void* pa_memblock_acquire_index(memblock, index)
>> {
>> 	return (void *) ((uint8_t *) pa_memblock_acquire(memblock) + index);
>> }
>>
>> ?
>
> A very good idea. What would you think about having
> pa_memchunk_acquire() instead? Almost all, if not all, instances where
> this pattern is used, the parameters to pa_memblock_acquire_index()
> would be "chunk->memblock, chunk->index", so it would be simpler to just
> pass a chunk pointer.

Sounds good to me, assuming you are correct in that all memblocks 
acquired are memchunks (which I haven't verified).


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list