[MPlayer-cvslog] r36875 - in trunk/gui: interface.c win32/interface.c

ib subversion at mplayerhq.hu
Mon Feb 17 15:33:03 CET 2014


Author: ib
Date: Mon Feb 17 15:33:03 2014
New Revision: 36875

Log:
Simplify code.

Use a variable and cast once.

Modified:
   trunk/gui/interface.c
   trunk/gui/win32/interface.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Mon Feb 17 14:57:24 2014	(r36874)
+++ trunk/gui/interface.c	Mon Feb 17 15:33:03 2014	(r36875)
@@ -319,7 +319,7 @@ int gui(int what, void *data)
 #ifdef CONFIG_DVDREAD
     dvd_priv_t *dvd;
 #endif
-    int msg, state;
+    int idata = (intptr_t)data, msg, state;
     stream_t *stream = NULL;
     sh_audio_t *sh_audio;
     mixer_t *mixer;
@@ -333,12 +333,12 @@ int gui(int what, void *data)
 
     case GUI_SET_STATE:
 
-        switch ((intptr_t)data) {
+        switch (idata) {
         case GUI_STOP:
         case GUI_PLAY:
 // if ( !gtkShowVideoWindow ) wsWindowVisibility( &guiApp.videoWindow,wsHideWindow );
         case GUI_PAUSE:
-            guiInfo.Playing = (intptr_t)data;
+            guiInfo.Playing = idata;
             break;
         }
 
@@ -360,9 +360,9 @@ int gui(int what, void *data)
 
     case GUI_RUN_COMMAND:
 
-        mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)(intptr_t)data);
+        mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", idata);
 
-        switch ((intptr_t)data) {
+        switch (idata) {
         case MP_CMD_VO_FULLSCREEN:
             uiEvent(evFullScreen, True);
             break;

Modified: trunk/gui/win32/interface.c
==============================================================================
--- trunk/gui/win32/interface.c	Mon Feb 17 14:57:24 2014	(r36874)
+++ trunk/gui/win32/interface.c	Mon Feb 17 15:33:03 2014	(r36875)
@@ -556,6 +556,7 @@ void guiDone(void)
 /* this function gets called by mplayer to update the gui */
 int gui(int what, void *data)
 {
+    int idata = (intptr_t) data;
     stream_t *stream = data;
 #ifdef CONFIG_DVDREAD
     dvd_priv_t *dvdp;
@@ -686,7 +687,7 @@ int gui(int what, void *data)
             break;
         case GUI_SET_STATE:
         {
-            guiInfo.Playing = (intptr_t) data;
+            guiInfo.Playing = idata;
             switch (guiInfo.Playing)
             {
                 case GUI_PLAY:
@@ -710,9 +711,9 @@ int gui(int what, void *data)
         }
         case GUI_RUN_COMMAND:
         {
-            mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", (int)(intptr_t) data);
+            mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", idata);
             /* MPlayer asks us to quit */
-            switch((intptr_t) data)
+            switch(idata)
             {
                 case MP_CMD_VO_FULLSCREEN:
                     uiFullScreen();


More information about the MPlayer-cvslog mailing list