[MPlayer-cvslog] r33016 - trunk/gui/app.c

ib subversion at mplayerhq.hu
Thu Mar 3 15:09:50 CET 2011


Author: ib
Date: Thu Mar  3 15:09:50 2011
New Revision: 33016

Log:
Clean up appInitStruct().

There is no need to memset or set a variable to zero
after it has already been erased.

Additionally, rearrange statements to meet order in structure.

Modified:
   trunk/gui/app.c

Modified: trunk/gui/app.c
==============================================================================
--- trunk/gui/app.c	Thu Mar  3 14:58:48 2011	(r33015)
+++ trunk/gui/app.c	Thu Mar  3 15:09:50 2011	(r33016)
@@ -120,36 +120,25 @@ void appInitStruct(void)
 {
     int i;
 
-    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++)
-        appClearItem(&appMPlayer.mainItems[i]);
-    for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++)
-        appClearItem(&appMPlayer.barItems[i]);
-    for (i = 0; i < appMPlayer.NumberOfMenuItems + 1; i++)
-        appClearItem(&appMPlayer.menuItems[i]);
-
-    memset(appMPlayer.mainItems, 0, 256 * sizeof(wItem));
-
-    memset(appMPlayer.menuItems, 0, 64 * sizeof(wItem));
-
-    memset(appMPlayer.barItems, 0, 256 * sizeof(wItem));
-
     appClearItem(&appMPlayer.main);
     appMPlayer.mainDecoration = 0;
 
     appClearItem(&appMPlayer.sub);
-    appMPlayer.sub.width  = 0;
-    appMPlayer.sub.height = 0;
 
     appClearItem(&appMPlayer.bar);
+    appMPlayer.barIsPresent = 0;
+
     appClearItem(&appMPlayer.menuBase);
     appClearItem(&appMPlayer.menuSelected);
-
-    appMPlayer.sub.R         = appMPlayer.sub.G = appMPlayer.sub.B = 0;
-    appMPlayer.bar.R         = appMPlayer.bar.G = appMPlayer.bar.B = 0;
-    appMPlayer.main.R        = appMPlayer.main.G = appMPlayer.main.B = 0;
-    appMPlayer.barIsPresent  = 0;
     appMPlayer.menuIsPresent = 0;
 
+    for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++)
+        appClearItem(&appMPlayer.mainItems[i]);
+    for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++)
+        appClearItem(&appMPlayer.barItems[i]);
+    for (i = 0; i < appMPlayer.NumberOfMenuItems + 1; i++)
+        appClearItem(&appMPlayer.menuItems[i]);
+
     appResetStruct();
 }
 


More information about the MPlayer-cvslog mailing list