From 223cb079eb914038c00b025d349ba4263fc66760 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 7 Apr 2021 03:15:30 +0300 Subject: [PATCH 22/22] gtk unitselect.c: Use GINT_TO_POINTER to cast between pointer and integer See osdn #41932 Signed-off-by: Marko Lindqvist --- client/gui-gtk-2.0/unitselect.c | 16 ++++++++-------- client/gui-gtk-3.0/unitselect.c | 16 ++++++++-------- client/gui-gtk-3.22/unitselect.c | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/client/gui-gtk-2.0/unitselect.c b/client/gui-gtk-2.0/unitselect.c index 402dc7a959..8e096b793a 100644 --- a/client/gui-gtk-2.0/unitselect.c +++ b/client/gui-gtk-2.0/unitselect.c @@ -413,9 +413,9 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, g_object_unref(store); g_signal_connect(view, "row-activated", G_CALLBACK(usdlg_cmd_row_activated), - (gpointer *)loc); + GINT_TO_POINTER(loc)); g_signal_connect(view, "cursor-changed", - G_CALLBACK(usdlg_cmd_cursor_changed), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_cursor_changed), GINT_TO_POINTER(loc)); /* Translate titles. */ intl_slist(ARRAY_SIZE(usdlg_col_titles), usdlg_col_titles, &titles_done); @@ -474,7 +474,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_box_pack_start(GTK_BOX(bbox), pdialog->tabs[loc].cmd[USDLG_CMD_READY], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_READY], "clicked", - G_CALLBACK(usdlg_cmd_ready), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_ready), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_READY]), FALSE); @@ -483,7 +483,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_box_pack_start(GTK_BOX(bbox), pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY], "clicked", - G_CALLBACK(usdlg_cmd_sentry), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_sentry), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]), FALSE); @@ -496,7 +496,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_box_pack_start(GTK_BOX(bbox), pdialog->tabs[loc].cmd[USDLG_CMD_SELECT], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT], "clicked", - G_CALLBACK(usdlg_cmd_select), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_select), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]), FALSE); @@ -506,7 +506,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT], "clicked", - G_CALLBACK(usdlg_cmd_deselect), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_deselect), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]), FALSE); @@ -519,7 +519,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_box_pack_start(GTK_BOX(bbox), pdialog->tabs[loc].cmd[USDLG_CMD_CENTER], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER], "clicked", - G_CALLBACK(usdlg_cmd_center), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_center), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]), FALSE); @@ -528,7 +528,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_box_pack_start(GTK_BOX(bbox), pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS], FALSE, TRUE, 0); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS], "clicked", - G_CALLBACK(usdlg_cmd_focus), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_focus), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]), FALSE); } diff --git a/client/gui-gtk-3.0/unitselect.c b/client/gui-gtk-3.0/unitselect.c index b29847a18b..2810a9339e 100644 --- a/client/gui-gtk-3.0/unitselect.c +++ b/client/gui-gtk-3.0/unitselect.c @@ -415,9 +415,9 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, g_object_unref(store); g_signal_connect(view, "row-activated", G_CALLBACK(usdlg_cmd_row_activated), - (gpointer *)loc); + GINT_TO_POINTER(loc)); g_signal_connect(view, "cursor-changed", - G_CALLBACK(usdlg_cmd_cursor_changed), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_cursor_changed), GINT_TO_POINTER(loc)); /* Translate titles. */ intl_slist(ARRAY_SIZE(usdlg_col_titles), usdlg_col_titles, &titles_done); @@ -476,7 +476,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_READY]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_READY], "clicked", - G_CALLBACK(usdlg_cmd_ready), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_ready), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_READY]), FALSE); @@ -487,7 +487,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY], "clicked", - G_CALLBACK(usdlg_cmd_sentry), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_sentry), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]), FALSE); @@ -498,7 +498,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT], "clicked", - G_CALLBACK(usdlg_cmd_select), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_select), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]), FALSE); @@ -509,7 +509,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT], "clicked", - G_CALLBACK(usdlg_cmd_deselect), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_deselect), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]), FALSE); @@ -520,7 +520,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER], "clicked", - G_CALLBACK(usdlg_cmd_center), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_center), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]), FALSE); @@ -529,7 +529,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS], "clicked", - G_CALLBACK(usdlg_cmd_focus), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_focus), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]), FALSE); } diff --git a/client/gui-gtk-3.22/unitselect.c b/client/gui-gtk-3.22/unitselect.c index 0a3e212925..dd88916e99 100644 --- a/client/gui-gtk-3.22/unitselect.c +++ b/client/gui-gtk-3.22/unitselect.c @@ -415,9 +415,9 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, g_object_unref(store); g_signal_connect(view, "row-activated", G_CALLBACK(usdlg_cmd_row_activated), - (gpointer *)loc); + GINT_TO_POINTER(loc)); g_signal_connect(view, "cursor-changed", - G_CALLBACK(usdlg_cmd_cursor_changed), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_cursor_changed), GINT_TO_POINTER(loc)); /* Translate titles. */ intl_slist(ARRAY_SIZE(usdlg_col_titles), usdlg_col_titles, &titles_done); @@ -476,7 +476,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_READY]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_READY], "clicked", - G_CALLBACK(usdlg_cmd_ready), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_ready), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_READY]), FALSE); @@ -487,7 +487,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY], "clicked", - G_CALLBACK(usdlg_cmd_sentry), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_sentry), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SENTRY]), FALSE); @@ -498,7 +498,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT], "clicked", - G_CALLBACK(usdlg_cmd_select), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_select), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_SELECT]), FALSE); @@ -509,7 +509,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT], "clicked", - G_CALLBACK(usdlg_cmd_deselect), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_deselect), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_DESELECT]), FALSE); @@ -520,7 +520,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER], "clicked", - G_CALLBACK(usdlg_cmd_center), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_center), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_CENTER]), FALSE); @@ -529,7 +529,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, gtk_container_add(GTK_CONTAINER(vbox), pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]); g_signal_connect(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS], "clicked", - G_CALLBACK(usdlg_cmd_focus), (gpointer *)loc); + G_CALLBACK(usdlg_cmd_focus), GINT_TO_POINTER(loc)); gtk_widget_set_sensitive( GTK_WIDGET(pdialog->tabs[loc].cmd[USDLG_CMD_FOCUS]), FALSE); } -- 2.30.2