[FFmpeg-devel] [Fwd: Re: Question: declare common function pointers]

Kostya kostya.shishkov
Fri Jun 11 10:40:58 CEST 2010


On Thu, Jun 10, 2010 at 10:22:13PM +0200, Maxim wrote:
> 
> > Maxim wrote:
> >> Hi,
> >>
> >> I wish to declare two common function pointers shared between
> >> indeo4/indeo5 (see the attached patch). Is the "ff_" prefix required in
> >> this case?
> >
> > Just a side note, sorry I have no answer to the original question...
> >
> > This is not the ideal way to typedef function pointers. You should
> > always typedef the actual base type, not (only the) pointer to type.
> > Then you can use the typedef in declarations. Otherwise, the typedef
> > is of only limited usefulness.
> >
> > E.g., use this:
> >
> > typedef void (InvTransformFunc)(arg1, arg2, arg3);
> >
> > Then in other headers you can declare
> >
> > InvTransformFunc MyTransform;
> >
> > So that when you actually write the code for MyTransform, the
> > prototype will be type checked by the compiler.
> >
> > And of course, in your references, you just use
> >
> > typedef struct foo {
> >     ...
> >     InvTransformFunc *inv_transform;
> >     ...
> > } foo;
> >
> > And then it's not necessary to comment "inverse transform function
> > pointer" - it's already obvious from the text.
> 
> Thanks alot! Updated stuff attached. Ok to commit?

Yes, I won't mind you improving Indeo so do what you feel is right.
You can add yourself to maintainers as well.

> Best regards
> Maxim




More information about the ffmpeg-devel mailing list