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

Tanu Kaskinen tanu.kaskinen at digia.com
Fri Aug 17 05:39:21 PDT 2012


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.

-- 
Tanu



More information about the pulseaudio-discuss mailing list