[MPlayer-cvslog] r36872 - in trunk/gui/dialog: equalizer.c menu.c playlist.c preferences.c skinbrowser.c

ib subversion at mplayerhq.hu
Mon Feb 17 03:30:49 CET 2014


Author: ib
Date: Mon Feb 17 03:30:49 2014
New Revision: 36872

Log:
Fix careless pointer parameter handling.

User proper GLib macros to avoid pointer cast warnings.

This renders the usage of intptr_t redundant (introduced in r36858).

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

Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c	Mon Feb 17 02:28:05 2014	(r36871)
+++ trunk/gui/dialog/equalizer.c	Mon Feb 17 03:30:49 2014	(r36872)
@@ -133,7 +133,7 @@ static gboolean eqHScaleMotion( GtkWidge
  (void) widget;
  (void) event;
 
- switch ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(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=(intptr_t)user_data;
+ eq.band=GPOINTER_TO_INT(user_data);
  if ( Channel == -1 )
   {
    int i;
@@ -164,7 +164,7 @@ static gboolean eqVScaleMotion( GtkWidge
  (void) widget;
  (void) event;
 
- switch( (intptr_t)user_data )
+ switch( GPOINTER_TO_INT(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( (intptr_t)user_data )
+ switch( GPOINTER_TO_INT(user_data) )
   {
    case 0:
         gtk_widget_destroy( Equalizer );
@@ -435,29 +435,29 @@ static GtkWidget * CreateEqualizer( void
   gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
 
   gtk_signal_connect( GTK_OBJECT( Equalizer ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Equalizer );
-  gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus-in-event",GTK_SIGNAL_FUNC( eqFocus ),(void *)2 );
+  gtk_signal_connect( GTK_OBJECT( Equalizer ),"focus-in-event",GTK_SIGNAL_FUNC( eqFocus ),GINT_TO_POINTER(2) );
 
   gtk_signal_connect( GTK_OBJECT( ChannelsList ),"select-row",GTK_SIGNAL_FUNC( eqSelectChannelsListRow ),NULL );
 
-  gtk_signal_connect( GTK_OBJECT( A3125 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)0 );
-  gtk_signal_connect( GTK_OBJECT( A6250 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( A125 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( A250 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( A500 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)4 );
-  gtk_signal_connect( GTK_OBJECT( A1000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)5 );
-  gtk_signal_connect( GTK_OBJECT( A2000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)6 );
-  gtk_signal_connect( GTK_OBJECT( A4000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)7 );
-  gtk_signal_connect( GTK_OBJECT( A8000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)8 );
-  gtk_signal_connect( GTK_OBJECT( A16000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),(void*)9 );
+  gtk_signal_connect( GTK_OBJECT( A3125 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( A6250 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( A125 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(2) );
+  gtk_signal_connect( GTK_OBJECT( A250 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(3) );
+  gtk_signal_connect( GTK_OBJECT( A500 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(4) );
+  gtk_signal_connect( GTK_OBJECT( A1000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(5) );
+  gtk_signal_connect( GTK_OBJECT( A2000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(6) );
+  gtk_signal_connect( GTK_OBJECT( A4000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(7) );
+  gtk_signal_connect( GTK_OBJECT( A8000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(8) );
+  gtk_signal_connect( GTK_OBJECT( A16000 ),"motion-notify-event",GTK_SIGNAL_FUNC( eqHScaleMotion ),GINT_TO_POINTER(9) );
 
-  gtk_signal_connect( GTK_OBJECT( VContrast ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( VBrightness ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( VHue ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),(void *)4 );
+  gtk_signal_connect( GTK_OBJECT( VContrast ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( VBrightness ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),GINT_TO_POINTER(2) );
+  gtk_signal_connect( GTK_OBJECT( VHue ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),GINT_TO_POINTER(3) );
+  gtk_signal_connect( GTK_OBJECT( VSaturation ),"motion-notify-event",GTK_SIGNAL_FUNC( eqVScaleMotion ),GINT_TO_POINTER(4) );
 
-  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( Clear ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)1 );
-  gtk_signal_connect( GTK_OBJECT( Config ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),(void *)2 );
+  gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( Clear ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( Config ),"clicked",GTK_SIGNAL_FUNC( eqButtonReleased ),GINT_TO_POINTER(2) );
 
   gtk_signal_connect( GTK_OBJECT( Notebook ),"switch-page",GTK_SIGNAL_FUNC( eqNotebook ),NULL );
 
@@ -565,7 +565,7 @@ static void ecButtonReleased( GtkButton 
 {
  (void) button;
 
- if ( (intptr_t)user_data )
+ if ( GPOINTER_TO_INT(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 ) ) );
@@ -680,8 +680,8 @@ GtkWidget * CreateEquConfig( void )
 
   gtk_signal_connect( GTK_OBJECT( EquConfig ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&EquConfig );
 
-  gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)1 );
-  gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),(void *)0 );
+  gtk_signal_connect( GTK_OBJECT( ecOk ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( ecCancel ),"clicked",GTK_SIGNAL_FUNC( ecButtonReleased ),GINT_TO_POINTER(0) );
 
   gtk_window_add_accel_group( GTK_WINDOW( EquConfig ),accel_group );
 

Modified: trunk/gui/dialog/menu.c
==============================================================================
--- trunk/gui/dialog/menu.c	Mon Feb 17 02:28:05 2014	(r36871)
+++ trunk/gui/dialog/menu.c	Mon Feb 17 03:30:49 2014	(r36872)
@@ -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)(intptr_t)Number );
+   GTK_SIGNAL_FUNC(ActivateMenuItem),GINT_TO_POINTER(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)(intptr_t)Number );
+   GTK_SIGNAL_FUNC(ActivateMenuItem),GINT_TO_POINTER(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	Mon Feb 17 02:28:05 2014	(r36871)
+++ trunk/gui/dialog/playlist.c	Mon Feb 17 03:30:49 2014	(r36872)
@@ -98,7 +98,7 @@ static void plRowSelect( GtkCList * clis
  (void) column;
  (void) event;
 
- switch ( (intptr_t) user_data )
+ switch ( GPOINTER_TO_INT( user_data) )
   {
    case 0: CLFileSelected[row]=True; break;
    case 1: CLListSelected[row]=True; break;
@@ -111,7 +111,7 @@ static void plUnRowSelect( GtkCList * cl
  (void) column;
  (void) event;
 
- switch ( (intptr_t) user_data )
+ switch ( GPOINTER_TO_INT( user_data) )
   {
    case 0: CLFileSelected[row]=False; break;
    case 1: CLListSelected[row]=False; break;
@@ -122,7 +122,7 @@ static void plButtonReleased( GtkButton 
 {
  (void) button;
 
- switch ( (intptr_t) user_data )
+ switch ( GPOINTER_TO_INT( user_data) )
  {
   case 1: // ok
        {
@@ -255,13 +255,13 @@ static gboolean plKeyReleased( GtkWidget
    if ( GTK_WIDGET_TYPE( widget ) == GTK_TYPE_BUTTON ) plButtonReleased( NULL, user_data );
    else
     {
-     switch ( (intptr_t) user_data )
+     switch ( GPOINTER_TO_INT( user_data) )
       {
        case 0:
-            plButtonReleased( NULL, (void *) 3 );
+            plButtonReleased( NULL, GINT_TO_POINTER(3) );
             break;
        case 1:
-            plButtonReleased( NULL, (void *) 2 );
+            plButtonReleased( NULL, GINT_TO_POINTER(2) );
             break;
       }
     }
@@ -282,17 +282,17 @@ static gboolean plEvent ( GtkWidget * wi
   {
     if ( gtk_clist_get_selection_info( GTK_CLIST( widget ), bevent->x, bevent->y, &row, &col ) )
     {
-      switch ( (intptr_t) user_data )
+      switch ( GPOINTER_TO_INT( user_data) )
       {
         case 0:
           CLFileSelected[row] = True;
-          plButtonReleased( NULL, (void *) 3 );
+          plButtonReleased( NULL, GINT_TO_POINTER(3) );
           CLFileSelected[row] = False;
           return TRUE;
 
         case 1:
           CLListSelected[row] = True;
-          plButtonReleased( NULL, (void *) 2 );
+          plButtonReleased( NULL, GINT_TO_POINTER(2) );
           return TRUE;
       }
     }
@@ -559,23 +559,23 @@ static GtkWidget * CreatePlaylist( void 
 
   gtk_signal_connect( GTK_OBJECT( Playlist ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Playlist );
 
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"select-row",GTK_SIGNAL_FUNC( plRowSelect ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect-row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)0 );
-  gtk_signal_connect( GTK_OBJECT( CLFiles ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)0 );
-  sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select-row",GTK_SIGNAL_FUNC( plRowSelect ),(void*)1 );
-  sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect-row",GTK_SIGNAL_FUNC( plUnRowSelect ),(void*)1 );
-  sigEvent=gtk_signal_connect( GTK_OBJECT( CLSelected ),"event",GTK_SIGNAL_FUNC( plEvent ),(void *)1 );
-  gtk_signal_connect( GTK_OBJECT( CLSelected ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void *)1 );
+  gtk_signal_connect( GTK_OBJECT( CLFiles ),"select-row",GTK_SIGNAL_FUNC( plRowSelect ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( CLFiles ),"unselect-row",GTK_SIGNAL_FUNC( plUnRowSelect ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( CLFiles ),"event",GTK_SIGNAL_FUNC( plEvent ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( CLFiles ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(0) );
+  sigSel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"select-row",GTK_SIGNAL_FUNC( plRowSelect ),GINT_TO_POINTER(1) );
+  sigUnsel=gtk_signal_connect( GTK_OBJECT( CLSelected ),"unselect-row",GTK_SIGNAL_FUNC( plUnRowSelect ),GINT_TO_POINTER(1) );
+  sigEvent=gtk_signal_connect( GTK_OBJECT( CLSelected ),"event",GTK_SIGNAL_FUNC( plEvent ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( CLSelected ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(1) );
 
-  gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( Add ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)3 );
-  gtk_signal_connect( GTK_OBJECT( Remove ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( Remove ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)2 );
-  gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( Ok ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)1 );
-  gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),(void*)0 );
-  gtk_signal_connect( GTK_OBJECT( Cancel ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),(void*)0 );
+  gtk_signal_connect( GTK_OBJECT( Add ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(3) );
+  gtk_signal_connect( GTK_OBJECT( Add ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(3) );
+  gtk_signal_connect( GTK_OBJECT( Remove ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(2) );
+  gtk_signal_connect( GTK_OBJECT( Remove ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(2) );
+  gtk_signal_connect( GTK_OBJECT( Ok ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( Ok ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(1) );
+  gtk_signal_connect( GTK_OBJECT( Cancel ),"released",GTK_SIGNAL_FUNC( plButtonReleased ),GINT_TO_POINTER(0) );
+  gtk_signal_connect( GTK_OBJECT( Cancel ),"key-release-event",GTK_SIGNAL_FUNC( plKeyReleased ),GINT_TO_POINTER(0) );
 
   gtk_window_add_accel_group( GTK_WINDOW( Playlist ),accel_group );
 

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Feb 17 02:28:05 2014	(r36871)
+++ trunk/gui/dialog/preferences.c	Mon Feb 17 03:30:49 2014	(r36872)
@@ -226,7 +226,7 @@ static void prEntry( GtkEditable * edita
 
  (void) editable;
 
- switch( (intptr_t)user_data )
+ switch( GPOINTER_TO_INT(user_data) )
   {
 #ifdef CONFIG_FREETYPE
    case 0: // font encoding
@@ -281,7 +281,7 @@ static void prButton( GtkButton * button
 
  (void) button;
 
- switch ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(user_data) )
   {
    case bOk:
 	/* 1st page */
@@ -433,7 +433,7 @@ static gboolean prHScaler( GtkWidget * w
  (void) widget;
  (void) event;
 
- switch ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(user_data) )
   {
    case 0: // extra stereo coefficient
 	if ( !guiInfo.Playing ) break;
@@ -482,7 +482,7 @@ static void prToggled( GtkToggleButton *
 
  (void) togglebutton;
 
- switch ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(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,(intptr_t)user_data - 4,0 );
+	mplayer( MPLAYER_SET_FONT_AUTOSCALE,GPOINTER_TO_INT(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 ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(user_data) )
   {
    case 0: // audio driver
 	gtk_clist_get_text( GTK_CLIST( CLADrivers ),row,0,(char **)&ao_driver );
@@ -1122,14 +1122,14 @@ static GtkWidget * CreatePreferences( vo
 
   gtk_signal_connect( GTK_OBJECT( Preferences ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&Preferences );
 
-  gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bAConfig );
-  gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bOk );
-  gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bCancel );
-  gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bVconfig );
+  gtk_signal_connect( GTK_OBJECT( AConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bAConfig) );
+  gtk_signal_connect( GTK_OBJECT( BOk ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bOk) );
+  gtk_signal_connect( GTK_OBJECT( BCancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bCancel) );
+  gtk_signal_connect( GTK_OBJECT( VConfig ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bVconfig) );
 #if 0
-  gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLSubtitle );
+  gtk_signal_connect( GTK_OBJECT( BLoadSubtitle ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bLSubtitle) );
 #endif
-  gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void*)bLFont );
+  gtk_signal_connect( GTK_OBJECT( BLoadFont ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(bLFont) );
 
   gtk_signal_connect( GTK_OBJECT( CBSubUtf8 ),"toggled",GTK_SIGNAL_FUNC( button_toggled ),NULL );
   gtk_signal_connect( GTK_OBJECT( CBSubUnicode ),"toggled",GTK_SIGNAL_FUNC( button_toggled ),NULL );
@@ -1414,44 +1414,44 @@ void ShowPreferences( void )
 #endif
 
 /* signals */
- gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
- gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 );
- gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 );
- gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 );
+ gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(0) );
+ gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(1) );
+ gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(1) );
+ gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(2) );
+ gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), GINT_TO_POINTER(3) );
 #ifdef CONFIG_FREETYPE
- gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)4 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleHeight ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)5 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)6 );
- gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)7 );
+ gtk_signal_connect( GTK_OBJECT( RBFontNoAutoScale ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(4) );
+ gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleHeight ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(5) );
+ gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleWidth ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(6) );
+ gtk_signal_connect( GTK_OBJECT( RBFontAutoScaleDiagonal ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(7) );
 #endif
- gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)8);
- gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)9);
+ gtk_signal_connect( GTK_OBJECT( CBCache ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(8));
+ gtk_signal_connect( GTK_OBJECT( CBAutoSync ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(9));
 #ifdef CONFIG_ASS
- gtk_signal_connect( GTK_OBJECT( CBUseASS ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)10);
+ gtk_signal_connect( GTK_OBJECT( CBUseASS ),"toggled",GTK_SIGNAL_FUNC( prToggled ),GINT_TO_POINTER(10));
 #endif
 
- gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)1 );
- gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)2 );
- gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)3 );
- gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)4 );
+ gtk_signal_connect( GTK_OBJECT( HSExtraStereoMul ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(0) );
+ gtk_signal_connect( GTK_OBJECT( HSAudioDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(1) );
+ gtk_signal_connect( GTK_OBJECT( HSPanscan ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(2) );
+ gtk_signal_connect( GTK_OBJECT( HSSubDelay ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(3) );
+ gtk_signal_connect( GTK_OBJECT( HSSubPosition ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(4) );
 #ifdef CONFIG_FREETYPE
- gtk_signal_connect( GTK_OBJECT( HSFontBlur ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)6 );
- gtk_signal_connect( GTK_OBJECT( HSFontOutLine ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)7 );
- gtk_signal_connect( GTK_OBJECT( HSFontTextScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)8 );
- gtk_signal_connect( GTK_OBJECT( HSFontOSDScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)9 );
- gtk_signal_connect( GTK_OBJECT( EFontEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)0 );
+ gtk_signal_connect( GTK_OBJECT( HSFontBlur ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(6) );
+ gtk_signal_connect( GTK_OBJECT( HSFontOutLine ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(7) );
+ gtk_signal_connect( GTK_OBJECT( HSFontTextScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(8) );
+ gtk_signal_connect( GTK_OBJECT( HSFontOSDScale ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(9) );
+ gtk_signal_connect( GTK_OBJECT( EFontEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),GINT_TO_POINTER(0) );
 #else
- gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)5 );
+ gtk_signal_connect( GTK_OBJECT( HSFontFactor ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(5) );
 #endif
 #ifdef CONFIG_ICONV
- gtk_signal_connect( GTK_OBJECT( ESubEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),(void *)1 );
+ gtk_signal_connect( GTK_OBJECT( ESubEncoding ),"changed",GTK_SIGNAL_FUNC( prEntry ),GINT_TO_POINTER(1) );
 #endif
- gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),(void*)10 );
+ gtk_signal_connect( GTK_OBJECT( HSPPQuality ),"motion-notify-event",GTK_SIGNAL_FUNC( prHScaler ),GINT_TO_POINTER(10) );
 
- gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),(void*)0 );
- gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),(void*)1 );
+ gtk_signal_connect( GTK_OBJECT( CLADrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),GINT_TO_POINTER(0) );
+ gtk_signal_connect( GTK_OBJECT( CLVDrivers ),"select-row",GTK_SIGNAL_FUNC( prCListRow ),GINT_TO_POINTER(1) );
 
  gtk_widget_show( Preferences );
  gtkSetLayer( Preferences );
@@ -1598,7 +1598,7 @@ static void audioButton(GtkButton *butto
 
   (void) button;
 
-  switch( (intptr_t)user_data ) {
+  switch( GPOINTER_TO_INT(user_data) ) {
     case 1:
 #ifdef CONFIG_OSS_AUDIO
       if (strncmp(ao_driver[0], "oss", 3) == 0) {
@@ -1741,8 +1741,8 @@ static GtkWidget *CreateAudioConfig( voi
   BAudioCancel = gtkAddButton(MSGTR_GUI_Cancel, hbuttonbox);
 
   gtk_signal_connect(GTK_OBJECT(AudioConfig), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &AudioConfig);
-  gtk_signal_connect(GTK_OBJECT(BAudioOk), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)1);
-  gtk_signal_connect(GTK_OBJECT(BAudioCancel), "clicked", GTK_SIGNAL_FUNC(audioButton), (void*)0);
+  gtk_signal_connect(GTK_OBJECT(BAudioOk), "clicked", GTK_SIGNAL_FUNC(audioButton), GINT_TO_POINTER(1));
+  gtk_signal_connect(GTK_OBJECT(BAudioCancel), "clicked", GTK_SIGNAL_FUNC(audioButton), GINT_TO_POINTER(0));
 
   accel_group = gtk_accel_group_new();
   gtk_widget_add_accelerator(BAudioOk, "clicked", accel_group, GDK_Return, 0, GTK_ACCEL_VISIBLE);
@@ -1814,7 +1814,7 @@ static void dxr3Button( GtkButton * butt
 {
  (void) button;
 
- switch ( (intptr_t)user_data )
+ switch ( GPOINTER_TO_INT(user_data) )
  {
   case 0: // Ok
        nfree( gtkDXR3Device ); gtkDXR3Device=strdup( gtk_entry_get_text( GTK_ENTRY( CEDXR3Device ) ) );
@@ -1886,8 +1886,8 @@ GtkWidget * CreateDXR3Config( void )
 
  gtk_signal_connect( GTK_OBJECT( DXR3Config ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&DXR3Config );
 
- gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)0 );
- gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),(void *)1 );
+ gtk_signal_connect( GTK_OBJECT( dxr3BOk ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),GINT_TO_POINTER(0) );
+ gtk_signal_connect( GTK_OBJECT( dxr3BCancel ),"clicked",GTK_SIGNAL_FUNC( dxr3Button ),GINT_TO_POINTER(1) );
 
  gtk_window_add_accel_group( GTK_WINDOW( DXR3Config ),accel_group );
 

Modified: trunk/gui/dialog/skinbrowser.c
==============================================================================
--- trunk/gui/dialog/skinbrowser.c	Mon Feb 17 02:28:05 2014	(r36871)
+++ trunk/gui/dialog/skinbrowser.c	Mon Feb 17 03:30:49 2014	(r36872)
@@ -51,7 +51,7 @@ static void prButton( GtkButton * button
 
  if ( sbSelectedSkin )
  {
-  switch ( (intptr_t)user_data )
+  switch ( GPOINTER_TO_INT(user_data) )
    {
     case 0: // cancel
 	if ( strcmp( sbSelectedSkin,gtkOldSkin ) ) uiChangeSkin( gtkOldSkin );
@@ -145,8 +145,8 @@ static GtkWidget * CreateSkinBrowser( vo
 
  gtk_signal_connect( GTK_OBJECT( SkinBrowser ),"destroy",GTK_SIGNAL_FUNC( gtk_widget_destroyed ),&SkinBrowser );
  gtk_signal_connect( GTK_OBJECT( SkinList ),"select-row",GTK_SIGNAL_FUNC( on_SkinList_select_row ),NULL );
- gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)1 );
- gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),(void *)0 );
+ gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(1) );
+ gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( prButton ),GINT_TO_POINTER(0) );
 
  if ( ( sbSkinDirInHome=calloc( 1,strlen( skinDirInHome ) + 4 ) ) != NULL )
   { strcpy( sbSkinDirInHome,skinDirInHome ); strcat( sbSkinDirInHome,"/*" ); }


More information about the MPlayer-cvslog mailing list