[Ffmpeg-devel] [PATCH] portability fixes (ILP32 vs LP64)

Michael Niedermayer michaelni
Wed Jan 18 19:32:39 CET 2006


Hi

On Wed, Jan 18, 2006 at 10:17:12AM +0000, Dieter wrote:
> Here are fixes for some of the compiler warnings I got
> building the cvs version of ffmpeg on FreeBSD 6.0.
> They should help with portability between ILP32 and LP64.
> 
> 
> 
> Diffs for file: libavcodec/i386/h264dsp_mmx.c
> 
> ===================================================================
> RCS file: RCS/h264dsp_mmx.c,v
> retrieving revision 1.1
> diff -u -c -r1.1 h264dsp_mmx.c
> *** h264dsp_mmx.c	2006/01/18 01:15:54	1.1
> --- h264dsp_mmx.c	2006/01/18 17:06:06
> ***************
> *** 65,70 ****
> --- 65,75 ----
>       "packuswb  "#z",    "#p" \n\t"\
>       "movd      "#p",    (%0) \n\t"
>   
> + 
> + /* prototypes */
> + void ff_h264_idct_add_mmx2(uint8_t *, int16_t *, int);
> + 
> + 
>   void ff_h264_idct_add_mmx2(uint8_t *dst, int16_t *block, int stride)

this and all similar chnages are rejected
prototypes have a purpose, they help quickly detecting the passing of wrong 
arguments, this change does not fullfill this purpose, it just hides the
warning which is useless, theres /dev/null, grep and some compiler switches
for that ...

make the function static if possible or put the prototype in the correct .h
file

putting a prototype directly before the function is always wrong, and actually
should trigger a much bigger warning then having no prototype at all


[...]
> ===================================================================
> RCS file: RCS/mem.c,v
> retrieving revision 1.1
> diff -u -c -r1.1 mem.c
> *** mem.c	2006/01/18 00:27:51	1.1
> --- mem.c	2006/01/18 00:28:39
> ***************
> *** 46,52 ****
>   {
>       void *ptr;
>   #ifdef MEMALIGN_HACK
> !     int diff;

not a unified diff, read and follow the docs

[...]

-- 
Michael





More information about the ffmpeg-devel mailing list