changeset 33266:de4f5f183ddb

Initialize appMPlayer differently. Perform a direct initialization instead of doing it by a function call.
author ib
date Tue, 03 May 2011 13:42:00 +0000
parents 62c0471bcf8c
children 5a2452e3404e
files gui/app.c gui/app.h gui/interface.c
diffstat 3 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gui/app.c	Tue May 03 13:19:39 2011 +0000
+++ b/gui/app.c	Tue May 03 13:42:00 2011 +0000
@@ -23,7 +23,15 @@
 
 #include "libavutil/common.h"
 
-guiItems appMPlayer;
+guiItems appMPlayer = {
+    { 0 }, { 0 }, 0,
+    { 0 }, { 0 },
+    { 0 }, { 0 }, 0,
+    { 0 }, { 0 }, { 0 }, 0,
+    -1,    { 0 },
+    -1,    { 0 },
+    -1,    { 0 }
+};
 
 static const evName evNames[] = {
     { evNone,              "evNone"              },
@@ -84,13 +92,6 @@
     memset(item, 0, sizeof(*item));
 }
 
-void appInitStruct(void)
-{
-    appMPlayer.IndexOfMainItems = -1;
-    appMPlayer.IndexOfBarItems  = -1;
-    appMPlayer.IndexOfMenuItems = -1;
-}
-
 void appFreeStruct(void)
 {
     int i;
@@ -114,7 +115,10 @@
     for (i = 0; i <= appMPlayer.IndexOfMenuItems; i++)
         appClearItem(&appMPlayer.menuItems[i]);
 
-    appInitStruct();
+    appMPlayer.IndexOfMainItems = -1;
+    appMPlayer.IndexOfBarItems  = -1;
+    appMPlayer.IndexOfMenuItems = -1;
+
     fntFreeFont();
 }
 
--- a/gui/app.h	Tue May 03 13:19:39 2011 +0000
+++ b/gui/app.h	Tue May 03 13:42:00 2011 +0000
@@ -194,7 +194,6 @@
 
 int appFindMessage(unsigned char *str);
 void appFreeStruct(void);
-void appInitStruct(void);
 void btnModify(int event, float state);
 void btnSet(int event, int set);
 
--- a/gui/interface.c	Tue May 03 13:19:39 2011 +0000
+++ b/gui/interface.c	Tue May 03 13:42:00 2011 +0000
@@ -169,8 +169,6 @@
     guiIntfStruct.Balance    = 50.0f;
     guiIntfStruct.StreamType = -1;
 
-    appInitStruct();
-
     memset(&gtkEquChannels, 0, sizeof(gtkEquChannels));
 
 #ifdef CONFIG_DXR3