[virt-tools-list] [virt-viewer 1/2] Don't call local variable 'select'

Marc-André Lureau mlureau at redhat.com
Thu Oct 30 16:28:12 UTC 2014


ack

----- Original Message -----
> This causes warnings with older compilers
> virt-viewer-vm-connection.c:52: warning: declaration of 'select' shadows
> a global declaration
> /usr/include/sys/select.h:109: warning: shadowed declaration is here
> ---
>  src/virt-viewer-vm-connection.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/virt-viewer-vm-connection.c
> b/src/virt-viewer-vm-connection.c
> index f6fcd03..1b00562 100644
> --- a/src/virt-viewer-vm-connection.c
> +++ b/src/virt-viewer-vm-connection.c
> @@ -49,7 +49,7 @@ virt_viewer_vm_connection_choose_name_dialog(GtkTreeModel
> *model, GError **error
>      GtkWidget *dialog;
>      GtkButton *button_connect;
>      GtkTreeView *treeview;
> -    GtkTreeSelection *select;
> +    GtkTreeSelection *selection;
>      GtkTreeIter iter;
>      int dialog_response;
>      gchar *vm_name = NULL;
> @@ -69,12 +69,12 @@ virt_viewer_vm_connection_choose_name_dialog(GtkTreeModel
> *model, GError **error
>      dialog = GTK_WIDGET(gtk_builder_get_object(vm_connection,
>      "vm-connection-dialog"));
>      button_connect = GTK_BUTTON(gtk_builder_get_object(vm_connection,
>      "button-connect"));
>      treeview = GTK_TREE_VIEW(gtk_builder_get_object(vm_connection,
>      "treeview"));
> -    select = GTK_TREE_SELECTION(gtk_builder_get_object(vm_connection,
> "treeview-selection"));
> +    selection = GTK_TREE_SELECTION(gtk_builder_get_object(vm_connection,
> "treeview-selection"));
>      gtk_tree_view_set_model(treeview, model);
>  
>      g_signal_connect(treeview, "row-activated",
>                       G_CALLBACK(treeview_row_activated_cb), button_connect);
> -    g_signal_connect(select, "changed",
> +    g_signal_connect(selection, "changed",
>                       G_CALLBACK(treeselection_changed_cb), button_connect);
>  
>      gtk_widget_show_all(dialog);
> @@ -82,7 +82,7 @@ virt_viewer_vm_connection_choose_name_dialog(GtkTreeModel
> *model, GError **error
>      gtk_widget_hide(dialog);
>  
>      if (dialog_response == GTK_RESPONSE_ACCEPT &&
> -        gtk_tree_selection_get_selected(select, &model, &iter)) {
> +        gtk_tree_selection_get_selected(selection, &model, &iter)) {
>          gtk_tree_model_get(model, &iter, 0, &vm_name, -1);
>      } else {
>          g_set_error_literal(error,
> --
> 2.1.0
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 




More information about the virt-tools-list mailing list