[FFmpeg-devel] [PATCH] get rid of useless casts in libavcodec/ppc/dsputil_altivec.c

Guillaume POIRIER poirierg
Mon May 18 09:05:58 CEST 2009


Hi,

On Mon, May 18, 2009 at 7:48 AM, Diego Biurrun <diego at biurrun.de> wrote:

> Here is a patch to remove a bunch of seemingly useless casts from
> libavcodec/ppc/dsputil_altivec.c.  As a nice side effect, it also
> eliminates the following warnings:
>
> libavcodec/ppc/dsputil_altivec.c: In function 'put_pixels16_altivec':
> libavcodec/ppc/dsputil_altivec.c:641: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:642: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:643: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:644: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:645: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:646: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:647: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:648: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c: In function 'avg_pixels16_altivec':
> libavcodec/ppc/dsputil_altivec.c:676: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:677: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c: In function 'avg_pixels8_altivec':
> libavcodec/ppc/dsputil_altivec.c:704: warning: cast discards qualifiers
> from pointer target type
> libavcodec/ppc/dsputil_altivec.c:705: warning: cast discards qualifiers
> from pointer target type
>
> Diego
>

Looks Ok, and doesn't break anything here on PPC/OSX 10.5.7 with GCC 4.2

Did you test on Linux? It should be OK too, but better safe than sorry ;-)

Guillaume
-- 
Only a very small fraction of our DNA does anything; the rest is all
comments and ifdefs.

P. J. O'Rourke<http://www.brainyquote.com/quotes/authors/p/p_j_orourke.html>
- "Never fight an inanimate object."



More information about the ffmpeg-devel mailing list