[gnome-todo] Fix compiler warnings
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] Fix compiler warnings
- Date: Tue, 28 Jul 2015 10:38:36 +0000 (UTC)
commit 06188e2baf9b26dcf3c89bee046685723dd91531
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Jul 21 10:59:48 2015 +0100
Fix compiler warnings
Mostly drop a bunch of unused variables and functions.
src/gtd-application.c | 10 +++----
src/gtd-arrow-frame.c | 33 ++++--------------------
src/gtd-edit-pane.c | 3 --
src/gtd-initial-setup-window.c | 3 --
src/gtd-manager.c | 37 +++++++++-------------------
src/gtd-task-list-item.c | 5 +---
src/gtd-task-list-view.c | 7 -----
src/gtd-task-row.c | 9 -------
src/notification/gtd-notification-widget.c | 1 -
src/storage/gtd-storage-dialog.c | 3 --
src/storage/gtd-storage-popover.c | 3 --
src/storage/gtd-storage-selector.c | 15 +++--------
12 files changed, 27 insertions(+), 102 deletions(-)
---
diff --git a/src/gtd-application.c b/src/gtd-application.c
index 064e0fa..0ce96a0 100644
--- a/src/gtd-application.c
+++ b/src/gtd-application.c
@@ -73,18 +73,18 @@ gtd_application_show_about (GSimpleAction *simple,
GDateTime *date;
int created_year = 2015;
- date = g_date_time_new_now_local ();
-
- const gchar *authors[] = {
+ static const gchar *authors[] = {
"Georges Basile Stavracas Neto <georges stavracas gmail com>",
NULL
};
- const gchar *artists[] = {
+ static const gchar *artists[] = {
"Allan Day <allanpday gmail com>",
NULL
};
+ date = g_date_time_new_now_local ();
+
if (g_date_time_get_year (date) == created_year)
{
copyright = g_strdup_printf (_("Copyright \xC2\xA9 %Id "
@@ -233,8 +233,6 @@ gtd_application_activate (GApplication *application)
static void
gtd_application_finalize (GObject *object)
{
- GtdApplication *self = GTD_APPLICATION (object);
-
G_OBJECT_CLASS (gtd_application_parent_class)->finalize (object);
}
diff --git a/src/gtd-arrow-frame.c b/src/gtd-arrow-frame.c
index 60fc58f..39fe843 100644
--- a/src/gtd-arrow-frame.c
+++ b/src/gtd-arrow-frame.c
@@ -56,17 +56,6 @@ gtd_arrow_frame_new (void)
return g_object_new (GTD_TYPE_ARROW_FRAME, NULL);
}
-static gint
-get_handle_position (GtdArrowFrame *frame)
-{
- GtkWidget *widget = GTK_WIDGET (frame);
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- return gtk_widget_get_allocated_width (widget) - HANDLE_GAP;
- else
- return 0;
-}
-
static void
on_drag_begin_cb (GtdArrowFrame *frame,
gdouble x,
@@ -97,7 +86,6 @@ on_pan_cb (GtkWidget *widget,
GtdArrowFramePrivate *priv;
GtkTextDirection dir;
gdouble offset_x;
- gdouble new_offset;
priv = GTD_ARROW_FRAME (widget)->priv;
dir = gtk_widget_get_direction (widget);
@@ -179,14 +167,9 @@ gtd_arrow_frame_set_property (GObject *object,
}
static void
-gtd_arrow_frame__row_destroyed (GtdTaskRow *row,
- gpointer user_data)
+gtd_arrow_frame__row_destroyed (GtdArrowFrame *frame)
{
- GtdArrowFramePrivate *priv;
-
- g_return_if_fail (GTD_IS_ARROW_FRAME (user_data));
-
- gtd_arrow_frame_set_row (GTD_ARROW_FRAME (user_data), NULL);
+ gtd_arrow_frame_set_row (frame, NULL);
}
static gint
@@ -442,10 +425,6 @@ static void
gtd_arrow_frame_compute_child_allocation (GtkFrame *frame,
GtkAllocation *allocation)
{
- GtdArrowFramePrivate *priv;
-
- priv = GTD_ARROW_FRAME (frame)->priv;
-
GTK_FRAME_CLASS (gtd_arrow_frame_parent_class)->compute_child_allocation (frame, allocation);
allocation->width -= ARROW_WIDTH;
@@ -638,10 +617,10 @@ gtd_arrow_frame_set_row (GtdArrowFrame *frame,
if (row)
{
- g_signal_connect (row,
- "destroy",
- G_CALLBACK (gtd_arrow_frame__row_destroyed),
- frame);
+ g_signal_connect_swapped (row,
+ "destroy",
+ G_CALLBACK (gtd_arrow_frame__row_destroyed),
+ frame);
gtk_widget_queue_draw (GTK_WIDGET (frame));
}
diff --git a/src/gtd-edit-pane.c b/src/gtd-edit-pane.c
index 3aaced9..23fb110 100644
--- a/src/gtd-edit-pane.c
+++ b/src/gtd-edit-pane.c
@@ -177,9 +177,6 @@ gtd_edit_pane__date_selected (GtkCalendar *calendar,
static void
gtd_edit_pane_finalize (GObject *object)
{
- GtdEditPane *self = (GtdEditPane *)object;
- GtdEditPanePrivate *priv = gtd_edit_pane_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_edit_pane_parent_class)->finalize (object);
}
diff --git a/src/gtd-initial-setup-window.c b/src/gtd-initial-setup-window.c
index 9ab26ce..2f3cd60 100644
--- a/src/gtd-initial-setup-window.c
+++ b/src/gtd-initial-setup-window.c
@@ -100,9 +100,6 @@ gtd_initial_setup_window__button_clicked (GtdInitialSetupWindow *window,
static void
gtd_initial_setup_window_finalize (GObject *object)
{
- GtdInitialSetupWindow *self = (GtdInitialSetupWindow *)object;
- GtdInitialSetupWindowPrivate *priv = gtd_initial_setup_window_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_initial_setup_window_parent_class)->finalize (object);
}
diff --git a/src/gtd-manager.c b/src/gtd-manager.c
index a1d0fb1..ed3cec3 100644
--- a/src/gtd-manager.c
+++ b/src/gtd-manager.c
@@ -100,7 +100,7 @@ enum
static guint signals[NUM_SIGNALS] = { 0, };
-TaskData*
+static TaskData*
task_data_new (GtdManager *manager,
gpointer *data)
{
@@ -113,7 +113,7 @@ task_data_new (GtdManager *manager,
return tdata;
}
-gboolean
+static gboolean
is_today (GDateTime *dt)
{
GDateTime *today;
@@ -156,7 +156,6 @@ gtd_manager__setup_url (GtdManager *manager,
for (l = sources; l != NULL; l = l->next)
{
- const gchar *parent_uid;
ESource *source;
ESource *goa_source;
@@ -388,7 +387,6 @@ gtd_manager__commit_source_finished (GObject *registry,
GAsyncResult *result,
gpointer user_data)
{
- GtdManagerPrivate *priv = GTD_MANAGER (user_data)->priv;
GError *error = NULL;
g_return_if_fail (GTD_IS_MANAGER (user_data));
@@ -448,15 +446,14 @@ gtd_manager__create_task_finished (GObject *client,
{
GtdManagerPrivate *priv;
TaskData *data = user_data;
- gboolean success;
gchar *new_uid = NULL;
GError *error = NULL;
priv = data->manager->priv;
- success = e_cal_client_create_object_finish (E_CAL_CLIENT (client),
- result,
- &new_uid,
- &error);
+ e_cal_client_create_object_finish (E_CAL_CLIENT (client),
+ result,
+ &new_uid,
+ &error);
gtd_object_set_ready (GTD_OBJECT (data->data), TRUE);
@@ -507,13 +504,12 @@ gtd_manager__remove_task_finished (GObject *client,
{
GtdManagerPrivate *priv;
TaskData *data = user_data;
- gboolean success;
GError *error = NULL;
priv = data->manager->priv;
- success = e_cal_client_remove_object_finish (E_CAL_CLIENT (client),
- result,
- &error);
+ e_cal_client_remove_object_finish (E_CAL_CLIENT (client),
+ result,
+ &error);
gtd_object_set_ready (GTD_OBJECT (data->data), TRUE);
@@ -545,14 +541,13 @@ gtd_manager__update_task_finished (GObject *client,
GDateTime *dt;
TaskData *data = user_data;
GtdTask *task;
- gboolean success;
GError *error = NULL;
priv = data->manager->priv;
task = GTD_TASK (data->data);
- success = e_cal_client_modify_object_finish (E_CAL_CLIENT (client),
- result,
- &error);
+ e_cal_client_modify_object_finish (E_CAL_CLIENT (client),
+ result,
+ &error);
/* Check if the task still fits internal lists */
dt = gtd_task_get_due_date (task);
@@ -717,11 +712,8 @@ gtd_manager__fill_task_list (GObject *client,
if (!error)
{
- GDateTime *today;
GSList *l;
- today = g_date_time_new_now_local ();
-
for (l = component_list; l != NULL; l = l->next)
{
GDateTime *dt;
@@ -978,8 +970,6 @@ gtd_manager_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GtdManager *self = GTD_MANAGER (object);
-
switch (prop_id)
{
default:
@@ -993,8 +983,6 @@ gtd_manager_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GtdManager *self = GTD_MANAGER (object);
-
switch (prop_id)
{
default:
@@ -1495,7 +1483,6 @@ gtd_manager_get_default_storage (GtdManager *manager)
{
GtdManagerPrivate *priv;
GtdStorage *storage;
- GList *l;
gchar *storage_id;
g_return_val_if_fail (GTD_IS_MANAGER (manager), NULL);
diff --git a/src/gtd-task-list-item.c b/src/gtd-task-list-item.c
index 8bd4139..0a0b60a 100644
--- a/src/gtd-task-list-item.c
+++ b/src/gtd-task-list-item.c
@@ -57,7 +57,7 @@ enum {
LAST_PROP
};
-GdkPixbuf*
+static GdkPixbuf*
gtd_task_list_item__render_thumbnail (GtdTaskListItem *item)
{
PangoFontDescription *font_desc;
@@ -317,9 +317,6 @@ gtd_task_list_item_state_flags_changed (GtkWidget *item,
static void
gtd_task_list_item_finalize (GObject *object)
{
- GtdTaskListItem *self = (GtdTaskListItem *)object;
- GtdTaskListItemPrivate *priv = gtd_task_list_item_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_task_list_item_parent_class)->finalize (object);
}
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index f61b607..de3dc63 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -508,8 +508,6 @@ gtd_task_list_view__task_added (GtdTaskList *list,
GtdTask *task,
gpointer user_data)
{
- GtdTaskListViewPrivate *priv = GTD_TASK_LIST_VIEW (user_data)->priv;
-
g_return_if_fail (GTD_IS_TASK_LIST_VIEW (user_data));
g_return_if_fail (GTD_IS_TASK_LIST (list));
g_return_if_fail (GTD_IS_TASK (task));
@@ -529,7 +527,6 @@ gtd_task_list_view__create_task (GtdTaskRow *row,
gpointer user_data)
{
GtdTaskListViewPrivate *priv = GTD_TASK_LIST_VIEW (user_data)->priv;
- GtkWidget *new_row;
g_return_if_fail (GTD_IS_TASK_LIST_VIEW (user_data));
g_return_if_fail (GTD_IS_TASK_ROW (row));
@@ -550,9 +547,6 @@ gtd_task_list_view__create_task (GtdTaskRow *row,
static void
gtd_task_list_view_finalize (GObject *object)
{
- GtdTaskListView *self = (GtdTaskListView *)object;
- GtdTaskListViewPrivate *priv = gtd_task_list_view_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_task_list_view_parent_class)->finalize (object);
}
@@ -956,7 +950,6 @@ gtd_task_list_view_set_task_list (GtdTaskListView *view,
gchar *color_str;
gchar *parsed_css;
GList *task_list;
- GList *l;
/*
* Disconnect the old GtdTaskList signals.
diff --git a/src/gtd-task-row.c b/src/gtd-task-row.c
index adc0d6b..e64253a 100644
--- a/src/gtd-task-row.c
+++ b/src/gtd-task-row.c
@@ -23,8 +23,6 @@
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <math.h>
-
typedef struct
{
GtkRevealer *revealer;
@@ -81,13 +79,11 @@ gtd_task_row__priority_changed_cb (GtdTaskRow *row,
GParamSpec *spec,
GObject *object)
{
- GtdTaskRowPrivate *priv;
GtkStyleContext *context;
gint priority;
g_return_if_fail (GTD_IS_TASK_ROW (row));
- priv = row->priv;
context = gtk_widget_get_style_context (GTK_WIDGET (row));
priority = gtd_task_get_priority (GTD_TASK (object));
@@ -124,13 +120,11 @@ gtd_task_row__date_changed_binding (GBinding *binding,
GValue *to_value,
gpointer user_data)
{
- GtdTaskRowPrivate *priv;
GDateTime *dt;
gchar *new_label = NULL;
g_return_val_if_fail (GTD_IS_TASK_ROW (user_data), FALSE);
- priv = GTD_TASK_ROW (user_data)->priv;
dt = g_value_get_boxed (from_value);
if (dt)
@@ -287,9 +281,6 @@ gtd_task_row__entry_activated (GtkEntry *entry,
static void
gtd_task_row_finalize (GObject *object)
{
- GtdTaskRow *self = (GtdTaskRow *)object;
- GtdTaskRowPrivate *priv = gtd_task_row_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_task_row_parent_class)->finalize (object);
}
diff --git a/src/notification/gtd-notification-widget.c b/src/notification/gtd-notification-widget.c
index b5ab426..dce58d1 100644
--- a/src/notification/gtd-notification-widget.c
+++ b/src/notification/gtd-notification-widget.c
@@ -280,7 +280,6 @@ gtd_notification_widget_cancel (GtdNotificationWidget *widget,
GtdNotification *notification)
{
GtdNotificationWidgetPrivate *priv;
- GList *l;
g_return_if_fail (GTD_IS_NOTIFICATION_WIDGET (widget));
diff --git a/src/storage/gtd-storage-dialog.c b/src/storage/gtd-storage-dialog.c
index 2d91c30..6d93427 100644
--- a/src/storage/gtd-storage-dialog.c
+++ b/src/storage/gtd-storage-dialog.c
@@ -66,9 +66,6 @@ gtd_storage_dialog__storage_selected (GtdStorageDialog *dialog,
static void
gtd_storage_dialog_finalize (GObject *object)
{
- GtdStorageDialog *self = (GtdStorageDialog *)object;
- GtdStorageDialogPrivate *priv = gtd_storage_dialog_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_storage_dialog_parent_class)->finalize (object);
}
diff --git a/src/storage/gtd-storage-popover.c b/src/storage/gtd-storage-popover.c
index 9119c58..ddba556 100644
--- a/src/storage/gtd-storage-popover.c
+++ b/src/storage/gtd-storage-popover.c
@@ -176,9 +176,6 @@ gtd_storage_popover__storage_selected (GtdStoragePopover *popover,
static void
gtd_storage_popover_finalize (GObject *object)
{
- GtdStoragePopover *self = (GtdStoragePopover *)object;
- GtdStoragePopoverPrivate *priv = gtd_storage_popover_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_storage_popover_parent_class)->finalize (object);
}
diff --git a/src/storage/gtd-storage-selector.c b/src/storage/gtd-storage-selector.c
index fddefaf..62752b8 100644
--- a/src/storage/gtd-storage-selector.c
+++ b/src/storage/gtd-storage-selector.c
@@ -69,11 +69,11 @@ enum {
static guint signals[LAST_SIGNAL] = { 0, };
static void
-spawn (gchar *action,
- gchar *arg)
+spawn (const gchar *action,
+ const gchar *arg)
{
- gchar *command[] = {"gnome-control-center", "online-accounts", action, arg, NULL};
- g_spawn_async (NULL, command, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL, NULL, NULL,
NULL);
+ const gchar *command[] = {"gnome-control-center", "online-accounts", action, arg, NULL};
+ g_spawn_async (NULL, (gchar **) command, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL, NULL,
NULL, NULL, NULL);
}
/**
@@ -240,7 +240,6 @@ gtd_storage_selector__remove_storage (GtdStorageSelector *selector,
GtdStorage *storage)
{
GtdStorageSelectorPrivate *priv;
- GtkWidget *row;
GList *children;
GList *l;
gint exchange;
@@ -354,11 +353,8 @@ sort_func (GtkListBoxRow *row1,
GtkListBoxRow *row2,
gpointer user_data)
{
- GtdStorageRow *r1;
- GtdStorageRow *r2;
GtdStorage *storage1;
GtdStorage *storage2;
- gint retval;
if (!GTD_IS_STORAGE_ROW (row1))
return 1;
@@ -393,9 +389,6 @@ gtd_storage_selector_constructed (GObject *object)
static void
gtd_storage_selector_finalize (GObject *object)
{
- GtdStorageSelector *self = (GtdStorageSelector *)object;
- GtdStorageSelectorPrivate *priv = gtd_storage_selector_get_instance_private (self);
-
G_OBJECT_CLASS (gtd_storage_selector_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]