[MPlayer-cvslog] r36858 - in trunk: gui/dialog/equalizer.c gui/dialog/menu.c gui/dialog/playlist.c gui/dialog/preferences.c gui/dialog/skinbrowser.c gui/interface.c gui/ui/actions.c libmpdemux/demux_mpg.c libvo/vo_...

reimar subversion at mplayerhq.hu
Sun Feb 16 16:44:36 CET 2014


Author: reimar
Date: Sun Feb 16 16:44:36 2014
New Revision: 36858

Log:
Avoid many pointer cast warnings.

Fixes most occurrences of
"cast from pointer to integer of different size"
and
"cast to pointer from integer of different size"
warnings.

Modified:
   trunk/gui/dialog/equalizer.c
   trunk/gui/dialog/menu.c
   trunk/gui/dialog/playlist.c
   trunk/gui/dialog/preferences.c
   trunk/gui/dialog/skinbrowser.c
   trunk/gui/interface.c
   trunk/gui/ui/actions.c
   trunk/libmpdemux/demux_mpg.c
   trunk/libvo/vo_svga.c
   trunk/libvo/vo_xv.c
   trunk/mplayer.c

Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/dialog/equalizer.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -133,7 +133,7 @@ static gboolean eqHScaleMotion( GtkWidge
  (void) widget;
  (void) event;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
   {
    case 0: eq.gain=A3125adj->value; break;
    case 1: eq.gain=A6250adj->value; break;
@@ -148,7 +148,7 @@ static gboolean eqHScaleMotion( GtkWidge
    default: return FALSE;
   }
  eq.gain=-eq.gain;
- eq.band=(int)user_data;
+ eq.band=(intptr_t)user_data;
  if ( Channel == -1 )
   {
    int i;
@@ -164,7 +164,7 @@ static gboolean eqVScaleMotion( GtkWidge
  (void) widget;
  (void) event;
 
- switch( (int)user_data )
+ switch( (intptr_t)user_data )
   {
    case 1: mplayer( MPLAYER_SET_CONTRAST,VContrastadj->value,0 );      break;
    case 2: mplayer( MPLAYER_SET_BRIGHTNESS,VBrightnessadj->value,0 );  break;
@@ -179,7 +179,7 @@ static void eqButtonReleased( GtkButton 
 {
  (void) button;
 
- switch( (int)user_data )
+ switch( (intptr_t)user_data )
   {
    case 0:
         gtk_widget_destroy( Equalizer );
@@ -565,7 +565,7 @@ static void ecButtonReleased( GtkButton 
 {
  (void) button;
 
- if ( (int)user_data )
+ if ( (intptr_t)user_data )
  { // if you pressed Ok
   nfree( gtkEquChannel1 ); gtkEquChannel1=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel1 ) ) );
   nfree( gtkEquChannel2 ); gtkEquChannel2=gstrdup( gtk_entry_get_text( GTK_ENTRY( CEChannel2 ) ) );

Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/dialog/menu.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -137,7 +137,7 @@ static GtkWidget * AddMenuCheckItem(GtkW
 
  gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state);
  gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
-   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
+   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)(intptr_t)Number );
  gtk_menu_item_right_justify (GTK_MENU_ITEM (Item));
  gtk_widget_show_all(Item);
 
@@ -168,7 +168,7 @@ GtkWidget * AddMenuItem( GtkWidget *wind
 
  gtk_menu_append( GTK_MENU( SubMenu ),Item );
  gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
-   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
+   GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)(intptr_t)Number );
 
  gtk_menu_item_right_justify (GTK_MENU_ITEM (Item));
  gtk_widget_show_all(Item);

Modified: trunk/gui/dialog/playlist.c
==============================================================================
--- trunk/gui/dialog/playlist.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/dialog/playlist.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -97,7 +97,7 @@ static void plRowSelect( GtkCList * clis
  (void) column;
  (void) event;
 
- switch ( (int) user_data )
+ switch ( (intptr_t) user_data )
   {
    case 0: CLFileSelected[row]=True; break;
    case 1: CLListSelected[row]=True; break;
@@ -110,7 +110,7 @@ static void plUnRowSelect( GtkCList * cl
  (void) column;
  (void) event;
 
- switch ( (int) user_data )
+ switch ( (intptr_t) user_data )
   {
    case 0: CLFileSelected[row]=False; break;
    case 1: CLListSelected[row]=False; break;
@@ -121,7 +121,7 @@ static void plButtonReleased( GtkButton 
 {
  (void) button;
 
- switch ( (int) user_data )
+ switch ( (intptr_t) user_data )
  {
   case 1: // ok
        {
@@ -158,7 +158,7 @@ static void plButtonReleased( GtkButton 
 	    if ( old )
 	     {
 	      listMgr( PLAYLIST_ITEM_SET_CURR,old );
-	      guiInfo.Track = (int) listMgr( PLAYLIST_ITEM_GET_POS,old );
+	      guiInfo.Track = (intptr_t) listMgr( PLAYLIST_ITEM_GET_POS,old );
 	      item = NULL;
 	     }
 	   }
@@ -171,7 +171,7 @@ static void plButtonReleased( GtkButton 
 	   }
 	 }
 	else if (isPlaylistStreamtype && !guiInfo.Playing) uiUnsetFile();
-	guiInfo.Tracks = (int) listMgr( PLAYLIST_ITEM_GET_POS,0 );
+	guiInfo.Tracks = (intptr_t) listMgr( PLAYLIST_ITEM_GET_POS,0 );
 	free(curr.path);
 	free(curr.name);
        }
@@ -254,7 +254,7 @@ static gboolean plKeyReleased( GtkWidget
    if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON ) plButtonReleased( NULL, user_data );
    else
     {
-     switch ( (int) user_data )
+     switch ( (intptr_t) user_data )
       {
        case 0:
             plButtonReleased( NULL, (void *) 3 );
@@ -281,7 +281,7 @@ static gboolean plEvent ( GtkWidget * wi
   {
     if ( gtk_clist_get_selection_info( GTK_CLIST( widget ), bevent->x, bevent->y, &row, &col ) )
     {
-      switch ( (int) user_data )
+      switch ( (intptr_t) user_data )
       {
         case 0:
           CLFileSelected[row] = True;

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/dialog/preferences.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -226,7 +226,7 @@ static void prEntry( GtkEditable * edita
 
  (void) editable;
 
- switch( (int)user_data )
+ switch( (intptr_t)user_data )
   {
 #ifdef CONFIG_FREETYPE
    case 0: // font encoding
@@ -281,7 +281,7 @@ static void prButton( GtkButton * button
 
  (void) button;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
   {
    case bOk:
 	/* 1st page */
@@ -433,7 +433,7 @@ static gboolean prHScaler( GtkWidget * w
  (void) widget;
  (void) event;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
   {
    case 0: // extra stereo coefficient
 	if ( !guiInfo.Playing ) break;
@@ -482,7 +482,7 @@ static void prToggled( GtkToggleButton *
 
  (void) togglebutton;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
   {
    case 0: // extra stereo coefficient
 	if ( guiInfo.Playing )
@@ -505,7 +505,7 @@ static void prToggled( GtkToggleButton *
    case 5:
    case 6:
    case 7:
-	mplayer( MPLAYER_SET_FONT_AUTOSCALE,(int)user_data - 4,0 );
+	mplayer( MPLAYER_SET_FONT_AUTOSCALE,(intptr_t)user_data - 4,0 );
 	break;
    case 8:
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtk_widget_set_sensitive( SBCache,TRUE );
@@ -540,7 +540,7 @@ static void prCListRow( GtkCList * clist
  (void) column;
  (void) event;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
   {
    case 0: // audio driver
 	gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver );
@@ -1598,7 +1598,7 @@ static void audioButton(GtkButton *butto
 
   (void) button;
 
-  switch( (int)user_data ) {
+  switch( (intptr_t)user_data ) {
     case 1:
 #ifdef CONFIG_OSS_AUDIO
       if (strncmp(ao_driver[0], "oss", 3) == 0) {
@@ -1814,7 +1814,7 @@ static void dxr3Button( GtkButton * butt
 {
  (void) button;
 
- switch ( (int)user_data )
+ switch ( (intptr_t)user_data )
  {
   case 0: // Ok
        nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/dialog/skinbrowser.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -51,7 +51,7 @@ static void prButton( GtkButton * button
 
  if ( sbSelectedSkin )
  {
-  switch ( (int)user_data )
+  switch ( (intptr_t)user_data )
    {
     case 0: // cancel
 	if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) uiChangeSkin( gtkOldSkin );

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/interface.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -209,7 +209,7 @@ void guiInit(void)
 
     if (playlist && !filename) {
         uiSetFile(playlist->path, playlist->name, STREAMTYPE_FILE);
-        guiInfo.Tracks = (int)listMgr(PLAYLIST_ITEM_GET_POS, 0);
+        guiInfo.Tracks = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
         guiInfo.Track  = 1;
         filename       = NULL; // don't start playing
     }
@@ -332,12 +332,12 @@ int gui(int what, void *data)
 
     case GUI_SET_STATE:
 
-        switch ((int)data) {
+        switch ((intptr_t)data) {
         case GUI_STOP:
         case GUI_PLAY:
 // if ( !gtkShowVideoWindow ) wsWindowVisibility( &guiApp.videoWindow,wsHideWindow );
         case GUI_PAUSE:
-            guiInfo.Playing = (int)data;
+            guiInfo.Playing = (intptr_t)data;
             break;
         }
 
@@ -359,9 +359,9 @@ int gui(int what, void *data)
 
     case GUI_RUN_COMMAND:
 
-        mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)data);
+        mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)(intptr_t)data);
 
-        switch ((int)data) {
+        switch ((intptr_t)data) {
         case MP_CMD_VO_FULLSCREEN:
             uiEvent(evFullScreen, True);
             break;
@@ -619,7 +619,7 @@ int gui(int what, void *data)
         switch (guiInfo.StreamType) {
         case STREAMTYPE_FILE:
         case STREAMTYPE_STREAM:
-            guiInfo.Tracks = (int)listMgr(PLAYLIST_ITEM_GET_POS, 0);
+            guiInfo.Tracks = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
             break;
 
         case STREAMTYPE_CDDA:
@@ -812,7 +812,7 @@ int gui(int what, void *data)
         if (next) {
             uiSetFile(next->path, next->name, STREAMTYPE_FILE);
             guiInfo.NewPlay = GUI_FILE_NEW;
-            guiInfo.Track   = (int)listMgr(PLAYLIST_ITEM_GET_POS, next);
+            guiInfo.Track   = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
         } else {
             if (guiInfo.NewPlay == GUI_FILE_NEW)
                 break;

Modified: trunk/gui/ui/actions.c
==============================================================================
--- trunk/gui/ui/actions.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/gui/ui/actions.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -745,7 +745,7 @@ void uiCurr(void)
         if (curr) {
             uiSetFile(curr->path, curr->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = False;
-            guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, curr);
+            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, curr);
             break;
         }
 
@@ -815,7 +815,7 @@ void uiPrev(void)
         if (prev) {
             uiSetFile(prev->path, prev->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, prev);
+            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, prev);
             break;
         }
 
@@ -883,7 +883,7 @@ void uiNext(void)
         if (next) {
             uiSetFile(next->path, next->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (int)listMgr(PLAYLIST_ITEM_GET_POS, next);
+            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
             break;
         }
 

Modified: trunk/libmpdemux/demux_mpg.c
==============================================================================
--- trunk/libmpdemux/demux_mpg.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/libmpdemux/demux_mpg.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -800,7 +800,7 @@ static int demux_mpg_gxf_fill_buffer(dem
     return 0;
   }
   {
-    register uint32_t state = (uint32_t)demux->priv;
+    register uint32_t state = (uintptr_t)demux->priv;
     register int pos = -len;
     unsigned char *buf = &pack->buffer[len];
     do {
@@ -808,7 +808,7 @@ static int demux_mpg_gxf_fill_buffer(dem
       if (unlikely((state | 3) == 0x1bf))
         pos = find_end(&buf, pos, demux->stream);
     } while (++pos < 0);
-    demux->priv = (void *)state;
+    demux->priv = (void *)(uintptr_t)state;
     len = buf - pack->buffer;
   }
   if (len < STREAM_BUFFER_SIZE)

Modified: trunk/libvo/vo_svga.c
==============================================================================
--- trunk/libvo/vo_svga.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/libvo/vo_svga.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -243,7 +243,7 @@ static uint32_t svga_draw_image(mp_image
 
     if(mpi->flags & MP_IMGFLAG_DIRECT){
         mp_msg(MSGT_VO,MSGL_DBG3, "vo_svga: drawing direct rendered surface\n");
-        cpage=(uint32_t)mpi->priv;
+        cpage=(uintptr_t)mpi->priv;
         assert((cpage>=0)&&(cpage<max_pages));
         return VO_TRUE; //it's already done
     }
@@ -703,7 +703,7 @@ static uint32_t get_image(mp_image_t *mp
             mpi->stride[0] = mode_stride;
             mpi->planes[0] = PageStore[page].vbase +
                              y_pos*mode_stride + (x_pos*mpi->bpp)/8;
-            mpi->priv=(void *)page;
+            mpi->priv=(void *)(uintptr_t)page;
             mp_msg(MSGT_VO,MSGL_DBG3, "vo_svga: direct render allocated! page=%d\n",page);
             return VO_TRUE;
         }

Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/libvo/vo_xv.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -423,7 +423,7 @@ static uint32_t draw_image(mp_image_t * 
     if (mpi->flags & MP_IMGFLAG_DIRECT)
     {
         // direct rendering:
-        current_buf = (int) (mpi->priv);        // hack!
+        current_buf = (intptr_t)mpi->priv;        // hack!
         return VO_TRUE;
     }
     if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK)
@@ -508,7 +508,7 @@ static uint32_t get_image(mp_image_t * m
             }
         }
         mpi->flags |= MP_IMGFLAG_DIRECT;
-        mpi->priv = (void *) current_buf;
+        mpi->priv = (void *)(intptr_t)current_buf;
 //      printf("mga: get_image() SUCCESS -> Direct Rendering ENABLED\n");
         return VO_TRUE;
     }

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sun Feb 16 16:44:34 2014	(r36857)
+++ trunk/mplayer.c	Sun Feb 16 16:44:36 2014	(r36858)
@@ -3061,7 +3061,7 @@ int main(int argc, char *argv[])
     if (use_gui) {
         guiInit();
         gui(GUI_SET_CONTEXT, mpctx);
-        gui(GUI_SET_STATE, (void *)(filename ? GUI_PLAY : GUI_STOP));
+        gui(GUI_SET_STATE, (void *)(intptr_t)(filename ? GUI_PLAY : GUI_STOP));
     }
 #endif
 
@@ -3103,7 +3103,7 @@ play_next_file:
                 if (cmd->id == MP_CMD_GUI)
                     gui(GUI_RUN_MESSAGE, cmd->args[0].v.s);
                 else
-                    gui(GUI_RUN_COMMAND, (void *)cmd->id);
+                    gui(GUI_RUN_COMMAND, (void *)(intptr_t)cmd->id);
                 mp_cmd_free(cmd);
             }
         }


More information about the MPlayer-cvslog mailing list