From 48c35baccd272b9e8017d497e84353dfe95f1d56 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 7 Apr 2021 03:15:30 +0300 Subject: [PATCH 41/41] gtk unitselect.c: Use GINT_TO_POINTER to cast between pointer and integer See osdn #41932 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/unitselect.c | 16 ++++++++-------- client/gui-gtk-4.0/unitselect.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/gui-gtk-3.22/unitselect.c b/client/gui-gtk-3.22/unitselect.c index 8da1481ccf..d64416f3ad 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); } diff --git a/client/gui-gtk-4.0/unitselect.c b/client/gui-gtk-4.0/unitselect.c index 937b1d48c7..2f4d3cc091 100644 --- a/client/gui-gtk-4.0/unitselect.c +++ b/client/gui-gtk-4.0/unitselect.c @@ -417,9 +417,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); @@ -478,7 +478,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); @@ -489,7 +489,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); @@ -500,7 +500,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); @@ -511,7 +511,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); @@ -522,7 +522,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); @@ -531,7 +531,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