changeset 32946:d551faf8d07e

Simplify appClearItem() by using memset(). (Note: None of the systems known or tested have a problem with initializing numeric zero and pointer null as all-bits-zero.)
author ib
date Sun, 06 Mar 2011 12:30:49 +0000
parents 15aecb36f23e
children 0e4fd1834f76
files gui/app.c
diffstat 1 files changed, 1 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/gui/app.c	Sun Mar 06 12:21:52 2011 +0000
+++ b/gui/app.c	Sun Mar 06 12:30:49 2011 +0000
@@ -78,30 +78,11 @@
 
 static void appClearItem(wItem *item)
 {
-    item->type   = itNone;
-    item->x      = 0;
-    item->y      = 0;
-    item->width  = 0;
-    item->height = 0;
     bpFree(&item->Bitmap);
     bpFree(&item->Mask);
-    item->fontid = 0;
-    item->align  = fntAlignLeft;
     gfree((void **)&item->label);
-    item->pwidth    = 0;
-    item->pheight   = 0;
-    item->numphases = 0;
-    item->value     = 0;
-    item->message   = evNone;
-    item->R = 0;
-    item->G = 0;
-    item->B = 0;
     gfree((void **)&item->text);
-    item->textwidth = 0;
-    item->starttime = 0;
-    item->last_x    = 0;
-    item->pressed   = btnDisabled;
-    item->tmp       = 0;
+    memset(item, 0, sizeof(*item));
 }
 
 void appInitStruct(void)