From: Hugo Villeneuve Date: Mon, 5 Sep 2011 21:09:32 +0000 (-0400) Subject: Fix compilation warnings by using proper type conversion macros X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=8c6d263f793e441e3f99322d916e7d648071c041;p=hvgrip.git Fix compilation warnings by using proper type conversion macros Original warning messages: warning: cast to pointer from integer of different size warning: cast from pointer to integer of different size --- diff --git a/src/discedit.c b/src/discedit.c index d953741..9b37586 100644 --- a/src/discedit.c +++ b/src/discedit.c @@ -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;trackdisc.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))); } diff --git a/src/tray.c b/src/tray.c index 81654ac..64ff009 100644 --- a/src/tray.c +++ b/src/tray.c @@ -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)