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

ib subversion at mplayerhq.hu
Thu Feb 17 16:06:38 CET 2011


Author: ib
Date: Thu Feb 17 16:06:37 2011
New Revision: 32923

Log:
Do proper and portable initialization.

Modified:
   trunk/gui/skin/font.c

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Thu Feb 17 14:35:58 2011	(r32922)
+++ trunk/gui/skin/font.c	Thu Feb 17 16:06:37 2011	(r32923)
@@ -27,19 +27,21 @@
 #include "../interface.h"
 #include "libavutil/avstring.h"
 
-bmpFont * Fonts[MAX_FONTS] = {NULL};
+bmpFont * Fonts[MAX_FONTS] = {0};
 
 int fntAddNewFont( char * name )
 {
  int id, i;
+ bmpFont init = {0};
 
  for( id=0;id<MAX_FONTS;id++ )
    if ( !Fonts[id] ) break;
 
  if ( id == MAX_FONTS ) return -2;
 
- if ( ( Fonts[id]=calloc( 1,sizeof( bmpFont ) ) ) == NULL ) return -1;
+ if ( ( Fonts[id]=malloc( sizeof( bmpFont ) ) ) == NULL ) return -1;
 
+ *Fonts[id] = init;
  av_strlcpy( Fonts[id]->name,name,MAX_FONT_NAME );
  for ( i=0;i<ASCII_CHRS+EXTRA_CHRS;i++ )
    Fonts[id]->Fnt[i].x=Fonts[id]->Fnt[i].y=Fonts[id]->Fnt[i].sx=Fonts[id]->Fnt[i].sy=-1;


More information about the MPlayer-cvslog mailing list