[FFmpeg-cvslog] r9547 - in trunk/libavcodec: cavs.h h264.c mpegvideo.h snow.c

Michael Niedermayer michaelni
Tue Jul 10 01:58:52 CEST 2007


Hi

On Mon, Jul 09, 2007 at 10:05:00PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > Hi
> >
> > On Mon, Jul 09, 2007 at 02:10:33AM +0100, M?ns Rullg?rd wrote:
> >> Uoti Urpala <uoti.urpala at pp1.inet.fi> writes:
> >> 
> >> > On Mon, 2007-07-09 at 00:46 +0100, M?ns Rullg?rd wrote:
> >> >> Michael Niedermayer <michaelni at gmx.at> writes:
> >> >> >> -int ff_h263_round_chroma(int x);
> >> >> >> +inline int ff_h263_round_chroma(int x);
> >> >> >>  void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);
> >> >> >
> >> >> > hides warning doesnt fix gnuism inlining
> >> >> 
> >> >> What's gnu about it?  Some *non*-gnu compilers can actually inline
> >> >> functions across files...
> >> >
> >> > Current gcc doesn't implement "inline" for non-static functions
> >> > correctly. The standard says:
> >> >
> >> > -----
> >> > If all of the file scope declarations for a function in a translation
> >> > unit include the 'inline' function specifier without 'extern', then the
> >> > definition is an /inline definition/. An inline definition does not
> >> > provide an external definition for the function, and does not forbid an
> >> > external definition in another translation unit. An inline definition
> >> > provides an alternative to an external definition, which a translator
> >> > may use to implement any call to the function in the same translation
> >> > unit.
> >> > -----
> >> >
> >> > For a global function there should be exactly one translation unit which
> >> > provides an external definition for the function. After your changes
> >> > mpegvideo.c is the only translation unit to contain an implementation
> >> > for the function, and it's inline without extern thus does not provide
> >> > an external definition. So using the function from other translation
> >> > units is impossible under a C99-conforming compiler.
> >> 
> >> So what do we do with this function?  Make it "extern inline"?  Move
> >> it to a header as "static inline"?
> >
> > hmm id say Move it to a header as "static inline"
> 
> Something like this then?

yes

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070710/c5c35728/attachment.pgp>



More information about the ffmpeg-cvslog mailing list