[pulseaudio-discuss] [PATCH 3/4] resampler: Use int16_t instead of short.

Tanu Kaskinen tanu.kaskinen at digia.com
Fri Aug 17 04:32:08 PDT 2012


On Thu, 2012-08-16 at 07:59 +0200, David Henningsson wrote:
> On 08/14/2012 04:08 PM, Tanu Kaskinen wrote:
> > Also add a cast to void pointer to get rid of one instance
> > of "warning: cast increases required alignment of target
> > type". The warning is a false positive.
> > ---
> >   src/pulsecore/resampler.c |    2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
> > index 9f19559..9d50093 100644
> > --- a/src/pulsecore/resampler.c
> > +++ b/src/pulsecore/resampler.c
> > @@ -1729,7 +1729,7 @@ static void ffmpeg_resample(pa_resampler *r, const pa_memchunk *input, unsigned
> >           previous_consumed_frames = consumed_frames;
> >
> >           /* And place the results in the output buffer */
> > -        s = (short*) ((uint8_t*) pa_memblock_acquire(output->memblock) + output->index) + c;
> > +        s = (int16_t *) ((void *) ((uint8_t *) pa_memblock_acquire(output->memblock) + output->index)) + c;
> 
> Maybe clearer if you use a temporary variable here, i e split to two lines?

I sent another patch where I fix all the warnings in resampler.c. It
supersedes this patch.

-- 
Tanu



More information about the pulseaudio-discuss mailing list