[Ffmpeg-cvslog] CVS: ffmpeg/libavutil common.h,1.153,1.154

Alexander Strasser eclipse7
Mon Dec 12 23:18:26 CET 2005


Hi,

Michel Bardiaux wrote:
> Alexander Strasser (beastd) wrote:
> >Update of /cvsroot/ffmpeg/ffmpeg/libavutil
> >In directory mail:/var2/tmp/cvs-serv2042/libavutil
> >
> >Modified Files:
> >	common.h 
> >Log Message:
> >Fixed format specifier in STOP_TIMER macro.
> 
> This causes lots of warnings on mingw (gcc version 3.2 (mingw special 
> 20020817-1)):
> 
> gcc -O3 -g -Wall -Wno-switch  -DHAVE_AV_CONFIG_H -I.. 
> -I'//pktbes02/dsk3/people/michel/internet/ffmpeg-mingw-tutorial'/libavutil 
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE   -c -o vp3.o 
> vp3.c
> vp3.c: In function `apply_loop_filter':
> vp3.c:2103: warning: unsigned int format, different type arg (arg 4)
> vp3.c: In function `vp3_decode_frame':
> vp3.c:2513: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2533: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2539: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2545: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2551: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2561: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2566: warning: unsigned int format, different type arg (arg 4)
> vp3.c:2570: warning: unsigned int format, different type arg (arg 4)

  Hmm, is the macro at least working correctly now?
  I know i had problems using it on MinGW as printf got the
sizes wrong. And it also caused crashes on other systems.

> Doing a 'gcc -E' shows that PRIu64 is replaced by "I64u". The full 
> expansion of STOP_TIMER is:
> 
> tend= read_time();{ static uint64_t tsum=0; static int tcount=0; static 
> int tskip_count=0; if(tcount<2 || tend - tstart < 8*tsum/tcount){ tsum+= 
> tend - tstart; tcount++; }else tskip_count++; 
> if(256*256*256*64%(tcount+tskip_count)==0){ av_log(((void *)0), 2, 
> "%""I64u"" dezicycles in %s, %d runs, %d skips\n", tsum*10/tcount, "loop 
> filter", tcount, tskip_count); }}
> 
> Even casting tsum*10/tcount explicitly to (uint64_t) fails to remove the 
> warning. Any idea on how to fix this? (Of course, maybe I just have to 
> upgrade my msys, but I hate doing that unless unavoidable, esp. after 
> all the noise about asm bugs in very recent gcc's)

  From what I see the fix was correct and I guess that your
gcc version can not properly check the types and therefore
is spitting out lots of warnings. I don't remember to have
seen them on mingw when i tested it, so maybe an upgrade
would help (sorry I don't have version numbers at hand atm).
  Now that I read Mans answer maybe it wouldn't help, but as
I said I don't remember warnings when testing it on mingw.
If I get the chance I'll have a look at it again. Tho if it
works correctly, these warnings should probably just be ignored.

  Btw you should get even more warnings now, as some other
places were also fixed to use the PRI* macros.

  Alex (beastd)





More information about the ffmpeg-cvslog mailing list