[evolution-exchange] More code cleanup.



commit 03ae104fa74e1cb54ef8ba42593603eb42509d8b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jun 1 23:17:42 2009 -0400

    More code cleanup.
---
 addressbook/e-book-backend-db-cache.c      |    4 +-
 addressbook/e-book-backend-exchange.c      |    4 +-
 addressbook/e-book-backend-gal.c           |   50 ++++++++++++++-------------
 calendar/e-cal-backend-exchange-calendar.c |    4 +-
 calendar/e-cal-backend-exchange-tasks.c    |   10 +++---
 calendar/e-cal-backend-exchange.c          |   12 +++---
 calendar/e-cal-backend-exchange.h          |    6 ++--
 camel/camel-exchange-folder.c              |    2 +-
 camel/camel-exchange-journal.c             |   12 +++---
 camel/camel-exchange-provider.c            |    2 +-
 camel/camel-exchange-summary.c             |   10 +++---
 camel/camel-stub-constants.h               |    2 +-
 camel/camel-stub-marshal.c                 |   24 +++++++-------
 camel/camel-stub.c                         |    8 ++--
 mail/mail-stub-exchange.c                  |    8 ++--
 mail/mail-stub-listener.h                  |    2 +-
 mail/mail-stub.c                           |    6 ++--
 mail/mail-utils.c                          |    8 ++--
 storage/exchange-autoconfig-wizard.c       |    2 +-
 storage/exchange-config-listener.c         |    4 +-
 storage/exchange-migrate.c                 |    8 ++--
 storage/migr-test.c                        |    2 +-
 22 files changed, 96 insertions(+), 94 deletions(-)

