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

Clément Bœsch ubitux at gmail.com
Thu Feb 17 18:00:25 CET 2011


On Thu, Feb 17, 2011 at 05:36:19PM +0100, Ingo Brückl wrote:
> [...]
> > why do you do that? It is imo much more confusing.
> 
> It's in the article Diego referred me to. The structure contains a pointer
> and you can't initialize it using calloc().
> 
> I was already feeling uncomfortable when I saw this calloc() the first time,
> because I knew that a NULL pointer may not always have the value of "zero".
> The article enlightened me.
> 

Well, hopefully, it is zero.

IMO the could should simply be:

    Fonts[id] = calloc(1, sizeof(*Fonts[id]));
    if (!Fonts[id])
        return -1;

Whatever the guy says, it is the clearer way to do this imho. But well,
you shouldn't bother much about this.

-- 
Clément B.


More information about the MPlayer-cvslog mailing list