# HG changeset patch # User ib # Date 1392647583 0 # Node ID f5320e43d45832cc4e5443603297f6321af426b5 # Parent 1045c5762718c3da81717eaae10b4606d8a4a940 Simplify code. Use a variable and cast once. diff -r 1045c5762718 -r f5320e43d458 gui/interface.c --- a/gui/interface.c Mon Feb 17 13:57:24 2014 +0000 +++ b/gui/interface.c Mon Feb 17 14:33:03 2014 +0000 @@ -319,7 +319,7 @@ #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 @@ 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 @@ 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; diff -r 1045c5762718 -r f5320e43d458 gui/win32/interface.c --- a/gui/win32/interface.c Mon Feb 17 13:57:24 2014 +0000 +++ b/gui/win32/interface.c Mon Feb 17 14:33:03 2014 +0000 @@ -556,6 +556,7 @@ /* 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 @@ break; case GUI_SET_STATE: { - guiInfo.Playing = (intptr_t) data; + guiInfo.Playing = idata; switch (guiInfo.Playing) { case GUI_PLAY: @@ -710,9 +711,9 @@ } 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();