[gnome-control-center/extensible-shell] [shell] clean up compiler warnings
- From: Thomas Wood <thos src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-control-center/extensible-shell] [shell] clean up compiler warnings
- Date: Fri, 29 Jan 2010 10:30:27 +0000 (UTC)
commit f0eec36f4dfbe815bc2b98534a62692ada8aea6c
Author: Thomas Wood <thomas wood intel com>
Date: Fri Jan 29 10:30:05 2010 +0000
[shell] clean up compiler warnings
Mark functions as static when they do not need to be used outside the file
scope.
GCC warns about a missing initialiser for iter in item_activated_cb, so
Remove the need to initialise the iter bychecking whether it is valid from
the return value of gtk_tree_model_get_iter().
shell/control-center.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/shell/control-center.c b/shell/control-center.c
index e391d95..fdbd8e4 100644
--- a/shell/control-center.c
+++ b/shell/control-center.c
@@ -49,7 +49,7 @@ typedef struct
} ShellData;
-void item_activated_cb (GtkIconView *icon_view, GtkTreePath *path, ShellData *data);
+static void item_activated_cb (GtkIconView *icon_view, GtkTreePath *path, ShellData *data);
#ifdef RUN_IN_SOURCE_TREE
static GList *
@@ -145,7 +145,7 @@ load_panel_plugins (void)
g_list_free (modules);
}
-gboolean
+static gboolean
button_release_cb (GtkWidget *view,
GdkEventButton *event,
ShellData *data)
@@ -167,7 +167,7 @@ button_release_cb (GtkWidget *view,
return FALSE;
}
-void
+static void
selection_changed_cb (GtkIconView *view,
ShellData *data)
{
@@ -198,7 +198,7 @@ selection_changed_cb (GtkIconView *view,
}
}
-gboolean
+static gboolean
model_filter_func (GtkTreeModel *model,
GtkTreeIter *iter,
ShellData *data)
@@ -223,7 +223,7 @@ model_filter_func (GtkTreeModel *model,
return FALSE;
}
-void
+static void
fill_model (ShellData *data)
{
GSList *list, *l;
@@ -365,14 +365,14 @@ fill_model (ShellData *data)
}
-void
+static void
item_activated_cb (GtkIconView *icon_view,
GtkTreePath *path,
ShellData *data)
{
GtkTreeModel *model;
- GtkTreeIter iter = {0,};
- gchar *name, *exec, *id, *markup;
+ GtkTreeIter iter;
+ gchar *name, *exec, *id;
GtkWidget *notebook;
static gint index = -1;
CcPanel *panel;
@@ -384,7 +384,9 @@ item_activated_cb (GtkIconView *icon_view,
/* get exec */
model = gtk_icon_view_get_model (icon_view);
- gtk_tree_model_get_iter (model, &iter, path);
+ /* get the iter and ensure it is valid */
+ if (!gtk_tree_model_get_iter (model, &iter, path))
+ return;
gtk_tree_model_get (model, &iter, 0, &name, 1, &exec, 2, &id, -1);
@@ -437,7 +439,7 @@ home_button_clicked_cb (GtkButton *button,
gtk_widget_hide (GTK_WIDGET (button));
}
-void
+static void
search_entry_changed_cb (GtkEntry *entry,
ShellData *data)
{
@@ -457,7 +459,7 @@ search_entry_changed_cb (GtkEntry *entry,
}
}
-gboolean
+static gboolean
search_entry_key_press_event_cb (GtkEntry *entry,
GdkEventKey *event,
ShellData *data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]