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

Ingo Brückl ib at wupperonline.de
Thu Feb 17 17:36:19 CET 2011


Clément Boesch wrote on Thu, 17 Feb 2011 17:18:56 +0100:

>> + bmpFont init = {0};
>> - if ( ( Fonts[id]=calloc( 1,sizeof( bmpFont ) ) ) == NULL ) return -1;
>> + if ( ( Fonts[id]=malloc( sizeof( bmpFont ) ) ) == NULL ) return -1;
>> + *Fonts[id] = init;

> Sorry to nag you again but...

You don't. I learn so much new by this.

> 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.

Ingo


More information about the MPlayer-cvslog mailing list