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

Måns Rullgård mans
Mon Jul 9 23:05:00 CEST 2007


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?

-- 
M?ns Rullg?rd
mans at mansr.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h263_round_chroma.patch
Type: text/x-patch
Size: 2253 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20070709/b2e70a03/attachment.bin>



More information about the ffmpeg-cvslog mailing list