Fix compilation warnings by using proper type conversion macros
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 5 Sep 2011 21:09:32 +0000 (17:09 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Tue, 25 Mar 2014 03:27:04 +0000 (23:27 -0400)
Original warning messages:
  warning: cast to pointer from integer of different size
  warning: cast from pointer to integer of different size

src/discedit.c
src/tray.c

index d953741..9b37586 100644 (file)
@@ -135,7 +135,7 @@ GtkWidget *MakeEditBox(GripInfo *ginfo)
       id3_genre_count++) {
     item = gtk_list_item_new_with_label(id3_genre->name);
     gtk_object_set_user_data(GTK_OBJECT(item),
-                            (gpointer)(id3_genre->num));
+                            GINT_TO_POINTER(id3_genre->num));
     uinfo->id3_genre_item_list=g_list_append(uinfo->id3_genre_item_list,item);
     gtk_signal_connect(GTK_OBJECT(item),"select",
                       GTK_SIGNAL_FUNC(ID3GenreChanged),
@@ -481,7 +481,7 @@ static void ID3GenreChanged(GtkWidget *widget,gpointer data)
 
   ginfo=(GripInfo *)data;
 
-  ginfo->ddata.data_id3genre=(int)gtk_object_get_user_data(GTK_OBJECT(widget));
+  ginfo->ddata.data_id3genre=GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(widget)));
   /*  ginfo->ddata.data_genre=ID32DiscDB(ginfo->ddata.data_id3genre);*/
 }
 
@@ -513,7 +513,7 @@ static void SplitTitleArtist(GtkWidget *widget,gpointer data)
   int mode;
 
   ginfo=(GripInfo *)data;
-  mode=(int)gtk_object_get_user_data(GTK_OBJECT(widget));
+  mode=GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(widget)));
 
   for(track=0;track<ginfo->disc.num_tracks;track++) {
     if(mode==0)
@@ -617,7 +617,7 @@ static void GetDiscDBGenre(GripInfo *ginfo)
   for(genre=0;genre<12;genre++) {
     item=gtk_list_item_new_with_label(DiscDBGenre(genre));
     gtk_object_set_user_data(GTK_OBJECT(item),
-                            (gpointer)genre);
+                            GINT_TO_POINTER(genre));
     gtk_signal_connect(GTK_OBJECT(item), "select",
                       GTK_SIGNAL_FUNC(DiscDBGenreChanged),(gpointer)ginfo);
     gtk_container_add(GTK_CONTAINER(GTK_COMBO(genre_combo)->list),item);
@@ -662,5 +662,5 @@ static void DiscDBGenreChanged(GtkWidget *widget,gpointer data)
 
   ginfo=(GripInfo *)data;
 
-  ginfo->ddata.data_genre=(int)gtk_object_get_user_data(GTK_OBJECT(widget));
+  ginfo->ddata.data_genre=GPOINTER_TO_INT(gtk_object_get_user_data(GTK_OBJECT(widget)));
 }
index 81654ac..64ff009 100644 (file)
@@ -129,7 +129,7 @@ void TrayMenuShowPause(GripInfo *ginfo)
 
 static void ToggleMenuItemSensitive(GtkWidget *widget, gpointer data)
 {
-       gtk_widget_set_sensitive(GTK_WIDGET(widget), (gboolean)data);
+       gtk_widget_set_sensitive(GTK_WIDGET(widget), GPOINTER_TO_INT(data));
 }
 
 void TrayGrayMenu(GripInfo *ginfo)