[anjal] Compiler warnings fixed for mail-component.c



commit bcdb65459c602d185a1479f73d84c11417ff6dcd
Author: Yan Li <yan i li intel com>
Date:   Fri Sep 25 10:47:43 2009 +0800

    Compiler warnings fixed for mail-component.c

 src/mail-component.c |   81 +++++++++++++++++++++++++++++++------------------
 src/mail-component.h |    2 +
 2 files changed, 53 insertions(+), 30 deletions(-)
---
diff --git a/src/mail-component.c b/src/mail-component.c
index a2aac3b..6b035b1 100644
--- a/src/mail-component.c
+++ b/src/mail-component.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -107,7 +109,7 @@ struct _MailComponentPrivate {
 	GMutex *lock;
 
 	/* states/data used during shutdown */
-	enum { MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state;
+	enum { MC_QUIT_NOT_START, MC_QUIT_START, MC_QUIT_SYNC, MC_QUIT_THREADS } quit_state;
 	int quit_count;
 	int quit_expunge;	/* expunge on quit this time around? */
 
@@ -140,12 +142,12 @@ static struct {
 	CamelFolder *folder;
 } mc_default_folders[] = {
 	/* translators: standard local mailbox names */
-	{ N_("Inbox"), },
-	{ N_("Drafts"), },
-	{ N_("Outbox"), },
-	{ N_("Sent"), },
-	{ N_("Templates"), },
-	{ "Inbox", },		/* 'always local' inbox */
+	{ N_("Inbox"), NULL, NULL },
+	{ N_("Drafts"), NULL, NULL },
+	{ N_("Outbox"), NULL, NULL },
+	{ N_("Sent"), NULL, NULL },
+	{ N_("Templates"), NULL, NULL },
+	{ "Inbox", NULL, NULL },	/* 'always local' inbox */
 };
 
 static struct _store_info *
@@ -232,10 +234,12 @@ mc_add_store(MailComponent *component, CamelStore *store, const char *name, void
 }
 
 static void
-mc_add_local_store_done(CamelStore *store, CamelFolderInfo *info, void *data)
+mc_add_local_store_done(CamelStore *store G_GNUC_UNUSED,
+			CamelFolderInfo *info G_GNUC_UNUSED,
+			void *data G_GNUC_UNUSED)
 {
 	/*MailComponent *mc = data;*/
-	int i;
+	size_t i;
 
 	for (i=0;i<sizeof(mc_default_folders)/sizeof(mc_default_folders[0]);i++) {
 		if (mc_default_folders[i].folder)
@@ -258,7 +262,7 @@ mc_setup_local_store(MailComponent *mc)
 	CamelURL *url;
 	char *tmp;
 	CamelException ex;
-	int i;
+	size_t i;
 
 	g_mutex_lock(p->lock);
 	if (p->local_store != NULL) {
@@ -518,7 +522,7 @@ enable_folder_tree (GtkWidget *emfb, GtkWidget *emft)
 /* Evolution::Component CORBA methods.  */
 
 static gboolean
-mc_hide_status (gpointer data)
+mc_hide_status (gpointer data G_GNUC_UNUSED)
 {
 	mail_component_show_status_bar (FALSE);
 
@@ -526,7 +530,8 @@ mc_hide_status (gpointer data)
 }
 
 MailComponent *
-mail_component_create (GtkWidget * parent, gboolean select_item)
+mail_component_create (GtkWidget * parent G_GNUC_UNUSED,
+		       gboolean select_item G_GNUC_UNUSED)
 {
 	MailComponent *mail_component = mail_component_peek ();
 	MailComponentPrivate *priv = mail_component->priv;
@@ -596,7 +601,7 @@ mail_component_create (GtkWidget * parent, gboolean select_item)
 }
 
 gboolean
-mail_component_can_quit(MailComponent *mc)
+mail_component_can_quit(MailComponent *mc G_GNUC_UNUSED)
 {
 	CamelFolder *folder;
 	guint32 unsent;
@@ -616,7 +621,8 @@ mail_component_can_quit(MailComponent *mc)
 }
 
 static void
-mc_quit_sync_done(CamelStore *store, void *data)
+mc_quit_sync_done(CamelStore *store G_GNUC_UNUSED,
+		  void *data)
 {
 	MailComponent *mc = data;
 
@@ -624,20 +630,24 @@ mc_quit_sync_done(CamelStore *store, void *data)
 }
 
 static void
-mc_quit_sync(CamelStore *store, struct _store_info *si, MailComponent *mc)
+mc_quit_sync(CamelStore *store,
+	     struct _store_info *si G_GNUC_UNUSED,
+	     MailComponent *mc)
 {
 	mc->priv->quit_count++;
 	mail_sync_store(store, mc->priv->quit_expunge, mc_quit_sync_done, mc);
 }
 
 static void
-mc_quit_delete (CamelStore *store, struct _store_info *si, MailComponent *mc)
+mc_quit_delete (CamelStore *store,
+		struct _store_info *si G_GNUC_UNUSED,
+		MailComponent *mc G_GNUC_UNUSED)
 {
 	CamelFolder *folder = camel_store_get_junk (store, NULL);
 
 	if (folder) {
 		GPtrArray *uids;
-		int i;
+		size_t i;
 
 		uids =  camel_folder_get_uids (folder);
 		camel_folder_freeze(folder);
@@ -653,13 +663,14 @@ mail_component_quit(MailComponent *mc)
 {
 	static int quit_on_twice = 0;
 
-	if (mc->priv->quit_state == -1)
+	if (mc->priv->quit_state == MC_QUIT_NOT_START)
 		mc->priv->quit_state = MC_QUIT_START;
 
 	g_source_remove (mc->priv->status_hide);
 
 	mail_config_prune_proxies ();
 	switch (mc->priv->quit_state) {
+	case MC_QUIT_NOT_START:
 	case MC_QUIT_START: {
 		extern int camel_application_is_exiting;
 		int now = time(NULL)/60/60/24, days;
@@ -836,7 +847,7 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme
 #endif 
 
 void
-mail_component_send_receive (MailComponent *mc)
+mail_component_send_receive (MailComponent *mc G_GNUC_UNUSED)
 {
 	em_utils_clear_get_password_canceled_accounts_flag ();
 	mail_send_receive_dialog (FALSE);
@@ -959,7 +970,7 @@ mail_component_init (MailComponent *component)
 	component->priv = priv;
 
 	priv->lock = g_mutex_new();
-	priv->quit_state = -1;
+	priv->quit_state = MC_QUIT_NOT_START;
 
 	/* FIXME This is used as both a filename and URI path throughout
 	 *       the mail code.  Need to clean this up; maybe provide a
@@ -1100,7 +1111,9 @@ mail_component_load_store_by_uri (MailComponent *component, const char *uri, con
 }
 
 static void
-store_disconnect (CamelStore *store, void *event_data, void *user_data)
+store_disconnect (CamelStore *store,
+		  void *event_data G_GNUC_UNUSED,
+		  void *user_data G_GNUC_UNUSED)
 {
 	camel_service_disconnect (CAMEL_SERVICE (store), TRUE, NULL);
 	camel_object_unref (store);
@@ -1188,7 +1201,9 @@ mail_component_stores_foreach (MailComponent *component, GHFunc func, void *user
 }
 
 void
-mail_component_remove_folder (MailComponent *component, CamelStore *store, const char *path)
+mail_component_remove_folder (MailComponent *component,
+			      CamelStore *store G_GNUC_UNUSED,
+			      const char *path G_GNUC_UNUSED)
 {
 	MAIL_COMPONENT_DEFAULT(component);
 
@@ -1278,9 +1293,9 @@ struct _log_data {
 	char *stock_id;
 	GdkPixbuf *pbuf;
 } ldata [] = {
-	{ E_LOG_ERROR, N_("Error"), N_("Errors"), GTK_STOCK_DIALOG_ERROR },
-	{ E_LOG_WARNINGS, N_("Warning"), N_("Warnings and Errors"), GTK_STOCK_DIALOG_WARNING },
-	{ E_LOG_DEBUG, N_("Debug"), N_("Error, Warnings and Debug messages"), GTK_STOCK_DIALOG_INFO }
+	{ E_LOG_ERROR, N_("Error"), N_("Errors"), GTK_STOCK_DIALOG_ERROR, NULL },
+	{ E_LOG_WARNINGS, N_("Warning"), N_("Warnings and Errors"), GTK_STOCK_DIALOG_WARNING, NULL },
+	{ E_LOG_DEBUG, N_("Debug"), N_("Error, Warnings and Debug messages"), GTK_STOCK_DIALOG_INFO, NULL }
 };
 
 enum
@@ -1329,8 +1344,11 @@ query_tooltip_cb (GtkTreeView *view,
 }
 
 static void
-render_pixbuf (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
-	       GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
+render_pixbuf (GtkTreeViewColumn *column G_GNUC_UNUSED,
+	       GtkCellRenderer *renderer,
+	       GtkTreeModel *model,
+	       GtkTreeIter *iter,
+	       gpointer user_data G_GNUC_UNUSED)
 {
 	gint level;
 
@@ -1341,8 +1359,11 @@ render_pixbuf (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
 }
 
 static void
-render_date (GtkTreeViewColumn *column, GtkCellRenderer *renderer,
-	      GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
+render_date (GtkTreeViewColumn *column G_GNUC_UNUSED,
+	     GtkCellRenderer *renderer,
+	     GtkTreeModel *model,
+	     GtkTreeIter *iter,
+	     gpointer user_data G_GNUC_UNUSED)
 {
 	time_t t;
 	char sdt[100]; /* Should be sufficient? */
@@ -1377,7 +1398,7 @@ append_logs (const char *txt, GtkListStore *store)
 }
 
 static void
-spin_value_changed (GtkSpinButton *b, gpointer data)
+spin_value_changed (GtkSpinButton *b, gpointer data G_GNUC_UNUSED)
 {
 	int value = gtk_spin_button_get_value_as_int (b);
 	GConfClient *client = mail_config_get_gconf_client ();
diff --git a/src/mail-component.h b/src/mail-component.h
index 32a5bb8..044148e 100644
--- a/src/mail-component.h
+++ b/src/mail-component.h
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]