changeset 32817:a104f879bfbc

Clean up variable declarations. Don't initialize variables other than with constants. Use appropriate declaration for array indices. Don't initialize variables if they will be set later in any case.
author ib
date Wed, 16 Feb 2011 12:00:29 +0000
parents 180883b8a488
children 70765e0cd33b
files gui/skin/font.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/font.c	Wed Feb 16 11:09:57 2011 +0000
+++ b/gui/skin/font.c	Wed Feb 16 12:00:29 2011 +0000
@@ -30,8 +30,7 @@
 
 int fntAddNewFont( char * name )
 {
- int id;
- int i;
+ int id, i;
 
  for( id=0;id<MAX_FONTS;id++ )
    if ( !Fonts[id] ) break;
@@ -69,7 +68,9 @@
  unsigned char * ptmp;
  unsigned char   command[32];
  unsigned char   param[256];
- int             id = fntAddNewFont( fname ), n;
+ int             id, n;
+
+ id = fntAddNewFont( fname );
 
  if ( id < 0 ) return id;
 
@@ -237,7 +238,8 @@
 txSample * fntRender( wItem * item,int px,char * txt )
 {
  unsigned char * u;
- int 	         c, i, dx = 0, tw, th, fbw, iw, id, ofs;
+ unsigned int    i;
+ int 	         c, dx, tw, th, fbw, iw, id, ofs;
  int 		 x,y,fh,fw,fyc,yc;
  uint32_t      * ibuf;
  uint32_t      * obuf;
@@ -283,7 +285,7 @@
      case fntAlignRight:  dx=iw - tw; break;
     }
 
-  } else dx+=px;
+  } else dx=px;
 
  ofs=dx;