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

Uoti Urpala uoti.urpala at pp1.inet.fi
Thu Mar 5 14:39:41 CET 2009


On Thu, 2009-03-05 at 15:49 +0300, Andrew Savchenko wrote:
> Note concerning -Wno-pointer-arith: ISO C stardard (ISO/IEC 
> 9899:TC3), section 6.2.4, paragraph 27 states: "A pointer to void 
> shall have the same representation and alignment requirements as a
> pointer to a character type.", but gcc (as of version 4.3.0) issues

"Same representation and alignment requirements" does NOT mean the same
behavior for arithmetic.

> a warning in this case and this warning must be disabled as bogus.

Your reading of the standard is bogus.

> Necessity of using void* pointers and pointer to function ensues 
> from aiming to avoid six different play functions for different 
> types of audio data or even worse alternative: switch statement 
> inside single play function. Original processing functions from

You could use char * for the pointer arithmetic.


> +typedef struct af_bs2b_s

I'd use the struct type directly leave leave out the typedef. And in any
case using a _s suffix for a struct name is just stupid. (Yes, there is
existing stupid code in MPlayer, but that doesn't mean you should use it
as an example.)

> +    void (*bs2b)();

You can't pretend that the function has no argument type by leaving it
out of the declaration. As long as the library functions actually have
different types it is NOT possible to call them from a single location.

+        if (!sscanf(arg,"%i:%i", &opt[0], &opt[1]))
+        {

Put opening brace on the same line as the "if".




More information about the MPlayer-dev-eng mailing list