[MPlayer-dev-eng] [PATCH] libbs2b audio filter

Andrew Savchenko bircoph at gmail.com
Fri Mar 6 10:50:58 CET 2009


Hi,

On Thursday 05 March 2009 19:55, Uoti Urpala wrote:
[...]
> > > You could use char * for the pointer arithmetic.
> >
> > Afaik char is not garantied to be exactly 8 bit width. I used
> > u_int8_t as Reimar suggested.
>
> Your first sentence is true, but the second doesn't follow. What
> kind of setup do you imagine where char would not be exactly 8
> bits, but uint8_t would work better for this use?

I do not care about internals of the setup. I know that according 
to the ISO C, pagagraph 7.18.1.1, (u)intN_t types are optional, 
but if they are defined, the standard requires them to be 
*exactly* N bytes width.

> > Why? It isn't fast definitely, but it should work anyway if
> > number and type of arguments will be compatible with those
> > declared in the function prototype of actually called
> > function.
>
> You are _not_ calling it with compatible argument types. If you
> were then you could declare the function pointer with those
> correct types and there would be no warnings.

And there is NO warnings, just test it )).

> You are calling it 
> with a "void *" second argument, while the actual functions have
> incompatible argument types like "float *" or "short *". You can
> give a void * as a parameter to a function that has been
> declared to take any pointer type because the compiler allows
> automatic conversion from the void * to the argument type, but
> here such automatic conversion cannot happen because the
> function pointer hasn't been declared with the correct type and
> so the compiler doesn't know the actual type of the function
> called.

Yes, if I specify any arguments of the function, this will produce 
warnings for incompatible arguments, but I use pointer to a 
function without any information of number or type of arguments, 
so it is ok until I use proper function to an appropriate data 
type.

> > > +        if (!sscanf(arg,"%i:%i", &opt[0], &opt[1]))
> > > +        {
> > >
> > > Put opening brace on the same line as the "if".
> >
> > Why? IMO this kind of indentation makes it easier to read the
> > code.
>
> Others disagree, and you're not going to be the only one reading
> the source.

OK, but IMO this is not a strict requirement, there is no single 
word of it in DOCS/tech, this is your own opinion. But it is 
easier to change the style than arguing forever.

-- 
Best regards,
Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libbs2b-filter-v3.patch
Type: text/x-diff
Size: 7849 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090306/797d2daa/attachment.patch>
-------------- 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/mplayer-dev-eng/attachments/20090306/797d2daa/attachment.pgp>


More information about the MPlayer-dev-eng mailing list