From 134014ef37404871e05f62be41ef6065e0ded3f3 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 11 Oct 2021 17:50:22 +0300 Subject: [PATCH 50/50] gtk4: Clean out trailing spaces See osdn #43028 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/action_dialog.c | 34 +++++++++++++++--------------- client/gui-gtk-4.0/chatline.c | 6 +++--- client/gui-gtk-4.0/choice_dialog.c | 10 ++++----- client/gui-gtk-4.0/citydlg.c | 30 +++++++++++++------------- client/gui-gtk-4.0/cityrep.c | 16 +++++++------- client/gui-gtk-4.0/cma_fe.c | 4 ++-- client/gui-gtk-4.0/connectdlg.c | 4 ++-- client/gui-gtk-4.0/dialogs.c | 16 +++++++------- client/gui-gtk-4.0/diplodlg.c | 16 +++++++------- client/gui-gtk-4.0/editgui.c | 6 +++--- client/gui-gtk-4.0/editprop.c | 22 +++++++++---------- client/gui-gtk-4.0/gotodlg.c | 6 +++--- client/gui-gtk-4.0/gui_main.c | 22 +++++++++---------- client/gui-gtk-4.0/gui_stuff.c | 8 +++---- client/gui-gtk-4.0/helpdlg.c | 8 +++---- client/gui-gtk-4.0/inputdlg.c | 4 ++-- client/gui-gtk-4.0/inputdlg.h | 2 +- client/gui-gtk-4.0/inteldlg.c | 2 +- client/gui-gtk-4.0/mapctrl.c | 4 ++-- client/gui-gtk-4.0/mapview.c | 4 ++-- client/gui-gtk-4.0/menu.c | 8 +++---- client/gui-gtk-4.0/messagedlg.c | 2 +- client/gui-gtk-4.0/pages.c | 20 +++++++++--------- client/gui-gtk-4.0/plrdlg.c | 12 +++++------ client/gui-gtk-4.0/repodlgs.c | 4 ++-- client/gui-gtk-4.0/sprite.c | 4 ++-- client/gui-gtk-4.0/theme_dlg.c | 2 +- client/gui-gtk-4.0/themes.c | 6 +++--- client/gui-gtk-4.0/unitselect.c | 4 ++-- client/gui-gtk-4.0/voteinfo_bar.c | 2 +- client/gui-gtk-4.0/wldlg.c | 8 +++---- 31 files changed, 148 insertions(+), 148 deletions(-) diff --git a/client/gui-gtk-4.0/action_dialog.c b/client/gui-gtk-4.0/action_dialog.c index a7ffd85e07..332fe3227d 100644 --- a/client/gui-gtk-4.0/action_dialog.c +++ b/client/gui-gtk-4.0/action_dialog.c @@ -503,7 +503,7 @@ void popup_bribe_dialog(struct unit *actor, struct unit *punit, int cost, setup_dialog(shell, toplevel); } gtk_window_present(GTK_WINDOW(shell)); - + g_signal_connect(shell, "response", G_CALLBACK(bribe_response), act_data(paction->id, actor->id, 0, punit->id, 0, @@ -556,12 +556,12 @@ static void spy_advances_callback(GtkTreeSelection *select, if (gtk_tree_selection_get_selected(select, &model, &it)) { gtk_tree_model_get(model, &it, 1, &(args->target_tech_id), -1); - + gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell), GTK_RESPONSE_ACCEPT, TRUE); } else { args->target_tech_id = 0; - + gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell), GTK_RESPONSE_ACCEPT, FALSE); } @@ -573,7 +573,7 @@ static void spy_advances_callback(GtkTreeSelection *select, static void create_advances_list(struct player *pplayer, struct player *pvictim, struct action_data *args) -{ +{ GtkWidget *sw, *label, *vbox, *view; GtkListStore *store; GtkCellRenderer *rend; @@ -599,7 +599,7 @@ static void create_advances_list(struct player *pplayer, GTK_ORIENTATION_VERTICAL); gtk_grid_set_row_spacing(GTK_GRID(vbox), 6); gtk_container_add(GTK_CONTAINER(label), vbox); - + store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); @@ -630,7 +630,7 @@ static void create_advances_list(struct player *pplayer, gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_widget_set_size_request(sw, -1, 200); - + gtk_container_add(GTK_CONTAINER(vbox), sw); /* Now populate the list */ @@ -677,14 +677,14 @@ static void create_advances_list(struct player *pplayer, gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_tech_shell), GTK_RESPONSE_ACCEPT, FALSE); - + gtk_widget_show(gtk_dialog_get_content_area(GTK_DIALOG(spy_tech_shell))); g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)), "changed", G_CALLBACK(spy_advances_callback), args); g_signal_connect(spy_tech_shell, "response", G_CALLBACK(spy_advances_response), args); - + args->target_tech_id = 0; gtk_tree_view_focus(GTK_TREE_VIEW(view)); @@ -742,12 +742,12 @@ static void spy_improvements_callback(GtkTreeSelection *select, gpointer data) if (gtk_tree_selection_get_selected(select, &model, &it)) { gtk_tree_model_get(model, &it, 1, &(args->target_building_id), -1); - + gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_sabotage_shell), GTK_RESPONSE_ACCEPT, TRUE); } else { args->target_building_id = -2; - + gtk_dialog_set_response_sensitive(GTK_DIALOG(spy_sabotage_shell), GTK_RESPONSE_ACCEPT, FALSE); } @@ -759,7 +759,7 @@ static void spy_improvements_callback(GtkTreeSelection *select, gpointer data) static void create_improvements_list(struct player *pplayer, struct city *pcity, struct action_data *args) -{ +{ GtkWidget *sw, *label, *vbox, *view; GtkListStore *store; GtkCellRenderer *rend; @@ -767,7 +767,7 @@ static void create_improvements_list(struct player *pplayer, GtkTreeIter it; struct unit *actor_unit = game_unit_by_number(args->actor_unit_id); - + spy_sabotage_shell = gtk_dialog_new_with_buttons(_("Sabotage Improvements"), NULL, 0, _("_Cancel"), GTK_RESPONSE_CANCEL, @@ -786,7 +786,7 @@ static void create_improvements_list(struct player *pplayer, GTK_ORIENTATION_VERTICAL); gtk_grid_set_row_spacing(GTK_GRID(vbox), 6); gtk_container_add(GTK_CONTAINER(label), vbox); - + store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); @@ -817,7 +817,7 @@ static void create_improvements_list(struct player *pplayer, gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(sw), 200); - + gtk_container_add(GTK_CONTAINER(vbox), sw); /* Now populate the list */ @@ -835,7 +835,7 @@ static void create_improvements_list(struct player *pplayer, 0, city_improvement_name_translation(pcity, pimprove), 1, improvement_number(pimprove), -1); - } + } } city_built_iterate_end; if (action_prob_possible(actor_unit->client.act_prob_cache[ @@ -863,7 +863,7 @@ static void create_improvements_list(struct player *pplayer, G_CALLBACK(spy_improvements_response), args); args->target_building_id = -2; - + gtk_tree_view_focus(GTK_TREE_VIEW(view)); } @@ -998,7 +998,7 @@ void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost, setup_dialog(shell, toplevel); } gtk_window_present(GTK_WINDOW(shell)); - + g_signal_connect(shell, "response", G_CALLBACK(incite_response), act_data(paction->id, actor->id, pcity->id, 0, 0, diff --git a/client/gui-gtk-4.0/chatline.c b/client/gui-gtk-4.0/chatline.c index 51d05f43ff..587e81b0eb 100644 --- a/client/gui-gtk-4.0/chatline.c +++ b/client/gui-gtk-4.0/chatline.c @@ -623,7 +623,7 @@ static gboolean event_after(GtkWidget *text_view, GdkEvent *event) } gdk_event_get_position(event, &e_x, &e_y); - gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW (text_view), + gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, e_x, e_y, &x, &y); @@ -748,7 +748,7 @@ static gboolean motion_notify_event(GtkWidget *text_view, gdouble e_x, e_y; gdk_event_get_position(event, &e_x, &e_y); - gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view), + gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view), GTK_TEXT_WINDOW_WIDGET, e_x, e_y, &x, &y); set_cursor_if_appropriate(GTK_TEXT_VIEW(text_view), x, y); @@ -868,7 +868,7 @@ void apply_text_tag(const struct text_tag *ptag, GtkTextBuffer *buf, break; /* Not a valid link type case. */ } - tag = gtk_text_buffer_create_tag(buf, NULL, + tag = gtk_text_buffer_create_tag(buf, NULL, "foreground-rgba", &pcolor->color, "underline", PANGO_UNDERLINE_SINGLE, NULL); diff --git a/client/gui-gtk-4.0/choice_dialog.c b/client/gui-gtk-4.0/choice_dialog.c index f5587dc391..4d036f6110 100644 --- a/client/gui-gtk-4.0/choice_dialog.c +++ b/client/gui-gtk-4.0/choice_dialog.c @@ -129,14 +129,14 @@ GtkWidget *choice_dialog_start(GtkWindow *parent, const gchar *name, bbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2); gtk_container_add(GTK_CONTAINER(vbox), bbox); - + g_object_set_data(G_OBJECT(dshell), "bbox", bbox); g_object_set_data(G_OBJECT(dshell), "nbuttons", GINT_TO_POINTER(0)); g_object_set_data(G_OBJECT(dshell), "hide", GINT_TO_POINTER(FALSE)); - + gtk_widget_show(vbox); gtk_widget_show(dlabel); - + return dshell; } @@ -199,7 +199,7 @@ void choice_dialog_end(GtkWidget *dshell) bbox = g_object_get_data(G_OBJECT(dshell), "bbox"); gtk_widget_show(bbox); - gtk_widget_show(dshell); + gtk_widget_show(dshell); } /*******************************************************************//** @@ -221,7 +221,7 @@ GtkWidget *popup_choice_dialog(GtkWindow *parent, const gchar *dialogname, gchar *name; dshell = choice_dialog_start(parent, dialogname, text); - + va_start(args, text); while ((name = va_arg(args, gchar *))) { diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index 150fe2722c..c3ceedba3c 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -50,7 +50,7 @@ #include "tilespec.h" /* client/agents */ -#include "cma_fec.h" +#include "cma_fec.h" /* client/gui-gtk-4.0 */ #include "choice_dialog.h" @@ -1238,7 +1238,7 @@ static void create_and_append_buildings_page(struct city_dialog *pdialog) } /***********************************************************************//** - **** Production Page **** + **** Production Page **** ***************************************************************************/ static void create_and_append_worklist_page(struct city_dialog *pdialog) { @@ -1380,7 +1380,7 @@ static void create_and_append_cma_page(struct city_dialog *pdialog) } /***********************************************************************//** - **** Misc. Settings Page **** + **** Misc. Settings Page **** ***************************************************************************/ static void create_and_append_settings_page(struct city_dialog *pdialog) { @@ -1421,9 +1421,9 @@ static void create_and_append_settings_page(struct city_dialog *pdialog) gtk_widget_set_margin_end(page, 8); gtk_widget_set_margin_top(page, 8); gtk_widget_set_margin_bottom(page, 8); - + size = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); - + label = gtk_label_new_with_mnemonic(tab_title); gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label); @@ -1463,7 +1463,7 @@ static void create_and_append_settings_page(struct city_dialog *pdialog) intl_slist(ARRAY_SIZE(misc_whichtab_label), misc_whichtab_label, &misc_whichtab_label_done); - + group = NULL; for (i = 0; i < ARRAY_SIZE(misc_whichtab_label); i++) { button = gtk_radio_button_new_with_mnemonic(group, misc_whichtab_label[i]); @@ -1492,7 +1492,7 @@ static void create_and_append_settings_page(struct city_dialog *pdialog) G_CALLBACK(rename_callback), pdialog); gtk_widget_set_sensitive(button, can_client_issue_orders()); - + /* the disband-city-on-unit-production button */ button = gtk_check_button_new_with_mnemonic(_(disband_label)); pdialog->misc.disband_on_settler = button; @@ -2012,7 +2012,7 @@ static void city_dialog_update_building(struct city_dialog *pdialog) gtk_list_store_clear(pdialog->overview.change_production_store); targets_used - = collect_eventually_buildable_targets(targets, pdialog->pcity, FALSE); + = collect_eventually_buildable_targets(targets, pdialog->pcity, FALSE); name_and_sort_items(targets, targets_used, items, FALSE, pcity); for (item = 0; item < targets_used; item++) { @@ -2071,11 +2071,11 @@ static void city_dialog_update_improvement_list(struct city_dialog *pdialog) model = gtk_tree_view_get_model(GTK_TREE_VIEW(pdialog->overview.improvement_list)); store = GTK_LIST_STORE(model); - + targets_used = collect_already_built_targets(targets, pdialog->pcity); name_and_sort_items(targets, targets_used, items, FALSE, pdialog->pcity); - gtk_list_store_clear(store); + gtk_list_store_clear(store); for (item = 0; item < targets_used; item++) { GdkPixbuf *pix; @@ -2269,7 +2269,7 @@ static void city_dialog_update_present_units(struct city_dialog *pdialog) i = 0; unit_list_iterate(units, punit) { struct unit_node *pnode; - + pnode = unit_node_vector_get(nodes, i); if (pnode) { GtkWidget *cmd, *pix; @@ -3153,7 +3153,7 @@ static void sell_callback(struct impr_type *pimprove, gpointer data) struct city_dialog *pdialog = (struct city_dialog *) data; pdialog->sell_id = improvement_number(pimprove); int price; - + if (!can_client_issue_orders()) { return; } @@ -3173,12 +3173,12 @@ static void sell_callback(struct impr_type *pimprove, gpointer data) city_improvement_name_translation(pdialog->pcity, pimprove), price); setup_dialog(shl, pdialog->shell); pdialog->sell_shell = shl; - + gtk_window_set_title(GTK_WINDOW(shl), _("Sell It!")); g_signal_connect(shl, "response", G_CALLBACK(sell_callback_response), pdialog); - + gtk_window_present(GTK_WINDOW(shl)); } @@ -3193,7 +3193,7 @@ static void sell_callback_response(GtkWidget *w, gint response, gpointer data) city_sell_improvement(pdialog->pcity, pdialog->sell_id); } gtk_widget_destroy(w); - + pdialog->sell_shell = NULL; } diff --git a/client/gui-gtk-4.0/cityrep.c b/client/gui-gtk-4.0/cityrep.c index cde6a2d01f..2222474afa 100644 --- a/client/gui-gtk-4.0/cityrep.c +++ b/client/gui-gtk-4.0/cityrep.c @@ -303,7 +303,7 @@ void city_report_dialog_popup(bool raise) { if (!city_dialog_shell) { city_dialog_shell_is_modal = FALSE; - + create_city_report_dialog(FALSE); select_menu_cached = FALSE; @@ -333,8 +333,8 @@ void city_report_dialog_popdown(void) static void append_impr_or_unit_to_menu_item(GtkMenuItem *parent_item, bool append_units, bool append_wonders, - enum city_operation_type - city_operation, + enum city_operation_type + city_operation, TestCityFunc test_func, GCallback callback, int size) @@ -451,7 +451,7 @@ static void append_impr_or_unit_to_menu_item(GtkMenuItem *parent_item, g_signal_connect(menu_item, "activate", callback, GINT_TO_POINTER(cid_encode(target))); } - + for (i = 0; i < 3; i++) { g_object_unref(group[i]); } @@ -559,7 +559,7 @@ static void worklist_next_to_last_impr_or_unit_iterate(GtkTreeModel *model, static void sell_impr_iterate(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { - struct sell_data *sd = (struct sell_data *) data; + struct sell_data *sd = (struct sell_data *) data; struct city *pcity = city_model_get(model, iter); if (NULL != pcity @@ -580,7 +580,7 @@ static void select_impr_or_unit_callback(GtkWidget *wdg, gpointer data) struct universal target = cid_decode(GPOINTER_TO_INT(data)); GObject *parent = G_OBJECT(gtk_widget_get_parent(wdg)); TestCityFunc test_func = g_object_get_data(parent, "freeciv_test_func"); - enum city_operation_type city_operation = + enum city_operation_type city_operation = GPOINTER_TO_INT(g_object_get_data(parent, "freeciv_city_operation")); /* if this is not a city operation: */ @@ -810,7 +810,7 @@ static void append_cma_to_menu_item(GtkMenuItem *parent_item, bool change_cma) GINT_TO_POINTER(CMA_NONE)); } - /* + /* * Search for a city that's under custom (not preset) agent. Might * take a lonnggg time. */ @@ -1887,7 +1887,7 @@ static void create_select_menu(GtkWidget *item) item = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - + select_units_item = gtk_menu_item_new_with_label(_("Available Units")); gtk_menu_shell_append(GTK_MENU_SHELL(menu), select_units_item); diff --git a/client/gui-gtk-4.0/cma_fe.c b/client/gui-gtk-4.0/cma_fe.c index 4a9035d7ef..072939ac11 100644 --- a/client/gui-gtk-4.0/cma_fe.c +++ b/client/gui-gtk-4.0/cma_fe.c @@ -184,7 +184,7 @@ static void help_callback(GtkWidget *w, gpointer data) } /**********************************************************************//** - Cell data function for cma dialog + Cell data function for cma dialog **************************************************************************/ static void cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *it, gpointer data) @@ -694,7 +694,7 @@ static void cma_preset_remove_response(GtkWidget *w, gint response, city_report_dialog_update(); } gtk_widget_destroy(w); - + pdialog->preset_remove_shell = NULL; } diff --git a/client/gui-gtk-4.0/connectdlg.c b/client/gui-gtk-4.0/connectdlg.c index 9d3e8f6a9a..46b9a5cfd1 100644 --- a/client/gui-gtk-4.0/connectdlg.c +++ b/client/gui-gtk-4.0/connectdlg.c @@ -51,8 +51,8 @@ /**********************************************************************//** Close and destroy the dialog. **************************************************************************/ -void close_connection_dialog(void) -{ +void close_connection_dialog(void) +{ } /**********************************************************************//** diff --git a/client/gui-gtk-4.0/dialogs.c b/client/gui-gtk-4.0/dialogs.c index e87e53feca..5350637f4e 100644 --- a/client/gui-gtk-4.0/dialogs.c +++ b/client/gui-gtk-4.0/dialogs.c @@ -117,7 +117,7 @@ void popup_notify_dialog(const char *caption, const char *headline, gtk_grid_set_row_spacing(GTK_GRID(vbox), 2); gtk_container_add(GTK_CONTAINER(shell->vbox), vbox); - headline_label = gtk_label_new(headline); + headline_label = gtk_label_new(headline); gtk_container_add(GTK_CONTAINER(vbox), headline_label); gtk_widget_set_name(headline_label, "notify_label"); @@ -658,7 +658,7 @@ static GtkWidget* create_list_of_nations_in_group(struct nation_group* group, gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_container_add(GTK_CONTAINER(sw), list); - + render = gtk_cell_renderer_pixbuf_new(); column = gtk_tree_view_column_new_with_attributes("Flag", render, "pixbuf", 2, NULL); @@ -697,7 +697,7 @@ static void create_nation_selection_lists(void) GtkWidget *nation_list; GtkWidget *group_name_label; int i; - + for (i = 0; i < nation_group_count(); i++) { struct nation_group* group = (nation_group_by_number(i)); @@ -712,7 +712,7 @@ static void create_nation_selection_lists(void) group_name_label); } } - + nation_list = create_list_of_nations_in_group(NULL, nation_group_count()); /* Even this list can be empty if there are no pickable nations (due to * a combination of start position and nationset restrictions). */ @@ -847,7 +847,7 @@ static void create_races_dialog(struct player *pplayer) GtkWidget *text; GtkWidget *notebook; GtkWidget *sw; - GtkWidget *list; + GtkWidget *list; GtkListStore *store; GtkCellRenderer *render; GtkTreeViewColumn *column; @@ -1013,7 +1013,7 @@ static void create_races_dialog(struct player *pplayer) } races_notebook = gtk_notebook_new(); - gtk_notebook_set_tab_pos(GTK_NOTEBOOK(races_notebook), GTK_POS_LEFT); + gtk_notebook_set_tab_pos(GTK_NOTEBOOK(races_notebook), GTK_POS_LEFT); gtk_grid_attach(GTK_GRID(nation_selection_list), races_notebook, 0, 2, 2, 1); @@ -1064,7 +1064,7 @@ static void create_races_dialog(struct player *pplayer) gtk_grid_set_row_spacing(GTK_GRID(table), 2); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, label); - /* Leader. */ + /* Leader. */ { GtkListStore *model = gtk_list_store_new(1, G_TYPE_STRING); @@ -1230,7 +1230,7 @@ void popup_races_dialog(struct player *pplayer) } /**********************************************************************//** - Close nations dialog + Close nations dialog **************************************************************************/ void popdown_races_dialog(void) { diff --git a/client/gui-gtk-4.0/diplodlg.c b/client/gui-gtk-4.0/diplodlg.c index 13dc3a4786..83da0d44c3 100644 --- a/client/gui-gtk-4.0/diplodlg.c +++ b/client/gui-gtk-4.0/diplodlg.c @@ -54,7 +54,7 @@ struct Diplomacy_dialog { struct Treaty treaty; struct gui_dialog* dialog; - + GtkWidget *menu0; GtkWidget *menu1; @@ -80,7 +80,7 @@ struct Diplomacy_notebook { static struct dialog_list *dialog_list; static struct Diplomacy_notebook *dipl_main; -static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, +static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, struct player *plr1); static struct Diplomacy_dialog *find_diplomacy_dialog(int other_player_id); @@ -165,7 +165,7 @@ void handle_diplomacy_create_clause(int counterpart, int giver, add_clause(&pdialog->treaty, player_by_number(giver), type, value); update_diplomacy_dialog(pdialog); - gui_dialog_alert(pdialog->dialog); + gui_dialog_alert(pdialog->dialog); } /************************************************************************//** @@ -186,7 +186,7 @@ void handle_diplomacy_remove_clause(int counterpart, int giver, } /************************************************************************//** - Popup the dialog 10% inside the main-window + Popup the dialog 10% inside the main-window ****************************************************************************/ static void popup_diplomacy_dialog(int other_player_id, int initiated_from) { @@ -345,8 +345,8 @@ static void popup_add_menu(GtkMenuShell *parent, gpointer data) /**************************************************************** Creates a sorted list of plr0's cities, excluding the capital and - any cities not visible to plr1. This means that you can only trade - cities visible to requesting player. + any cities not visible to plr1. This means that you can only trade + cities visible to requesting player. - Kris Bubendorfer *****************************************************************/ @@ -463,7 +463,7 @@ static void row_callback(GtkTreeView *view, GtkTreePath *path, index = gtk_tree_path_get_indices(path); - i = 0; + i = 0; clause_list_iterate(pdialog->treaty.clauses, pclause) { if (i == index[0]) { dsend_packet_diplomacy_remove_clause_req(&client.conn, @@ -1176,7 +1176,7 @@ static void diplo_dialog_returnkey(GtkWidget *w, gpointer data) struct player *pgiver = (struct player *) g_object_get_data(G_OBJECT(w), "plr"); int amount = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w)); - + if (amount >= 0 && amount <= pgiver->economic.gold) { dsend_packet_diplomacy_create_clause_req(&client.conn, player_number(pdialog->treaty.plr1), diff --git a/client/gui-gtk-4.0/editgui.c b/client/gui-gtk-4.0/editgui.c index ba5b8c38c8..98c3d3e8e1 100644 --- a/client/gui-gtk-4.0/editgui.c +++ b/client/gui-gtk-4.0/editgui.c @@ -526,7 +526,7 @@ static struct editbar *editbar_create(void) GtkCellRenderer *cell; GdkPixbuf *pixbuf; const struct editor_sprites *sprites; - + eb = fc_calloc(1, sizeof(struct editbar)); hbox = gtk_grid_new(); @@ -1131,7 +1131,7 @@ static void editinfobox_spin_button_value_changed(GtkSpinButton *spinbutton, struct editinfobox *ei; int which, value; enum editor_tool_type ett; - + ei = editgui_get_editinfobox(); if (!ei) { @@ -1294,7 +1294,7 @@ static struct editinfobox *editinfobox_create(void) ei->size_spin_button = spin; label = gtk_label_new(_("Size")); gtk_container_add(GTK_CONTAINER(hbox), label); - + hbox = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(hbox), 8); gtk_container_add(GTK_CONTAINER(vbox), hbox); diff --git a/client/gui-gtk-4.0/editprop.c b/client/gui-gtk-4.0/editprop.c index 7f601fd8bf..9879c3410f 100644 --- a/client/gui-gtk-4.0/editprop.c +++ b/client/gui-gtk-4.0/editprop.c @@ -1228,7 +1228,7 @@ static bool propval_equal(struct propval *pva, return nation_hashs_are_equal(pva->data.v_nation_hash, pvb->data.v_nation_hash); case VALTYPE_GOV: - return pva->data.v_gov == pvb->data.v_gov; + return pva->data.v_gov == pvb->data.v_gov; case VALTYPE_TILE_VISION_DATA: if (!BV_ARE_EQUAL(pva->data.v_tile_vision->tile_known, pvb->data.v_tile_vision->tile_known)) { @@ -2871,7 +2871,7 @@ static void objprop_widget_text_changed(GtkText *text, gpointer userdata) pp = objprop_get_property_page(op); value.data.v_const_string = gtk_entry_buffer_get_text(gtk_text_get_buffer(text)); - property_page_change_value(pp, op, &value); + property_page_change_value(pp, op, &value); } /************************************************************************//** @@ -2888,7 +2888,7 @@ static void objprop_widget_spin_button_changed(GtkSpinButton *spin, pp = objprop_get_property_page(op); value.data.v_int = gtk_spin_button_get_value_as_int(spin); - property_page_change_value(pp, op, &value); + property_page_change_value(pp, op, &value); } /************************************************************************//** @@ -3081,7 +3081,7 @@ static void objprop_setup_widget(struct objprop *op) according to the value of the bound object. If a stored modified value exists, then check it against the object's current value and remove it if they are equal. - + If 'ob' is NULL, then clear the widget. ****************************************************************************/ static void objprop_refresh_widget(struct objprop *op, @@ -3115,7 +3115,7 @@ static void objprop_refresh_widget(struct objprop *op, if (pv && modified) { struct propval *pv_mod; - + pv_mod = objbind_get_modified_value(ob, op); if (pv_mod) { if (propval_equal(pv, pv_mod)) { @@ -3548,7 +3548,7 @@ static struct extviewer *extviewer_new(struct objprop *op) gtk_container_add(GTK_CONTAINER(hbox), button); ev->panel_button = button; - + /* Create the data store. */ switch (propid) { @@ -4099,7 +4099,7 @@ static void extviewer_panel_button_clicked(GtkButton *button, struct extviewer *ev; struct property_page *pp; struct objprop *op; - + ev = userdata; if (!ev) { return; @@ -4747,7 +4747,7 @@ property_page_new(enum editor_object_type objtype, num_columns++; gtype_array = fc_malloc(num_columns * sizeof(GType)); gtype_array[0] = G_TYPE_POINTER; - + property_page_objprop_iterate(pp, op) { if (objprop_show_in_listview(op)) { gtype_array[col_id] = objprop_get_gtype(op); @@ -4951,7 +4951,7 @@ property_page_new(enum editor_object_type objtype, gtk_widget_set_margin_top(vbox2, 4); gtk_widget_set_margin_bottom(vbox2, 4); gtk_container_add(GTK_CONTAINER(scrollwin), vbox2); - + property_page_objprop_iterate(pp, op) { if (!objprop_has_widget(op)) { continue; @@ -4977,7 +4977,7 @@ property_page_new(enum editor_object_type objtype, gtk_container_add(GTK_CONTAINER(hbox2), label); entry = gtk_entry_new(); - gtk_widget_set_tooltip_text(entry, + gtk_widget_set_tooltip_text(entry, _("Enter a filter string to limit which properties are shown. " "The filter is one or more text patterns separated by | " "(\"or\") or & (\"and\"). The symbol & has higher precedence " @@ -5338,7 +5338,7 @@ static void property_page_fill_widgets(struct property_page *pp) GtkTreeRowReference *rr; GtkTreeModel *model; GtkTreePath *path; - + model = GTK_TREE_MODEL(pp->object_store); property_page_objbind_iterate(pp, ob) { diff --git a/client/gui-gtk-4.0/gotodlg.c b/client/gui-gtk-4.0/gotodlg.c index bed6918d0c..abda8667ed 100644 --- a/client/gui-gtk-4.0/gotodlg.c +++ b/client/gui-gtk-4.0/gotodlg.c @@ -378,7 +378,7 @@ static void update_source_label(void) astr_init(&strs[i]); if (air_text != NULL) { - astr_add(&strs[i], + astr_add(&strs[i], /* TRANS: goto/airlift dialog. "Paris (airlift: 2/4)". * A set of these appear in an "and"-separated list. */ _("%s (airlift: %s)"), @@ -407,7 +407,7 @@ static void update_source_label(void) /* Finally, update the label. */ { struct astring label = ASTRING_INIT, list = ASTRING_INIT; - astr_set(&label, + astr_set(&label, /* TRANS: goto/airlift dialog. Current location of units; %s is an * "and"-separated list of cities and associated info */ _("Currently in: %s"), @@ -430,7 +430,7 @@ static void update_source_label(void) static void update_goto_dialog(GtkToggleButton *button) { bool nonempty = FALSE; - + if (!client_has_player()) { /* Case global observer. */ return; diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index 8e96658e81..6ef8da1f69 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -162,7 +162,7 @@ static GtkWidget *more_arrow_pixmap; static GtkWidget *more_arrow_pixmap_container; static int unit_id_top; -static int unit_ids[MAX_NUM_UNITS_BELOW]; /* ids of the units icons in +static int unit_ids[MAX_NUM_UNITS_BELOW]; /* ids of the units icons in * information display: (or 0) */ GtkTextView *main_message_area; GtkTextBuffer *message_buffer = NULL; @@ -237,7 +237,7 @@ static gboolean timer_callback(gpointer data) /**********************************************************************//** Print extra usage information, including one line help on each option, - to stderr. + to stderr. **************************************************************************/ static void print_usage(void) { @@ -314,7 +314,7 @@ static gboolean toplevel_focus(GtkWidget *w, GtkDirectionType arg) switch (arg) { case GTK_DIR_TAB_FORWARD: case GTK_DIR_TAB_BACKWARD: - + if (!gtk_widget_get_can_focus(w)) { return FALSE; } @@ -543,9 +543,9 @@ static gboolean key_press_map_canvas(GtkWidget *w, GdkEvent *ev, return TRUE; case GDK_KEY_KP_Begin: - case GDK_KEY_KP_5: + case GDK_KEY_KP_5: case GDK_KEY_5: - key_recall_previous_focus_unit(); + key_recall_previous_focus_unit(); return TRUE; case GDK_KEY_Escape: @@ -872,7 +872,7 @@ static void populate_unit_image_table(void) gtk_widget_set_size_request(unit_image, tileset_tile_width(tileset), -1); gtk_grid_attach(GTK_GRID(table), unit_image, 0, 0, 1, 1); g_signal_connect(unit_image, "button_press_event", - G_CALLBACK(select_unit_image_callback), + G_CALLBACK(select_unit_image_callback), GINT_TO_POINTER(-1)); if (!GUI_GTK_OPTION(small_display_layout)) { @@ -1175,7 +1175,7 @@ static void setup_widgets(void) gtk_container_add(GTK_CONTAINER(avbox), overview_scrolled_window); - gtk_container_add(GTK_CONTAINER(overview_scrolled_window), + gtk_container_add(GTK_CONTAINER(overview_scrolled_window), overview_canvas); gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(overview_canvas), @@ -2005,8 +2005,8 @@ void real_focus_units_changed(void) callback for clicking a unit icon underneath unit info box. these are the units on the same tile as the focus unit. **************************************************************************/ -static gboolean select_unit_image_callback(GtkWidget *w, GdkEvent *ev, - gpointer data) +static gboolean select_unit_image_callback(GtkWidget *w, GdkEvent *ev, + gpointer data) { int i = GPOINTER_TO_INT(data); struct unit *punit; @@ -2192,7 +2192,7 @@ void popup_quit_dialog(void) _("Are you sure you want to quit?")); setup_dialog(dialog, toplevel); - g_signal_connect(dialog, "response", + g_signal_connect(dialog, "response", G_CALLBACK(quit_dialog_response), NULL); g_signal_connect(dialog, "destroy", G_CALLBACK(gtk_widget_destroyed), &dialog); @@ -2444,7 +2444,7 @@ static void adjust_default_options(void) if (scr_height > 0) { /* Adjust these options only if we do know the screen height. */ - + if (scr_height <= 480) { /* Freeciv is practically unusable outside fullscreen mode in so * small display */ diff --git a/client/gui-gtk-4.0/gui_stuff.c b/client/gui-gtk-4.0/gui_stuff.c index b125604009..7b011fb413 100644 --- a/client/gui-gtk-4.0/gui_stuff.c +++ b/client/gui-gtk-4.0/gui_stuff.c @@ -166,7 +166,7 @@ void tstore_append(GtkTreeStore *store, ITree *it, ITree *parent) } /**********************************************************************//** - Return whether current itree item is selected + Return whether current itree item is selected **************************************************************************/ gboolean itree_is_selected(GtkTreeSelection *selection, ITree *it) { @@ -353,7 +353,7 @@ static gint gui_dialog_delete_handler(GtkWidget *widget, gpointer data) /* emit response signal. */ gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT); - + /* do the destroy by default. */ return FALSE; } @@ -373,7 +373,7 @@ static gint gui_dialog_delete_tab_handler(struct gui_dialog* dlg) if (gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), n) != dlg->v.tab.child) { gui_dialog_set_return_dialog(dlg, NULL); - } + } /* emit response signal. */ gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT); @@ -471,7 +471,7 @@ static void gui_dialog_detach(struct gui_dialog* dlg) gtk_window_set_default_size(GTK_WINDOW(dlg->v.window), dlg->default_width, - dlg->default_height); + dlg->default_height); gtk_widget_show(window); } diff --git a/client/gui-gtk-4.0/helpdlg.c b/client/gui-gtk-4.0/helpdlg.c index fe594a3739..cf0d204130 100644 --- a/client/gui-gtk-4.0/helpdlg.c +++ b/client/gui-gtk-4.0/helpdlg.c @@ -411,7 +411,7 @@ static void activated_topic(GtkTreeView *view, gpointer data) if (!path) { return; } - + gtk_tree_model_get(model, &it, 1, &pitem, -1); if (help_history_pos >= 0 @@ -794,7 +794,7 @@ static void help_update_improvement(const struct help_item *pitem, gtk_label_set_text(GTK_LABEL(help_ilabel[3]), buf); /* FIXME: this should show ranges, negated reqs, and all the - * MAX_NUM_REQS reqs. + * MAX_NUM_REQS reqs. * Currently it's limited to 1 req but this code is partially prepared * to be extended. Remember MAX_NUM_REQS is a compile-time * definition. */ @@ -840,7 +840,7 @@ static void help_update_wonder(const struct help_item *pitem, gtk_label_set_text(GTK_LABEL(help_wlabel[1]), buf); /* FIXME: this should show ranges, negated reqs, and all the - * MAX_NUM_REQS reqs. + * MAX_NUM_REQS reqs. * Currently it's limited to 1 req but this code is partially prepared * to be extended. Remember MAX_NUM_REQS is a compile-time * definition. */ @@ -1497,7 +1497,7 @@ static void help_update_dialog(const struct help_item *pitem) break; case HELP_TEXT: default: - /* it was a pure text item */ + /* it was a pure text item */ gtk_text_buffer_set_text(help_text, pitem->text, -1); gtk_widget_show(help_text_sw); break; diff --git a/client/gui-gtk-4.0/inputdlg.c b/client/gui-gtk-4.0/inputdlg.c index 6cfffae891..c8a222be80 100644 --- a/client/gui-gtk-4.0/inputdlg.c +++ b/client/gui-gtk-4.0/inputdlg.c @@ -17,7 +17,7 @@ #include -#include +#include /* utility */ #include "fcintl.h" @@ -64,7 +64,7 @@ static void input_dialog_close(GtkDialog *shell, gpointer data) /**********************************************************************//** Create a popup with a text entry box and "OK" and "Cancel" buttons. **************************************************************************/ -GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname, +GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname, const char *text, const char *postinputtest, input_dialog_callback_t response_callback, gpointer response_cli_data) diff --git a/client/gui-gtk-4.0/inputdlg.h b/client/gui-gtk-4.0/inputdlg.h index 77e7622cd1..99ec7088d2 100644 --- a/client/gui-gtk-4.0/inputdlg.h +++ b/client/gui-gtk-4.0/inputdlg.h @@ -18,7 +18,7 @@ typedef void (*input_dialog_callback_t)(gpointer response_cli_data, gint response, const char *input); -GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname, +GtkWidget *input_dialog_create(GtkWindow *parent, const char *dialogname, const char *text, const char *postinputtest, input_dialog_callback_t response_callback, gpointer response_cli_data); diff --git a/client/gui-gtk-4.0/inteldlg.c b/client/gui-gtk-4.0/inteldlg.c index 2d6412d3c1..5c308021c4 100644 --- a/client/gui-gtk-4.0/inteldlg.c +++ b/client/gui-gtk-4.0/inteldlg.c @@ -198,7 +198,7 @@ static struct intel_dialog *create_intel_dialog(struct player *p) notebook = gtk_notebook_new(); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_BOTTOM); gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(shell))), notebook); - + /* overview tab. */ table = gtk_grid_new(); g_object_set(table, "margin", 6, NULL); diff --git a/client/gui-gtk-4.0/mapctrl.c b/client/gui-gtk-4.0/mapctrl.c index f9d9173548..61a341822b 100644 --- a/client/gui-gtk-4.0/mapctrl.c +++ b/client/gui-gtk-4.0/mapctrl.c @@ -157,7 +157,7 @@ gboolean butt_release_mapcanvas(GtkWidget *w, GdkEvent *ev, gpointer data) { guint button; gdouble e_x, e_y; - + if (editor_is_active()) { return handle_edit_mouse_button_release(ev); } @@ -265,7 +265,7 @@ gboolean butt_down_mapcanvas(GtkWidget *w, GdkEvent *ev, gpointer data) && clipboard_copy_production(ptile)) { /* + RMB on city/unit: Copy Production. */ /* If nothing to copy, fall through to rectangle selection. */ - + /* Already done the copy */ } else if (state & GDK_CONTROL_MASK) { /* + RMB : Quickselect a land unit. */ diff --git a/client/gui-gtk-4.0/mapview.c b/client/gui-gtk-4.0/mapview.c index 7c2f4d4140..ef684fa02e 100644 --- a/client/gui-gtk-4.0/mapview.c +++ b/client/gui-gtk-4.0/mapview.c @@ -228,7 +228,7 @@ static gboolean anim_cursor_cb(gpointer data) if (cursor_type == CURSOR_DEFAULT) { gtk_widget_set_cursor(toplevel, NULL); cursor_timer_id = 0; - return FALSE; + return FALSE; } gtk_widget_set_cursor(toplevel, @@ -492,7 +492,7 @@ void put_unit_image(struct unit *punit, GtkImage *p, int height) FIXME: For now only two food, two gold one shield and two masks can be drawn per unit, the proper way to do this is probably something like what Civ II does. - (One food/shield/mask drawn N times, possibly one top of itself. -- SKi + (One food/shield/mask drawn N times, possibly one top of itself. -- SKi **************************************************************************/ void put_unit_image_city_overlays(struct unit *punit, GtkImage *p, int height, diff --git a/client/gui-gtk-4.0/menu.c b/client/gui-gtk-4.0/menu.c index 58451f5431..78ca2c9935 100644 --- a/client/gui-gtk-4.0/menu.c +++ b/client/gui-gtk-4.0/menu.c @@ -657,7 +657,7 @@ static void leave_callback(GtkMenuItem *item, gpointer data) GTK_BUTTONS_OK_CANCEL, _("Leaving a local game will end it!")); setup_dialog(dialog, toplevel); - g_signal_connect(dialog, "response", + g_signal_connect(dialog, "response", G_CALLBACK(leave_local_game_response), NULL); gtk_window_present(GTK_WINDOW(dialog)); } else { @@ -2354,7 +2354,7 @@ void real_menus_update(void) units_can_load(punits)); menu_entry_set_sensitive("UNIT_UNLOAD", units_can_unload(punits)); - menu_entry_set_sensitive("UNIT_UNSENTRY", + menu_entry_set_sensitive("UNIT_UNSENTRY", units_have_activity_on_tile(punits, ACTIVITY_SENTRY)); menu_entry_set_sensitive("AUTO_SETTLER", @@ -2388,7 +2388,7 @@ void real_menus_update(void) extras = extra_type_list_by_cause(EC_IRRIGATION); - if (extra_type_list_size(extras) > 0) { + if (extra_type_list_size(extras) > 0) { struct extra_type *tgt; tgt = extra_type_list_get(extras, 0); @@ -2415,7 +2415,7 @@ void real_menus_update(void) break; } } unit_list_iterate_end; - + if (city_on_tile && units_can_do_action(punits, ACTION_JOIN_CITY, TRUE)) { menus_rename("BUILD_CITY", diff --git a/client/gui-gtk-4.0/messagedlg.c b/client/gui-gtk-4.0/messagedlg.c index e27b431177..ab51eb6a0d 100644 --- a/client/gui-gtk-4.0/messagedlg.c +++ b/client/gui-gtk-4.0/messagedlg.c @@ -82,7 +82,7 @@ static void create_messageopt_dialog(void) "Popup individual window")); gtk_widget_set_name(explanation, "comment_label"); gtk_container_add(GTK_CONTAINER(shell->vbox), explanation); - gtk_widget_show(explanation); + gtk_widget_show(explanation); form = gtk_grid_new(); gtk_container_add(GTK_CONTAINER(shell->vbox), form); diff --git a/client/gui-gtk-4.0/pages.c b/client/gui-gtk-4.0/pages.c index dc9e596fab..60ca2daee4 100644 --- a/client/gui-gtk-4.0/pages.c +++ b/client/gui-gtk-4.0/pages.c @@ -65,7 +65,7 @@ static GtkWidget *scenario_authors; static GtkWidget *scenario_filename; static GtkWidget *scenario_version; -static GtkListStore *load_store, *scenario_store, *meta_store, *lan_store; +static GtkListStore *load_store, *scenario_store, *meta_store, *lan_store; static GtkListStore *server_playerlist_store; static GtkWidget *server_playerlist_view; @@ -812,7 +812,7 @@ static void server_scan_error(struct server_scan *scan, output_window_append(ftc_client, message); log_error("%s", message); - /* Main thread will finalize the scan later (or even concurrently) - + /* Main thread will finalize the scan later (or even concurrently) - * do not do anything here to cause double free or raze condition. */ } @@ -834,8 +834,8 @@ static void update_network_lists(void) Network connection state defines. **************************************************************************/ enum connection_state { - LOGIN_TYPE, - NEW_PASSWORD_TYPE, + LOGIN_TYPE, + NEW_PASSWORD_TYPE, ENTER_PASSWORD_TYPE, WAITING_TYPE }; @@ -1040,7 +1040,7 @@ static void connect_callback(GtkWidget *w, gpointer data) sz_strlcpy(server_host, gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_host)))); server_port = atoi(gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(network_port)))); - + if (connect_to_server(user_name, server_host, server_port, errbuf, sizeof(errbuf)) != -1) { } else { @@ -1048,7 +1048,7 @@ static void connect_callback(GtkWidget *w, gpointer data) output_window_append(ftc_client, errbuf); } - return; + return; case NEW_PASSWORD_TYPE: if (w != network_password) { sz_strlcpy(fc_password, @@ -1060,7 +1060,7 @@ static void connect_callback(GtkWidget *w, gpointer data) send_packet_authentication_reply(&client.conn, &reply); set_connection_state(WAITING_TYPE); - } else { + } else { append_network_statusbar(_("Passwords don't match, enter password."), TRUE); @@ -2674,7 +2674,7 @@ GtkWidget *create_start_page(void) spin = gtk_spin_button_new_with_range(1, MAX_NUM_PLAYERS, 1); start_aifill_spin = spin; gtk_spin_button_set_digits(GTK_SPIN_BUTTON(spin), 0); - gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), + gtk_spin_button_set_update_policy(GTK_SPIN_BUTTON(spin), GTK_UPDATE_IF_VALID); if (server_optset != NULL) { struct option *paifill = optset_option_by_name(server_optset, "aifill"); @@ -2819,7 +2819,7 @@ GtkWidget *create_start_page(void) pregame_votebar = voteinfo_bar_new(TRUE); } gtk_container_add(GTK_CONTAINER(box), pregame_votebar); - + toolkit_view = inputline_toolkit_view_new(); gtk_container_add(GTK_CONTAINER(box), toolkit_view); @@ -2946,7 +2946,7 @@ GtkWidget *create_load_page(void) g_signal_connect(view, "row-activated", G_CALLBACK(load_callback), NULL); - + sbox = gtk_grid_new(); gtk_widget_set_halign(sbox, GTK_ALIGN_CENTER); gtk_orientable_set_orientation(GTK_ORIENTABLE(sbox), diff --git a/client/gui-gtk-4.0/plrdlg.c b/client/gui-gtk-4.0/plrdlg.c index 65e25822db..a6c2c4bfe0 100644 --- a/client/gui-gtk-4.0/plrdlg.c +++ b/client/gui-gtk-4.0/plrdlg.c @@ -108,7 +108,7 @@ void popdown_players_dialog(void) /**********************************************************************//** Create a small colored square representing the player color, for use - in player lists. + in player lists. May return NULL if the player has no color yet. **************************************************************************/ GdkPixbuf *create_player_icon(const struct player *plr) @@ -257,11 +257,11 @@ static gint plrdlg_sort_func(GtkTreeModel *model, gtk_tree_model_get_value(model, a, PLR_DLG_COL_ID, &value); player1 = player_by_number(g_value_get_int(&value)); g_value_unset(&value); - + gtk_tree_model_get_value(model, b, PLR_DLG_COL_ID, &value); player2 = player_by_number(g_value_get_int(&value)); g_value_unset(&value); - + return player_dlg_columns[n].sort_func(player1, player2); } @@ -327,7 +327,7 @@ static void toggle_view(GtkCheckMenuItem* item, gpointer data) **************************************************************************/ static void toggle_dead_players(GtkCheckMenuItem* item, gpointer data) { - gui_options.player_dlg_show_dead_players = + gui_options.player_dlg_show_dead_players = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); real_players_dialog_update(NULL); } @@ -512,7 +512,7 @@ void create_players_dialog(void) gtk_tree_view_column_set_alignment(col, 1.0); break; } - + if (col) { gtk_tree_view_append_column(GTK_TREE_VIEW(players_list), col); } @@ -533,7 +533,7 @@ void create_players_dialog(void) vbox = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); - + sep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL); gtk_container_add(GTK_CONTAINER(vbox), sep); diff --git a/client/gui-gtk-4.0/repodlgs.c b/client/gui-gtk-4.0/repodlgs.c index 3b57a818c6..9010c36630 100644 --- a/client/gui-gtk-4.0/repodlgs.c +++ b/client/gui-gtk-4.0/repodlgs.c @@ -1322,7 +1322,7 @@ static GtkListStore *units_report_store_new(void) for (i = 0; i < URD_COL_NUM; i++) { cols[i] = unit_report_columns[i].type; } - + return gtk_list_store_newv(URD_COL_NUM, cols); } @@ -1406,7 +1406,7 @@ static void units_report_update(struct units_report *preport) upgradable = client_has_player() && NULL != can_upgrade_unittype(client_player(), utype); - + gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, URD_COL_UTYPE_NAME, utype_name_translation(utype), diff --git a/client/gui-gtk-4.0/sprite.c b/client/gui-gtk-4.0/sprite.c index 22883dd57b..d524eca25b 100644 --- a/client/gui-gtk-4.0/sprite.c +++ b/client/gui-gtk-4.0/sprite.c @@ -65,7 +65,7 @@ struct sprite *crop_sprite(struct sprite *source, cr = cairo_create(new->surface); cairo_rectangle(cr, 0, 0, width, height); cairo_clip(cr); - + cairo_set_source_surface(cr, source->surface, -x, -y); cairo_paint(cr); if (mask) { @@ -287,7 +287,7 @@ struct sprite *sprite_scale(struct sprite *src, int new_w, int new_h) get_sprite_dimensions(src, &width, &height); - new->surface = cairo_surface_create_similar(src->surface, + new->surface = cairo_surface_create_similar(src->surface, CAIRO_CONTENT_COLOR_ALPHA, new_w, new_h); cr = cairo_create(new->surface); diff --git a/client/gui-gtk-4.0/theme_dlg.c b/client/gui-gtk-4.0/theme_dlg.c index 81a5349e61..25242266b3 100644 --- a/client/gui-gtk-4.0/theme_dlg.c +++ b/client/gui-gtk-4.0/theme_dlg.c @@ -83,6 +83,6 @@ bool popup_theme_suggestion_dialog(const char *theme_name) gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); - + return load_theme; } diff --git a/client/gui-gtk-4.0/themes.c b/client/gui-gtk-4.0/themes.c index 616a69ae88..cbe274398f 100644 --- a/client/gui-gtk-4.0/themes.c +++ b/client/gui-gtk-4.0/themes.c @@ -172,14 +172,14 @@ char **get_useable_themes_in_directory(const char *directory, int *count) /* File doesn't exist */ continue; } - + if (!S_ISREG(stat_result.st_mode)) { /* Not a regular file */ continue; } - + /* Otherwise it's ok */ - + /* Increase array size if needed */ if (*count == t_size) { theme_names = fc_realloc(theme_names, t_size * 2 * sizeof(char *)); diff --git a/client/gui-gtk-4.0/unitselect.c b/client/gui-gtk-4.0/unitselect.c index 9336e68655..a8fd195de5 100644 --- a/client/gui-gtk-4.0/unitselect.c +++ b/client/gui-gtk-4.0/unitselect.c @@ -152,7 +152,7 @@ static void usdlg_tab_select(struct unit_select_dialog *pdialog, const char *title, enum unit_select_location_mode loc); static GtkTreeStore *usdlg_tab_store_new(void); -static bool usdlg_tab_update(struct unit_select_dialog *pdialog, +static bool usdlg_tab_update(struct unit_select_dialog *pdialog, struct usdata_hash *ushash, enum unit_select_location_mode loc); static void usdlg_tab_append_utype(GtkTreeStore *store, @@ -1003,7 +1003,7 @@ static void usdlg_cmd_exec(GObject *object, gpointer mode_data, ushash = usdlg_data_new(pdialog->ptile); usdata_hash_lookup(ushash, utid, &data); - if (data != NULL + if (data != NULL && unit_list_size(data->units[loc][act]) != 0) { unit_list_iterate(data->units[loc][act], punit) { usdlg_cmd_exec_unit(punit, cmd); diff --git a/client/gui-gtk-4.0/voteinfo_bar.c b/client/gui-gtk-4.0/voteinfo_bar.c index 8bff622023..5d50ccbebb 100644 --- a/client/gui-gtk-4.0/voteinfo_bar.c +++ b/client/gui-gtk-4.0/voteinfo_bar.c @@ -56,7 +56,7 @@ static void voteinfo_bar_do_vote_callback(GtkWidget *w, gpointer userdata) { enum client_vote_type vote; struct voteinfo *vi; - + vote = GPOINTER_TO_INT(userdata); vi = voteinfo_queue_get_current(NULL); diff --git a/client/gui-gtk-4.0/wldlg.c b/client/gui-gtk-4.0/wldlg.c index 11fb2daa2c..327c38a003 100644 --- a/client/gui-gtk-4.0/wldlg.c +++ b/client/gui-gtk-4.0/wldlg.c @@ -249,7 +249,7 @@ static GtkWidget *create_worklists_report(void) gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE); worklists_list = list; - + rend = gtk_cell_renderer_text_new(); g_object_set(rend, "editable", TRUE, NULL); g_signal_connect(rend, "edited", @@ -745,7 +745,7 @@ static void src_row_callback(GtkTreeView *view, GtkTreePath *path, if (!gtk_widget_is_sensitive(ptr->dst_view)) { return; } - + src_model = GTK_TREE_MODEL(ptr->src); dst_model = GTK_TREE_MODEL(ptr->dst); @@ -918,7 +918,7 @@ static void dst_selection_callback(GtkTreeSelection *selection, gpointer data) } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(ptr->dst), &it)); } if (num_rows > 1) { - gtk_widget_set_sensitive(ptr->remove_cmd, TRUE); + gtk_widget_set_sensitive(ptr->remove_cmd, TRUE); } else { gtk_widget_set_sensitive(ptr->remove_cmd, FALSE); } @@ -1089,7 +1089,7 @@ GtkWidget *create_worklist(void) ptr->dst = dst_store; ptr->future = FALSE; - /* create shell. */ + /* create shell. */ editor = gtk_grid_new(); gtk_grid_set_row_spacing(GTK_GRID(editor), 6); gtk_orientable_set_orientation(GTK_ORIENTABLE(editor), -- 2.33.0