diff --git a/addressbook/e-book-backend-db-cache.c b/addressbook/e-book-backend-db-cache.c
index 2e00415..3a98329 100644
--- a/addressbook/e-book-backend-db-cache.c
+++ b/addressbook/e-book-backend-db-cache.c
@@ -120,8 +120,8 @@ e_book_backend_db_cache_get_filename(DB *db)
 void
 e_book_backend_db_cache_set_time(DB *db, const gchar *t)
 {
-	DBT uid_dbt, vcard_dbt ;
-	gint db_error ;
+	DBT uid_dbt, vcard_dbt;
+	gint db_error;
 
 	string_to_dbt ("last_update_time", &uid_dbt);
 	string_to_dbt (t, &vcard_dbt);
diff --git a/addressbook/e-book-backend-exchange.c b/addressbook/e-book-backend-exchange.c
index 6cb4cdb..f43ecfd 100644
--- a/addressbook/e-book-backend-exchange.c
+++ b/addressbook/e-book-backend-exchange.c
@@ -71,7 +71,7 @@ static EBookBackendClass *parent_class;
 
 struct EBookBackendExchangePrivate {
 	gchar     *exchange_uri;
-	char	 *original_uri;
+	gchar	 *original_uri;
 	EFolder  *folder;
 
 	E2kRestriction *base_rn;
@@ -1197,7 +1197,7 @@ populate_address (EContactField field, EContact *new_contact, gpointer data)
 	EContactAddress addr;
 
 	waddr = e_address_western_parse ((const gchar *)data);
-	addr.address_format = "us"; /* FIXME? */
+	addr.address_format = (gchar *) "us"; /* FIXME? */
 	addr.po = waddr->po_box;
 	addr.ext = waddr->extended;
 	addr.street = waddr->street;
diff --git a/addressbook/e-book-backend-gal.c b/addressbook/e-book-backend-gal.c
index e5e4a84..d14ec2c 100644
--- a/addressbook/e-book-backend-gal.c
+++ b/addressbook/e-book-backend-gal.c
@@ -73,7 +73,7 @@
 
 #define TV_TO_MILLIS(timeval) ((timeval).tv_sec * 1000 + (timeval).tv_usec / 1000)
 
-static gchar *query_prop_to_ldap (const gchar *query_prop);
+static const gchar *query_prop_to_ldap (const gchar *query_prop);
 static gint build_query (EBookBackendGAL *bl, const gchar *query, const gchar *ldap_filter, gchar **ldap_query);
 
 #define PARENT_TYPE E_TYPE_BOOK_BACKEND
@@ -82,7 +82,7 @@ static EBookBackendClass *parent_class;
 typedef struct LDAPOp LDAPOp;
 
 static GList *supported_fields;
-static gchar **search_attrs;
+static const gchar **search_attrs;
 
 struct _EBookBackendGALPrivate {
 	gchar             *gal_uri;
@@ -412,7 +412,7 @@ ldap_op_finished (LDAPOp *op)
 	g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
 }
 
-static int
+static gint
 ldap_error_to_response (gint ldap_error)
 {
 	if (ldap_error == LDAP_SUCCESS)
@@ -602,7 +602,7 @@ get_contact (EBookBackend *backend,
 		d(printf("Mode:Remote\n"));
 		if (bl->priv->marked_for_offline && bl->priv->file_db) {
 			EContact *contact = e_book_backend_db_cache_get_contact (bl->priv->file_db, id);
-			gchar *vcard_str ;
+			gchar *vcard_str;
 			if (!contact) {
 				e_data_book_respond_get_contact (book, opid, GNOME_Evolution_Addressbook_OtherError, "");
 				return;
@@ -616,7 +616,7 @@ get_contact (EBookBackend *backend,
 							 vcard_str);
 			g_free (vcard_str);
 			g_object_unref (contact);
-			return ;
+			return;
 		}
 		else {
 #endif
@@ -637,7 +637,7 @@ get_contact (EBookBackend *backend,
 				ldap_error = ldap_search_ext (bl->priv->ldap, id,
 							      LDAP_SCOPE_BASE,
 							      "(objectclass=*)",
-							      search_attrs, 0, NULL, NULL,
+							      (gchar **) search_attrs, 0, NULL, NULL,
 							      NULL, /* XXX timeout */
 							      1, &get_contact_msgid);
 				g_mutex_unlock (bl->priv->ldap_lock);
@@ -815,7 +815,7 @@ get_contact_list (EBookBackend *backend,
 
 			contacts = e_book_backend_db_cache_get_contacts (bl->priv->file_db, query);
 
-			for (l = contacts; l ;l = g_list_next (l)) {
+			for (l = contacts; l;l = g_list_next (l)) {
 				EContact *contact = l->data;
 				vcard_strings = g_list_prepend (vcard_strings, e_vcard_to_string (E_VCARD (contact),
 								EVC_FORMAT_VCARD_30));
@@ -824,7 +824,7 @@ get_contact_list (EBookBackend *backend,
 
 			g_list_free (contacts);
 			e_data_book_respond_get_contact_list (book, opid, GNOME_Evolution_Addressbook_Success, vcard_strings);
-			return ;
+			return;
 		}
 		else {
 #endif
@@ -852,7 +852,7 @@ get_contact_list (EBookBackend *backend,
 				ldap_error = ldap_search_ext (bl->priv->ldap, LDAP_ROOT_DSE,
 							      LDAP_SCOPE_SUBTREE,
 							      ldap_query,
-							      search_attrs, 0, NULL, NULL,
+							      (gchar **) search_attrs, 0, NULL, NULL,
 							      NULL, /* XXX timeout */
 							      LDAP_NO_LIMIT, &contact_list_msgid);
 				g_mutex_unlock (bl->priv->ldap_lock);
@@ -1001,7 +1001,7 @@ func_not(ESExp *f, gint argc, ESExpResult **argv, gpointer data)
 	return r;
 }
 
-static gchar *
+static const gchar *
 query_prop_to_ldap (const gchar *query_prop)
 {
 	gint i;
@@ -1021,7 +1021,8 @@ static ESExpResult *
 func_contains(ESExp *f, gint argc, ESExpResult **argv, gpointer data)
 {
 	ESExpResult *r;
-	gchar *propname, *ldap_attr, *str;
+	const gchar *ldap_attr;
+	gchar *propname, *str;
 
 	if (argc != 2 ||
 	    argv[0]->type != ESEXP_RES_STRING ||
@@ -1078,7 +1079,8 @@ func_is_or_begins_with(ESExp *f, gint argc, ESExpResult **argv, gboolean exact)
 {
 	ESExpResult *r;
 	const gchar *star;
-	gchar *propname, *str, *ldap_attr, *filter;
+	const gchar *ldap_attr;
+	gchar *propname, *str, *filter;
 
 	if (argc != 2
 	    || argv[0]->type != ESEXP_RES_STRING
@@ -1183,7 +1185,7 @@ static struct {
 	{ "endswith", func_endswith },
 };
 
-static int
+static gint
 build_query (EBookBackendGAL *bl, const gchar *query, const gchar *ldap_filter, gchar **ldap_query)
 {
 	ESExp *sexp;
@@ -1528,7 +1530,7 @@ build_contact_from_entry (EBookBackendGAL *bl, LDAPMessage *e, GList **existing_
 								if (ldap_error != LDAP_SUCCESS) {
 									book_view_notify_status (book_view,
 											ldap_err2string(ldap_error));
-									continue ;
+									continue;
 								}
 							}
 							/* call populate function */
@@ -1823,7 +1825,7 @@ start_book_view (EBookBackend  *backend,
 
 			contacts = e_book_backend_db_cache_get_contacts (bl->priv->file_db,
 									 e_data_book_view_get_card_query (view));
-			for (l = contacts; l ;l = g_list_next (l)) {
+			for (l = contacts; l;l = g_list_next (l)) {
 				EContact *contact = l->data;
 				e_data_book_view_notify_update (view, contact);
 				g_object_unref (contact);
@@ -1832,7 +1834,7 @@ start_book_view (EBookBackend  *backend,
 			g_list_free (contacts);
 
 			e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_Success);
-			return ;
+			return;
 		}
 		else {
 #endif
@@ -1894,7 +1896,7 @@ start_book_view (EBookBackend  *backend,
 					ldap_err = ldap_search_ext (bl->priv->ldap, LDAP_ROOT_DSE,
 								    LDAP_SCOPE_SUBTREE,
 								    ldap_query,
-								    search_attrs, 0,
+								    (gchar **) search_attrs, 0,
 								    NULL, /* XXX */
 								    NULL, /* XXX */
 								    NULL, /* XXX timeout */
@@ -2033,7 +2035,7 @@ ber_dupbv( struct berval *dst, struct berval *src )
 }
 #endif
 
-static int
+static gint
 parse_page_control(
 	LDAP *ld,
 	LDAPMessage *result,
@@ -2119,7 +2121,7 @@ static gint dosearch(
 	const gchar *changed_filter,
 	gint sizelimit )
 {
-	int			rc;
+	gint			rc;
 	LDAPMessage		*res, *msg;
 	ber_int_t		msgid;
 	static gint count = 0;
@@ -2210,7 +2212,7 @@ generate_cache (EBookBackendGAL *book_backend_gal, const gchar * changed_filter)
 	LDAPGetContactListOp *contact_list_op = g_new0 (LDAPGetContactListOp, 1);
 	EBookBackendGALPrivate *priv;
 	gchar *ldap_query;
-	gint  i = 0, rc ;
+	gint  i = 0, rc;
 	BerElement *prber = NULL;
 	gchar t[15], *cachetime;
 	LDAPControl c[6];
@@ -2243,7 +2245,7 @@ getNextPage:
 			return;
 		}
 		d(printf ("Setting parameters		\n"));
-		c[i].ldctl_oid = LDAP_CONTROL_PAGEDRESULTS;
+		c[i].ldctl_oid = (gchar *) LDAP_CONTROL_PAGEDRESULTS;
 		c[i].ldctl_iscritical = pagedResults > 1;
 		i++;
 	}
@@ -2278,7 +2280,7 @@ getNextPage:
 	e_book_backend_db_cache_set_populated (priv->file_db);
 	if (priv->cache_time != priv->last_best_time)
 		priv->last_best_time++;
-	g_sprintf (t," %d", (int)priv->last_best_time);
+	g_sprintf (t," %d", (gint)priv->last_best_time);
 	printf("All done, cached time set to %d, %s(%d)\n", (gint) priv->last_best_time, ctime (&priv->last_best_time), (gint) priv->cache_time);
 	e_book_backend_db_cache_set_time (priv->file_db, t);
 	priv->is_summary_ready = TRUE;
@@ -2413,7 +2415,7 @@ authenticate_user (EBookBackend *backend,
 }
 
 #ifdef SUNLDAP
-static int
+static gint
 ber_flatten2( BerElement *ber, struct berval *bv, gint alloc )
 {
 	struct berval *tmp;
@@ -2878,7 +2880,7 @@ class_init (EBookBackendGALClass *klass)
 	}
 	supported_fields = g_list_append (supported_fields, (gpointer) "file_as");
 
-	search_attrs = g_new (gchar *, num_prop_infos + 1);
+	search_attrs = g_new (const gchar *, num_prop_infos + 1);
 	for (i = 0; i < num_prop_infos; i++)
 		search_attrs[i] = prop_info[i].ldap_attr;
 	search_attrs[num_prop_infos] = NULL;
diff --git a/calendar/e-cal-backend-exchange-calendar.c b/calendar/e-cal-backend-exchange-calendar.c
index dad79a6..a783939 100644
--- a/calendar/e-cal-backend-exchange-calendar.c
+++ b/calendar/e-cal-backend-exchange-calendar.c
@@ -791,7 +791,7 @@ create_object (ECalBackendSync *backend, EDataCal *cal,
 	if (lookup_component (E_CAL_BACKEND_EXCHANGE (cbexc), comp_uid))
 	{
 		icalcomponent_free (icalcomp);
-		return ;
+		return;
 	}
 	#endif
 
@@ -2104,7 +2104,7 @@ send_objects (ECalBackendSync *backend, EDataCal *cal,
 		result = book_resource (cbex, cal, attendee + 7, comp, method, param);
 		switch (result) {
 		case E_CAL_BACKEND_EXCHANGE_BOOKING_OK:
-			*users = g_list_append (*users, g_strdup (attendee)) ;
+			*users = g_list_append (*users, g_strdup (attendee));
 			break;
 
 		case E_CAL_BACKEND_EXCHANGE_BOOKING_BUSY:
diff --git a/calendar/e-cal-backend-exchange-tasks.c b/calendar/e-cal-backend-exchange-tasks.c
index adeb0cc..4e9be00 100644
--- a/calendar/e-cal-backend-exchange-tasks.c
+++ b/calendar/e-cal-backend-exchange-tasks.c
@@ -322,11 +322,11 @@ static void
 set_percent (E2kProperties *props, ECalComponent *comp)
 {
         gint *percent;
-        float res;
+        gfloat res;
 
 	e_cal_component_get_percent (E_CAL_COMPONENT (comp), &percent);
         if (percent) {
-                res = (float) *percent / 100.0;
+                res = (gfloat) *percent / 100.0;
                 e_cal_component_free_percent (percent);
         } else
                 res = 0.;
@@ -436,7 +436,7 @@ get_summary (ECalComponent *comp)
 	return summary.value;
 }
 
-static int
+static gint
 put_body (ECalComponent *comp, E2kContext *ctx, E2kOperation *op,
          const gchar *uri, const gchar *from_name, const gchar *from_addr,
 	 const gchar *attach_body, const gchar *boundary,
@@ -576,7 +576,7 @@ get_changed_tasks (ECalBackendExchange *cbex)
 	gchar *uid;
 	const gchar *tzid;
 	gint status, i, priority, percent;
-	float f_percent;
+	gfloat f_percent;
 	ECalComponent *ecal, *ecomp;
 	struct icaltimetype itt;
 	const icaltimezone *itzone;
@@ -752,7 +752,7 @@ get_changed_tasks (ECalBackendExchange *cbex)
 				E2K_PR_OUTLOOK_TASK_PERCENT))) {
 
 			f_percent = atof (str);
-			percent = (int) (f_percent * 100);
+			percent = (gint) (f_percent * 100);
 			e_cal_component_set_percent (ecal, &percent);
 		}
 
diff --git a/calendar/e-cal-backend-exchange.c b/calendar/e-cal-backend-exchange.c
index eeea39d..6aea2da 100644
--- a/calendar/e-cal-backend-exchange.c
+++ b/calendar/e-cal-backend-exchange.c
@@ -295,7 +295,7 @@ timeout_save_cache (gpointer user_data)
 	ECalBackendExchange *cbex = user_data;
 	icalcomponent *vcalcomp;
 	gchar *data = NULL, *tmpfile;
-	size_t len, nwrote;
+	gsize len, nwrote;
 	FILE *f;
 
 	d(printf("timeout_save_cache\n"));
@@ -634,8 +634,8 @@ gboolean
 e_cal_backend_exchange_in_cache (ECalBackendExchange *cbex,
 				 const gchar          *uid,
 				 const gchar          *lastmod,
-				 const char	     *href,
-				 const char	     *rid
+				 const gchar	     *href,
+				 const gchar	     *rid
 				 )
 {
 	ECalBackendExchangeComponent *ecomp;
@@ -976,7 +976,7 @@ get_object (ECalBackendSync *backend, EDataCal *cal,
 		struct icaltimetype inst_rid, key_rid;
 		gboolean inst_found = FALSE;
 
-		for (l = ecomp->instances; l ; l = l->next) {
+		for (l = ecomp->instances; l; l = l->next) {
 			key_rid = icaltime_from_string (rid);
 			inst_rid = icalcomponent_get_recurrenceid (l->data);
 			if (icaltime_compare (inst_rid, key_rid) == 0) {
@@ -1751,7 +1751,7 @@ get_attachment (ECalBackendExchange *cbex, const gchar *uid,
 	if (msg_content && CAMEL_IS_MULTIPART (msg_content)) {
 		multipart = (CamelMultipart *)msg_content;
 
-		for (i = 0; i < (int)camel_multipart_get_number (multipart); i++) {
+		for (i = 0; i < (gint)camel_multipart_get_number (multipart); i++) {
 			part = camel_multipart_get_part (multipart, i);
 			filename = camel_mime_part_get_filename (part);
 			if (filename) {
@@ -1938,7 +1938,7 @@ build_msg ( ECalBackendExchange *cbex, ECalComponent *comp, const gchar *subject
 
 	e_cal_component_get_uid (comp, &uid);
 	e_cal_component_get_attachment_list (comp, &attach_list);
-	for (l = attach_list; l ; l = l->next){
+	for (l = attach_list; l; l = l->next){
 		gchar *mime_type;
 
 		if (!strncmp ((gchar *)l->data, "file://", 7)) {
diff --git a/calendar/e-cal-backend-exchange.h b/calendar/e-cal-backend-exchange.h
index f36e5a0..7862135 100644
--- a/calendar/e-cal-backend-exchange.h
+++ b/calendar/e-cal-backend-exchange.h
@@ -54,8 +54,8 @@ void      e_cal_backend_exchange_cache_sync_start (ECalBackendExchange *cbex);
 gboolean  e_cal_backend_exchange_in_cache         (ECalBackendExchange *cbex,
 						   const gchar          *uid,
 						   const gchar          *lastmod,
-						   const char	       *href,
-						   const char	       *rid
+						   const gchar	       *href,
+						   const gchar	       *rid
 						   );
 
 void      e_cal_backend_exchange_cache_sync_end   (ECalBackendExchange *cbex);
@@ -111,7 +111,7 @@ gchar * build_msg ( ECalBackendExchange *cbex, ECalComponent *comp, const gchar
 gchar *e_cal_backend_exchange_get_owner_email (ECalBackendSync *backend);
 gchar *e_cal_backend_exchange_get_owner_name (ECalBackendSync *backend);
 void e_cal_backend_exchange_cache_lock (ECalBackendExchange *cbex);
-void e_cal_backend_exchange_cache_unlock (ECalBackendExchange *cbex) ;
+void e_cal_backend_exchange_cache_unlock (ECalBackendExchange *cbex);
 void e_cal_backend_exchange_ensure_utc_zone (ECalBackend *cb, struct icaltimetype *itt);
 
 G_END_DECLS
diff --git a/camel/camel-exchange-folder.c b/camel/camel-exchange-folder.c
index 2fbd957..fc46937 100644
--- a/camel/camel-exchange-folder.c
+++ b/camel/camel-exchange-folder.c
@@ -91,7 +91,7 @@ static gint cmp_uids (CamelFolder *folder, const gchar *uid1, const gchar *uid2)
 static void
 class_init (CamelFolderClass *camel_folder_class)
 {
-	parent_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ())) ;
+	parent_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ()));
 
 	/* virtual method definition */
 	camel_folder_class->expunge = exchange_expunge;
diff --git a/camel/camel-exchange-journal.c b/camel/camel-exchange-journal.c
index 06b31bb..f05d7e3 100644
--- a/camel/camel-exchange-journal.c
+++ b/camel/camel-exchange-journal.c
@@ -176,7 +176,7 @@ exchange_entry_load (CamelOfflineJournal *journal, FILE *in)
 	return NULL;
 }
 
-static int
+static gint
 exchange_entry_write (CamelOfflineJournal *journal, CamelDListNode *entry, FILE *out)
 {
 	CamelExchangeJournalEntry *exchange_entry = (CamelExchangeJournalEntry *) entry;
@@ -233,7 +233,7 @@ exchange_message_info_dup_to (CamelMessageInfoBase *dest, CamelMessageInfoBase *
 	dest->size = src->size;
 }
 
-static int
+static gint
 exchange_entry_play_delete (CamelOfflineJournal *journal, CamelExchangeJournalEntry *entry, CamelException *ex)
 {
 	CamelExchangeFolder *exchange_folder = (CamelExchangeFolder *) journal->folder;
@@ -253,7 +253,7 @@ exchange_entry_play_delete (CamelOfflineJournal *journal, CamelExchangeJournalEn
 	return 0;
 }
 
-static int
+static gint
 exchange_entry_play_append (CamelOfflineJournal *journal, CamelExchangeJournalEntry *entry, CamelException *ex)
 {
 	CamelExchangeFolder *exchange_folder = (CamelExchangeFolder *) journal->folder;
@@ -309,7 +309,7 @@ exchange_entry_play_append (CamelOfflineJournal *journal, CamelExchangeJournalEn
 	return 0;
 }
 
-static int
+static gint
 exchange_entry_play_transfer (CamelOfflineJournal *journal, CamelExchangeJournalEntry *entry, CamelException *ex)
 {
 	CamelExchangeFolder *exchange_folder = (CamelExchangeFolder *) journal->folder;
@@ -390,7 +390,7 @@ exception:
 	return -1;
 }
 
-static int
+static gint
 exchange_entry_play (CamelOfflineJournal *journal, CamelDListNode *entry, CamelException *ex)
 {
 	CamelExchangeJournalEntry *exchange_entry = (CamelExchangeJournalEntry *) entry;
@@ -501,7 +501,7 @@ camel_exchange_journal_append (CamelExchangeJournal *exchange_journal, CamelMime
 
 }
 
-static int
+static gint
 find_real_source_for_message (CamelExchangeFolder *folder,
 			      const gchar **folder_name,
 			      const gchar **uid,
diff --git a/camel/camel-exchange-provider.c b/camel/camel-exchange-provider.c
index 27537c9..2b3f6e0 100644
--- a/camel/camel-exchange-provider.c
+++ b/camel/camel-exchange-provider.c
@@ -147,7 +147,7 @@ CamelServiceAuthType camel_exchange_password_authtype = {
 	TRUE
 };
 
-static int
+static gint
 exchange_auto_detect_cb (CamelURL *url, GHashTable **auto_detected,
 			 CamelException *ex)
 {
diff --git a/camel/camel-exchange-summary.c b/camel/camel-exchange-summary.c
index 5b143a4..60b24ec 100644
--- a/camel/camel-exchange-summary.c
+++ b/camel/camel-exchange-summary.c
@@ -152,7 +152,7 @@ camel_exchange_summary_new (struct _CamelFolder *folder, const gchar *filename)
 	return summary;
 }
 
-static int
+static gint
 summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
 {
 	CamelExchangeSummary *exchange = (CamelExchangeSummary *) s;
@@ -178,7 +178,7 @@ summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *mir)
 	return 0;
 }
 
-static int
+static gint
 header_load (CamelFolderSummary *summary, FILE *in)
 {
 	CamelExchangeSummary *exchange = (CamelExchangeSummary *) summary;
@@ -228,7 +228,7 @@ summary_header_to_db (CamelFolderSummary *s, CamelException *ex)
 	return fir;
 }
 
-static int
+static gint
 header_save (CamelFolderSummary *summary, FILE *out)
 {
 	CamelExchangeSummary *exchange = (CamelExchangeSummary *) summary;
@@ -312,12 +312,12 @@ message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 
 	mir = CAMEL_FOLDER_SUMMARY_CLASS(parent_class)->message_info_to_db (s, info);
 	if (mir)
-		mir->bdata = g_strdup_printf ("%d-%s %d-%s", einfo->thread_index ? (int)strlen(einfo->thread_index):0 , einfo->thread_index ? einfo->thread_index : "", einfo->href ? (int)strlen(einfo->href):0, einfo->href ? einfo->href:"");
+		mir->bdata = g_strdup_printf ("%d-%s %d-%s", einfo->thread_index ? (gint)strlen(einfo->thread_index):0 , einfo->thread_index ? einfo->thread_index : "", einfo->href ? (gint)strlen(einfo->href):0, einfo->href ? einfo->href:"");
 
 	return mir;
 }
 
-static int
+static gint
 message_info_save (CamelFolderSummary *summary, FILE *out, CamelMessageInfo *info)
 {
 	CamelExchangeMessageInfo *einfo = (CamelExchangeMessageInfo *)info;
diff --git a/camel/camel-stub-constants.h b/camel/camel-stub-constants.h
index a210e92..40ca41f 100644
--- a/camel/camel-stub-constants.h
+++ b/camel/camel-stub-constants.h
@@ -93,7 +93,7 @@ typedef enum {
 	CAMEL_STUB_STORE_FOLDER_INFO_SUBSCRIBED	= (1<<2),
 	CAMEL_STUB_STORE_FOLDER_INFO_NO_VIRTUAL	= (1<<3),
 	CAMEL_STUB_STORE_FOLDER_INFO_SUBSCRIPTION_LIST	= (1<<4)
-} CamelStubStoreFlags ;
+} CamelStubStoreFlags;
 
 #ifdef __cplusplus
 }
diff --git a/camel/camel-stub-marshal.c b/camel/camel-stub-marshal.c
index b624c05..d28625c 100644
--- a/camel/camel-stub-marshal.c
+++ b/camel/camel-stub-marshal.c
@@ -98,10 +98,10 @@ camel_stub_marshal_free (CamelStubMarshal *marshal)
 }
 
 static gboolean
-do_read (CamelStubMarshal *marshal, gchar *buf, size_t len)
+do_read (CamelStubMarshal *marshal, gchar *buf, gsize len)
 {
-	size_t nread = 0;
-	ssize_t n;
+	gsize nread = 0;
+	gssize n;
 
 	do {
 		if ((n = camel_read_socket (marshal->fd, buf + nread, len - nread)) <= 0) {
@@ -122,7 +122,7 @@ do_read (CamelStubMarshal *marshal, gchar *buf, size_t len)
 	return TRUE;
 }
 
-static int
+static gint
 marshal_read (CamelStubMarshal *marshal, gchar *buf, gint len)
 {
 	gint avail = marshal->in->len - (marshal->inptr - (gchar *)marshal->in->data);
@@ -133,10 +133,10 @@ marshal_read (CamelStubMarshal *marshal, gchar *buf, gint len)
 		marshal->inptr = (gchar *)marshal->in->data + 4;
 		if (!do_read (marshal, (gchar *)marshal->in->data, 4))
 			return -1;
-		avail =  (int)marshal->in->data[0]        +
-			((int)marshal->in->data[1] <<  8) +
-			((int)marshal->in->data[2] << 16) +
-			((int)marshal->in->data[3] << 24) - 4;
+		avail =  (gint)marshal->in->data[0]        +
+			((gint)marshal->in->data[1] <<  8) +
+			((gint)marshal->in->data[2] << 16) +
+			((gint)marshal->in->data[3] << 24) - 4;
 		g_byte_array_set_size (marshal->in, avail + 4);
 		marshal->inptr = (gchar *)marshal->in->data + 4;
 		if (!do_read (marshal, ((gchar *)marshal->in->data) + 4, avail)) {
@@ -161,13 +161,13 @@ marshal_read (CamelStubMarshal *marshal, gchar *buf, gint len)
 	return nread;
 }
 
-static int
+static gint
 marshal_getc (CamelStubMarshal *marshal)
 {
 	gchar buf;
 
 	if (marshal_read (marshal, &buf, 1) == 1)
-		return (unsigned char)buf;
+		return (guchar)buf;
 	return -1;
 }
 
@@ -187,7 +187,7 @@ encode_uint32 (CamelStubMarshal *marshal, guint32 value)
 	g_byte_array_append (marshal->out, &c, 1);
 }
 
-static int
+static gint
 decode_uint32 (CamelStubMarshal *marshal, guint32 *dest)
 {
         guint32 value = 0;
@@ -222,7 +222,7 @@ encode_string (CamelStubMarshal *marshal, const gchar *str)
 	g_byte_array_append (marshal->out, (guint8 *) str, len);
 }
 
-static int
+static gint
 decode_string (CamelStubMarshal *marshal, gchar **str)
 {
 	guint32 len;
diff --git a/camel/camel-stub.c b/camel/camel-stub.c
index a9eaf0d..c24ad24 100644
--- a/camel/camel-stub.c
+++ b/camel/camel-stub.c
@@ -153,7 +153,7 @@ status_main (gpointer data)
 
 #ifndef G_OS_WIN32
 
-static int
+static gint
 connect_to_storage (CamelStub *stub, struct sockaddr_un *sa_un,
 		    CamelException *ex)
 {
@@ -196,7 +196,7 @@ connect_to_storage (CamelStub *stub, struct sockaddr_un *sa_un,
 
 #else
 
-static int
+static gint
 connect_to_storage (CamelStub *stub, const gchar *socket_path,
 		    CamelException *ex)
 {
@@ -343,7 +343,7 @@ stub_send_internal (CamelStub *stub, CamelException *ex, gboolean oneway,
 	g_mutex_lock (stub->write_lock);
 	camel_stub_marshal_encode_uint32 (stub->cmd, command);
 	while (1) {
-		argtype = va_arg (ap, int);
+		argtype = va_arg (ap, gint);
 		switch (argtype) {
 		case CAMEL_STUB_ARG_RETURN:
 		case CAMEL_STUB_ARG_END:
@@ -457,7 +457,7 @@ stub_send_internal (CamelStub *stub, CamelException *ex, gboolean oneway,
 				goto comm_fail;
 
 			do {
-				argtype = va_arg (ap, int);
+				argtype = va_arg (ap, gint);
 				switch (argtype) {
 				case CAMEL_STUB_ARG_END:
 					goto done_output;
diff --git a/mail/mail-stub-exchange.c b/mail/mail-stub-exchange.c
index f705078..bcd0cfe 100644
--- a/mail/mail-stub-exchange.c
+++ b/mail/mail-stub-exchange.c
@@ -303,7 +303,7 @@ folder_changed (MailStubExchangeFolder *mfld)
 	e_folder_set_unread_count (mfld->folder, mfld->unread_count);
 }
 
-static int
+static gint
 find_message_index (MailStubExchangeFolder *mfld, gint seq)
 {
 	MailStubExchangeMessage *mmsg;
@@ -1229,7 +1229,7 @@ struct refresh_message {
 	guint32 flags, size, article_num;
 };
 
-static int
+static gint
 refresh_message_compar (gconstpointer a, gconstpointer b)
 {
 	const struct refresh_message *rma = a, *rmb = b;
@@ -2817,8 +2817,8 @@ get_folder_info_data (MailStub *stub, const gchar *top, guint32 store_flags,
 
 	*names = g_ptr_array_new ();
 	*uris = g_ptr_array_new ();
-	*unread = g_array_new (FALSE, FALSE, sizeof (int));
-	*flags = g_array_new (FALSE, FALSE, sizeof (int));
+	*unread = g_array_new (FALSE, FALSE, sizeof (gint));
+	*flags = g_array_new (FALSE, FALSE, sizeof (gint));
 	/* Can be NULL if started in offline mode */
 	if (mse->inbox) {
 		inbox_uri = e_folder_get_physical_uri (mse->inbox);
diff --git a/mail/mail-stub-listener.h b/mail/mail-stub-listener.h
index 7054b3b..203d9c4 100644
--- a/mail/mail-stub-listener.h
+++ b/mail/mail-stub-listener.h
@@ -34,7 +34,7 @@ struct _MailStubListenerClass {
 	GObjectClass parent_class;
 
 	/* signals */
-	void (*new_connection) (MailStubListener *, int, int);
+	void (*new_connection) (MailStubListener *, int, gint);
 };
 
 GType             mail_stub_listener_get_type      (void);
diff --git a/mail/mail-stub.c b/mail/mail-stub.c
index d4fb712..e03dedf 100644
--- a/mail/mail-stub.c
+++ b/mail/mail-stub.c
@@ -499,7 +499,7 @@ mail_stub_read_args (MailStub *stub, ...)
 	va_start (ap, stub);
 
 	do {
-		argtype = va_arg (ap, int);
+		argtype = va_arg (ap, gint);
 		switch (argtype) {
 		case CAMEL_STUB_ARG_END:
 			return TRUE;
@@ -623,7 +623,7 @@ mail_stub_return_data (MailStub *stub, CamelStubRetval retval, ...)
 	va_start (ap, retval);
 
 	while (1) {
-		argtype = va_arg (ap, int);
+		argtype = va_arg (ap, gint);
 		switch (argtype) {
 		case CAMEL_STUB_ARG_END:
 			return;
@@ -655,7 +655,7 @@ mail_stub_return_data (MailStub *stub, CamelStubRetval retval, ...)
 		case CAMEL_STUB_ARG_BYTEARRAY:
 		{
 			gchar *data = va_arg (ap, gchar *);
-			gint len = va_arg (ap, int);
+			gint len = va_arg (ap, gint);
 			GByteArray ba;
 
 			ba.data = (guint8 *) data;
diff --git a/mail/mail-utils.c b/mail/mail-utils.c
index 64453c3..edd307b 100644
--- a/mail/mail-utils.c
+++ b/mail/mail-utils.c
@@ -207,11 +207,11 @@ mail_util_extract_transport_headers (E2kProperties *props)
 		ctend = strchr (ctstart, '\n');
 
 		headers = g_strdup_printf ("%.*s\nContent-Type: text/plain; charset=\"UTF-8\"%.*s\n\n",
-					   (int) (ctstart - hstart), hstart,
-					   (int) (hend - ctend), ctend);
+					   (gint) (ctstart - hstart), hstart,
+					   (gint) (hend - ctend), ctend);
 	} else {
 		headers = g_strdup_printf ("%.*s\nContent-Type: text/plain; charset=\"UTF-8\"\n\n\n",
-					   (int) (hend - hstart), hstart);
+					   (gint) (hend - hstart), hstart);
 	}
 
 	return headers;
@@ -332,7 +332,7 @@ mail_util_demangle_meeting_related_message (GString *body,
 	if (!vend)
 		return FALSE;
 	vend += 13;
-	while (isspace ((unsigned char)*vend))
+	while (isspace ((guchar)*vend))
 		vend++;
 	oldlen = vend - vstart;
 
diff --git a/storage/exchange-autoconfig-wizard.c b/storage/exchange-autoconfig-wizard.c
index 96c4ea2..6f4e474 100644
--- a/storage/exchange-autoconfig-wizard.c
+++ b/storage/exchange-autoconfig-wizard.c
@@ -545,7 +545,7 @@ static const gint num_autoconfig_pages = sizeof (autoconfig_pages) / sizeof (aut
 
 /* Autoconfig druid */
 
-static int
+static gint
 find_page (ExchangeAutoconfigGUI *gui, gpointer page)
 {
 	gint page_num;
diff --git a/storage/exchange-config-listener.c b/storage/exchange-config-listener.c
index ff42e31..584b565 100644
--- a/storage/exchange-config-listener.c
+++ b/storage/exchange-config-listener.c
@@ -328,7 +328,7 @@ migrate_account_esource (EAccount *account,
 	groups = e_source_list_peek_groups (source_list);
 	found_group = FALSE;
 
-	for ( ; groups != NULL && !found_group; groups = g_slist_next (groups)) {
+	for (; groups != NULL && !found_group; groups = g_slist_next (groups)) {
 		group = E_SOURCE_GROUP (groups->data);
 
 		if (strcmp (e_source_group_peek_name (group), account->name) == 0
@@ -337,7 +337,7 @@ migrate_account_esource (EAccount *account,
 			sources = e_source_group_peek_sources (group);
 
 			found_group = TRUE;
-			for( ; sources != NULL; sources = g_slist_next (sources)) {
+			for(; sources != NULL; sources = g_slist_next (sources)) {
 				source = E_SOURCE (sources->data);
 
 				ex_set_relative_uri (source, url_string + strlen ("exchange://"));
diff --git a/storage/exchange-migrate.c b/storage/exchange-migrate.c
index 4bb8973..d8fe505 100644
--- a/storage/exchange-migrate.c
+++ b/storage/exchange-migrate.c
@@ -144,7 +144,7 @@ dialog_set_progress (double percent)
 {
 	gchar text[5];
 
-	snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f));
+	snprintf (text, sizeof (text), "%d%%", (gint) (percent * 100.0f));
 
 	gtk_progress_bar_set_fraction (progress, percent);
 	gtk_progress_bar_set_text (progress, text);
@@ -157,9 +157,9 @@ static gboolean
 cp (const gchar *src, const gchar *dest, gboolean show_progress)
 {
 	guchar readbuf[65536];
-	ssize_t nread, nwritten;
+	gssize nread, nwritten;
 	gint errnosav, readfd, writefd;
-	size_t total = 0;
+	gsize total = 0;
 	struct stat st;
 	struct utimbuf ut;
 
@@ -240,7 +240,7 @@ cp_r (gchar *src, const gchar *dest)
 {
 	GString *srcpath, *destpath;
 	struct dirent *dent;
-	size_t slen, dlen;
+	gsize slen, dlen;
 	struct stat st;
 	DIR *dir;
 
diff --git a/storage/migr-test.c b/storage/migr-test.c
index b18222f..1cf2c03 100644
--- a/storage/migr-test.c
+++ b/storage/migr-test.c
@@ -98,7 +98,7 @@ main (gint argc, gchar **argv)
 
 	/* destination path */
 	base_dir = g_build_filename (dest, uid, NULL);
-	printf("base dir is %s; uid = %s; dest = %s ; source=%s \n", base_dir, uid, dest, source);
+	printf("base dir is %s; uid = %s; dest = %s; source=%s \n", base_dir, uid, dest, source);
 
 	exchange_migrate (major, minor, revision, base_dir, (gchar *) uid);
 



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