summaryrefslogtreecommitdiff
path: root/tubes
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-03-26 23:31:58 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:01 +0200
commit7c5b100ce858189db83d7da152cf499cadb06afc (patch)
tree231cac13b4bee908d150a7a51d4a43e0a8405a04 /tubes
parent257bf1f2572d482c291f2f3e60c55be8fea5894b (diff)
silence WaE incompatible pointer type and unused parameters
* "passing argument 1 of ‘gtk_message_dialog_format_secondary_markup’ from incompatible pointer type" * dialog was in fact constructed as GtkMessageDialog using gtk_message_dialog_new_with_markup(), so use it as such * "passing argument 1 of ‘gtk_widget_destroy’ from incompatible pointer type" * use GTK_WIDGET() on dialog GtkMessageDialog* * "passing argument 1 of ‘g_object_get_data’ from incompatible pointer type" * use G_OBJECT on dialog GtkWidget* * "passing argument 1 of ‘gtk_dialog_set_response_sensitive’ from incompatible pointer type" * use GTK_DIALOG on dialog GtkWidget* * "passing argument 1 of ‘gtk_message_dialog_set_image’ from incompatible pointer type" and "passing argument 1 of ‘gtk_dialog_add_buttons’ from incompatible pointer type" * use GTK_MESSAGE_DIALOG() on dialog GtkWidget* * "passing argument 1 of ‘g_object_set_data_full’ from incompatible pointer type" * use G_OBJECT() on dialog GtkWidget*:x * "passing argument 3 of ‘g_signal_connect_data’ from incompatible pointer type" * use G_CALLBACK() on dialog_response_cb * "passing argument 1 of ‘gtk_window_set_skip_taskbar_hint’ from incompatible pointer type" * use GTK_WINDOW() on dialog GtkWidget* How awful C is :-/ GtkMessageDialog is a GtkDialog is a GtkWindow is a GtkWidget is a GObject, but still ...
Diffstat (limited to 'tubes')
-rw-r--r--tubes/source/approver.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/tubes/source/approver.c b/tubes/source/approver.c
index 5f4bbde7c38f..f5e58125dc6b 100644
--- a/tubes/source/approver.c
+++ b/tubes/source/approver.c
@@ -45,7 +45,7 @@ handle_with_cb (GObject *source,
gpointer user_data)
{
TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source);
- GtkDialog *dialog = GTK_DIALOG (user_data);
+ GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (user_data);
GError *error = NULL;
if (!tp_channel_dispatch_operation_handle_with_finish (cdo, result, &error))
@@ -59,7 +59,7 @@ handle_with_cb (GObject *source,
}
g_print ("HandleWith() succeeded\n");
- gtk_widget_destroy (dialog);
+ gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
@@ -71,6 +71,8 @@ close_cb (GObject *source,
TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source);
GError *error = NULL;
+ (void)user_data; /* suppress unused-parameter warning */
+
if (!tp_channel_dispatch_operation_close_channels_finish (cdo, result, &error))
{
g_print ("Rejecting channels failed: %s\n", error->message);
@@ -87,9 +89,11 @@ dialog_response_cb (
gint response_id,
gpointer user_data)
{
- TpSimpleApprover *self = TP_SIMPLE_APPROVER (g_object_get_data (dialog, "client"));
+ TpSimpleApprover *self = TP_SIMPLE_APPROVER (g_object_get_data (G_OBJECT (dialog), "client"));
TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (user_data);
+ (void)self; /* suppress unused-parameter warning (could remove TP_SIMPLE_APPROVER above?) */
+
if (response_id == GTK_RESPONSE_ACCEPT)
{
g_print ("Approve channels\n");
@@ -97,8 +101,8 @@ dialog_response_cb (
tp_channel_dispatch_operation_handle_with_async (cdo, NULL,
handle_with_cb, dialog);
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_ACCEPT, FALSE);
- gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_REJECT, FALSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT, FALSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT, FALSE);
}
else
{
@@ -131,18 +135,18 @@ show_dialog (
{
GtkWidget *avatar = gtk_image_new_from_file (g_file_get_path (avatar_file));
- gtk_message_dialog_set_image (dialog, avatar);
+ gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), avatar);
}
- gtk_dialog_add_buttons (dialog,
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
"_Reject", GTK_RESPONSE_REJECT,
"_Accept", GTK_RESPONSE_ACCEPT,
NULL);
- g_object_set_data_full (dialog, "client", g_object_ref (self), g_object_unref);
- g_signal_connect (dialog, "response", dialog_response_cb, g_object_ref (cdo));
+ g_object_set_data_full (G_OBJECT (dialog), "client", g_object_ref (self), g_object_unref);
+ g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), g_object_ref (cdo));
- gtk_window_set_skip_taskbar_hint (dialog, FALSE);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
gtk_widget_show_all (dialog);
}
@@ -159,6 +163,10 @@ add_dispatch_operation_cb (TpSimpleApprover *self,
TpContact *target = NULL;
GList *l;
+ (void)account; /* suppress unused-parameter warning */
+ (void)connection; /* suppress unused-parameter warning */
+ (void)user_data; /* suppress unused-parameter warning */
+
g_print ("Approving this batch of channels:\n");
for (l = channels; l != NULL; l = g_list_next (l))