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

ib subversion at mplayerhq.hu
Thu Feb 10 14:24:00 CET 2011


Author: ib
Date: Thu Feb 10 14:24:00 2011
New Revision: 32877

Log:
Remove desultory parameter checks.

These functions will only be called with parameters already checked
or the checked parameters don't harm.

Modified:
   trunk/gui/skin/font.c

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Thu Feb 10 13:28:43 2011	(r32876)
+++ trunk/gui/skin/font.c	Thu Feb 10 14:24:00 2011	(r32877)
@@ -189,8 +189,6 @@ int fntTextWidth( int id,char * str )
  gboolean utf8;
  unsigned char *p;
 
- if ( ( !Fonts[id] )||( !str[0] ) ) return 0;
-
  utf8 = g_utf8_validate( str, -1, NULL);
  p = (unsigned char *) str;
 
@@ -209,8 +207,6 @@ int fntTextHeight( int id,char * str )
  gboolean utf8;
  unsigned char *p;
 
- if ( ( !Fonts[id] )||( !str[0] ) ) return 0;
-
  utf8 = g_utf8_validate( str, -1, NULL);
  p = (unsigned char *) str;
 
@@ -234,15 +230,12 @@ txSample * fntRender( wItem * item,int p
  uint32_t      * obuf;
  gboolean        utf8;
 
- iw=item->width;
  id=item->fontid;
+ tw=fntTextWidth( id,txt );
 
- if ( ( !item )||
-      ( !Fonts[id] )||
-      ( !txt[0] )||
-      ( !fntTextWidth( id,txt ) ) ) return NULL;
+ if ( !tw ) return NULL;
 
- tw=fntTextWidth( id,txt );
+ iw=item->width;
  fbw=Fonts[id]->Bitmap.Width;
 
  if ( item->Bitmap.Image == NULL )


More information about the MPlayer-cvslog mailing list