[MPlayer-cvslog] r32906 - trunk/gui/skin/font.c

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Feb 17 17:54:45 CET 2011

On 16 Feb 2011, at 18:56, Ingo Brückl <ib at wupperonline.de> wrote:
> Clément Boesch wrote on Wed, 16 Feb 2011 17:55:07 +0100:
>> It will avoid a lot of cast all over the code.
> Yes, that's true, but it "lies" about the parameter and gives the compiler no
> chance to warn me if I call gfree(p) instead of gfree(&p)!

Neither will it warn you with the cast, so the casts are still completely pointless clutter.

> Thinking about avoiding the cast, maybe a macro like
>  #define nfree(p) { free(p); p = NULL; }
> would be a suitable replacement for gfree()?

Definitely not, macros have a huge amount of issues.
In addition to made-up things like doing nfree(p++), your macro construction also fails
If (a) nfree(p); else a = p;
For example.

More information about the MPlayer-cvslog mailing list