[evolution-data-server] Coding style cleanups.



commit 7e186ad4f90aa57503d8b241b68a087f88723b10
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun May 8 12:45:23 2011 -0400

    Coding style cleanups.

 addressbook/backends/file/e-book-backend-file.c    |   10 +-
 .../backends/google/e-book-backend-google.c        |    4 +-
 addressbook/backends/ldap/e-book-backend-ldap.c    |  102 +++++-----
 addressbook/backends/ldap/openldap-extract.h       |    4 +-
 addressbook/backends/vcf/e-book-backend-vcf.c      |    8 +-
 .../backends/webdav/e-book-backend-webdav.c        |    2 +-
 addressbook/libebook/e-address-western.c           |    4 +-
 addressbook/libebook/e-book-query.c                |    6 +-
 addressbook/libebook/e-book-view.c                 |    4 +-
 addressbook/libebook/e-contact.c                   |   30 ++--
 addressbook/libebook/e-destination.c               |   34 ++--
 addressbook/libebook/e-vcard.c                     |   30 ++--
 .../libedata-book/e-book-backend-db-cache.c        |    8 +-
 addressbook/libedata-book/e-book-backend-sexp.c    |   24 ++--
 addressbook/libedata-book/e-book-backend-summary.c |   10 +-
 addressbook/libedata-book/e-book-backend-sync.c    |    6 +-
 addressbook/libedata-book/e-book-backend.c         |    4 +-
 addressbook/libedata-book/e-data-book.c            |    2 +-
 calendar/backends/caldav/e-cal-backend-caldav.c    |   44 ++--
 .../backends/contacts/e-cal-backend-contacts.c     |   12 +-
 calendar/backends/file/e-cal-backend-file.c        |   26 ++--
 calendar/backends/http/e-cal-backend-http.c        |    2 +-
 calendar/backends/weather/e-cal-backend-weather.c  |    4 +-
 calendar/backends/weather/e-weather-source-ccf.c   |    2 +-
 calendar/libecal/e-cal-check-timezones.c           |    6 +-
 calendar/libecal/e-cal-component.c                 |    6 +-
 calendar/libecal/e-cal-view.c                      |    2 +-
 calendar/libecal/e-cal.c                           |    4 +-
 calendar/libedata-cal/e-cal-backend-cache.c        |    8 +-
 calendar/libedata-cal/e-cal-backend-sexp.c         |    2 +-
 calendar/libedata-cal/e-data-cal-view.c            |    8 +-
 calendar/libedata-cal/e-data-cal.c                 |    4 +-
 camel/camel-block-file.c                           |   50 +++---
 camel/camel-cipher-context.c                       |   24 ++--
 camel/camel-db.c                                   |    8 +-
 camel/camel-debug.c                                |    2 +-
 camel/camel-disco-store.c                          |    8 +-
 camel/camel-file-utils.c                           |    2 +-
 camel/camel-filter-driver.c                        |    2 +-
 camel/camel-filter-search.c                        |    2 +-
 camel/camel-folder-search.c                        |   50 +++---
 camel/camel-folder-summary.c                       |  166 ++++++++--------
 camel/camel-folder-thread.c                        |   40 ++--
 camel/camel-folder.c                               |    4 +-
 camel/camel-gpg-context.c                          |   38 ++--
 camel/camel-html-parser.c                          |   12 +-
 camel/camel-http-stream.c                          |    2 +-
 camel/camel-iconv.c                                |   24 ++--
 camel/camel-index-control.c                        |   16 +-
 camel/camel-index.c                                |    2 +-
 camel/camel-internet-address.c                     |   24 ++--
 camel/camel-list-utils.c                           |    6 +-
 camel/camel-lock.c                                 |    4 +-
 camel/camel-mime-filter-canon.c                    |    6 +-
 camel/camel-mime-filter-enriched.c                 |    2 +-
 camel/camel-mime-filter-tohtml.c                   |   20 +-
 camel/camel-mime-message.c                         |   38 ++--
 camel/camel-mime-part-utils.c                      |   12 +-
 camel/camel-mime-part.c                            |    8 +-
 camel/camel-mime-utils.c                           |   18 +-
 camel/camel-multipart-signed.c                     |   30 ++--
 camel/camel-net-utils.c                            |   14 +-
 camel/camel-nntp-address.c                         |    8 +-
 camel/camel-partition-table.c                      |    8 +-
 camel/camel-provider.c                             |    4 +-
 camel/camel-sasl-gssapi.c                          |    6 +-
 camel/camel-sasl-ntlm.c                            |   32 ++--
 camel/camel-search-private.c                       |   32 ++--
 camel/camel-smime-context.c                        |   44 ++--
 camel/camel-store-summary.c                        |   14 +-
 camel/camel-store.c                                |    6 +-
 camel/camel-stream-mem.c                           |    6 +-
 camel/camel-stream-process.c                       |    2 +-
 camel/camel-tcp-stream-raw.c                       |    8 +-
 camel/camel-tcp-stream-ssl.c                       |    4 +-
 camel/camel-text-index.c                           |   80 ++++----
 camel/camel-url-scanner.c                          |    4 +-
 camel/camel-url.c                                  |    8 +-
 camel/camel-utf8.c                                 |    6 +-
 camel/camel-vee-folder.c                           |  176 +++++++++---------
 camel/camel-vee-store.c                            |   12 +-
 camel/camel-vee-summary.c                          |   46 +++---
 camel/camel-vtrash-folder.c                        |   20 +-
 camel/providers/imap/camel-imap-folder.c           |   88 ++++----
 camel/providers/imap/camel-imap-journal.c          |    4 +-
 camel/providers/imap/camel-imap-message-cache.c    |    4 +-
 camel/providers/imap/camel-imap-private.h          |    8 +-
 camel/providers/imap/camel-imap-provider.c         |    2 +-
 camel/providers/imap/camel-imap-search.c           |   24 ++--
 camel/providers/imap/camel-imap-store-summary.c    |   44 ++--
 camel/providers/imap/camel-imap-store.c            |  116 ++++++------
 camel/providers/imap/camel-imap-summary.c          |   22 +-
 camel/providers/imap/camel-imap-utils.c            |    2 +-
 camel/providers/imap/camel-imap-wrapper.c          |    6 +-
 camel/providers/imapx/camel-imapx-folder.c         |    6 +-
 camel/providers/imapx/camel-imapx-provider.c       |    2 +-
 camel/providers/imapx/camel-imapx-server.c         |  206 ++++++++++----------
 camel/providers/imapx/camel-imapx-store-summary.c  |   44 ++--
 camel/providers/imapx/camel-imapx-store-summary.h  |    2 +-
 camel/providers/imapx/camel-imapx-store.c          |   88 ++++----
 camel/providers/imapx/camel-imapx-stream.c         |   14 +-
 camel/providers/imapx/camel-imapx-summary.c        |   28 ++--
 camel/providers/imapx/camel-imapx-utils.c          |   14 +-
 camel/providers/imapx/camel-imapx-view-summary.c   |   40 ++--
 camel/providers/local/camel-local-folder.c         |   24 ++--
 camel/providers/local/camel-local-store.c          |    8 +-
 camel/providers/local/camel-local-summary.c        |   42 ++--
 camel/providers/local/camel-maildir-folder.c       |   14 +-
 camel/providers/local/camel-maildir-store.c        |   14 +-
 camel/providers/local/camel-maildir-summary.c      |   62 +++---
 camel/providers/local/camel-mbox-folder.c          |   54 +++---
 camel/providers/local/camel-mbox-store.c           |   10 +-
 camel/providers/local/camel-mbox-summary.c         |  112 ++++++------
 camel/providers/local/camel-mh-folder.c            |   12 +-
 camel/providers/local/camel-mh-store.c             |   26 ++--
 camel/providers/local/camel-mh-summary.c           |   48 +++---
 camel/providers/local/camel-spool-folder.c         |   14 +-
 camel/providers/local/camel-spool-store.c          |   14 +-
 camel/providers/local/camel-spool-summary.c        |   36 ++--
 camel/providers/nntp/camel-nntp-folder.c           |    2 +-
 camel/providers/nntp/camel-nntp-provider.c         |    2 +-
 camel/providers/nntp/camel-nntp-store-summary.c    |   14 +-
 camel/providers/nntp/camel-nntp-store.c            |   28 ++--
 camel/providers/nntp/camel-nntp-stream.c           |    8 +-
 camel/providers/nntp/camel-nntp-summary.c          |   28 ++--
 camel/providers/pop3/camel-pop3-engine.c           |   34 ++--
 camel/providers/pop3/camel-pop3-folder.c           |   16 +-
 camel/providers/pop3/camel-pop3-provider.c         |    2 +-
 camel/providers/pop3/camel-pop3-store.c            |    6 +-
 camel/providers/pop3/camel-pop3-stream.c           |    8 +-
 .../providers/sendmail/camel-sendmail-transport.c  |    2 +-
 camel/providers/smtp/camel-smtp-provider.c         |    2 +-
 camel/tests/folder/test11.c                        |    4 +-
 camel/tests/folder/test8.c                         |    4 +-
 camel/tests/lib/camel-test.c                       |    4 +-
 camel/tests/lib/messages.c                         |   22 +-
 camel/tests/message/test1.c                        |    8 +-
 camel/tests/message/test3.c                        |    8 +-
 camel/tests/mime-filter/test-tohtml.c              |    8 +-
 camel/tests/smime/pgp.c                            |    4 +-
 libebackend/e-data-server-module.c                 |    2 +-
 libebackend/e-dbhash.c                             |    6 +-
 libebackend/e-offline-listener.c                   |    2 +-
 libedataserver/e-account-list.c                    |   18 +-
 libedataserver/e-account.c                         |   40 ++--
 libedataserver/e-data-server-util.c                |    2 +-
 libedataserver/e-list.c                            |    2 +-
 libedataserver/e-memory.c                          |    4 +-
 libedataserver/e-proxy.c                           |   36 ++--
 libedataserver/e-sexp.c                            |   14 +-
 libedataserver/e-source-list.c                     |    8 +-
 libedataserver/e-source.c                          |   20 +-
 libedataserver/e-time-utils.c                      |    4 +-
 libedataserver/e-url.c                             |    2 +-
 libedataserver/e-xml-hash-utils.c                  |    6 +-
 libedataserverui/e-name-selector-dialog.c          |    2 +-
 libedataserverui/e-name-selector-entry.c           |    8 +-
 libedataserverui/e-name-selector-list.c            |   12 +-
 libedataserverui/e-name-selector.c                 |    2 +-
 libedataserverui/e-passwords.c                     |    4 +-
 tests/libebook/test-ebook-async.c                  |    2 +-
 tests/libebook/test-ebook-get-book-view.c          |    6 +-
 tests/libebook/test-ebook.c                        |    2 +-
 tests/libebook/test-stress-bookviews.c             |    6 +-
 tests/libedata-cal/test-intervaltree.c             |   14 +-
 165 files changed, 1637 insertions(+), 1637 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index 5020a0f..7f8f465 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -115,7 +115,7 @@ static void
 string_to_dbt (const gchar *str, DBT *dbt)
 {
 	memset (dbt, 0, sizeof (*dbt));
-	dbt->data = (gpointer)str;
+	dbt->data = (gpointer) str;
 	dbt->size = strlen (str) + 1;
 	dbt->flags = DB_DBT_USERMEM;
 }
@@ -524,7 +524,7 @@ init_closure (EDataBookView *book_view, EBookBackendFile *bf)
 	closure->running = e_flag_new ();
 
 	g_object_set_data_full (G_OBJECT (book_view), "EBookBackendFile.BookView::closure",
-				closure, (GDestroyNotify)closure_destroy);
+				closure, (GDestroyNotify) closure_destroy);
 
 	return closure;
 }
@@ -821,7 +821,7 @@ e_book_backend_file_get_changes (EBookBackendSync *backend,
 		dbc->c_close (dbc);
 	}
 
-	e_dbhash_foreach_key (ehash, (EDbHashFunc)e_book_backend_file_changes_foreach_key, &ctx);
+	e_dbhash_foreach_key (ehash, (EDbHashFunc) e_book_backend_file_changes_foreach_key, &ctx);
 
 	/* Send the changes */
 	if (db_error != DB_NOTFOUND) {
@@ -1139,8 +1139,8 @@ e_book_backend_file_load_source (EBookBackend           *backend,
 		env->set_errcall (env, file_errcall);
 
 		/* Set the allocation routines to the non-aborting GLib functions */
-		env->set_alloc (env, (gpointer (*)(gsize))g_try_malloc,
-				(gpointer (*)(gpointer , gsize))g_try_realloc,
+		env->set_alloc (env, (gpointer (*)(gsize)) g_try_malloc,
+				(gpointer (*)(gpointer , gsize)) g_try_realloc,
 				g_free);
 
 		db_error = (*env->open) (env, NULL, DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_THREAD, 0);
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index f3cd23b..0d39bc2 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -2004,7 +2004,7 @@ _gdata_entry_update_from_e_contact (EBookBackend *backend, GDataEntry *entry, EC
 			GList *values;
 
 			values = e_vcard_attribute_get_values (attr);
-			if (values && values->data && ((gchar *)values->data)[0])
+			if (values && values->data && ((gchar *) values->data)[0])
 				__debug__ ("unsupported vcard field: %s: %s", name, (gchar *)values->data);
 		}
 	}
@@ -2611,7 +2611,7 @@ get_google_primary_type_label (EVCardAttribute *attr, gboolean *primary, const g
 
 			values = e_vcard_attribute_param_get_values (params->data);
 			if (values && values->data &&
-				(((const gchar *)values->data)[0] == '1' ||
+				(((const gchar *) values->data)[0] == '1' ||
 				 0 == g_ascii_strcasecmp (values->data, "yes"))) {
 				*primary = TRUE;
 			}
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 8ad5a20..1137557 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -81,7 +81,7 @@
 #    define ldap_compare_ext(ld,dn,a,v,sc,cc,msg) \
         ldap_compare_extW (ld,dn,a,0,v,sc,cc,msg)
 #    define ldap_search_ext(ld,base,scope,f,a,o,sc,cc,(t),s,msg) \
-        ldap_search_extW (ld,base,scope,f,a,o,sc,cc,((PLDAP_TIMEVAL)t)?((PLDAP_TIMEVAL)t)->tv_sec:0,s,msg)
+        ldap_search_extW (ld,base,scope,f,a,o,sc,cc,((PLDAP_TIMEVAL) t)?((PLDAP_TIMEVAL) t)->tv_sec:0,s,msg)
 # if defined (__MINGW64_VERSION_MAJOR) || defined (_MSC_VER)
 #    define ldap_start_tls_s(ld,sc,cc) \
         ldap_start_tls_sW (ld,0,0,sc,cc)
@@ -90,7 +90,7 @@
 #    define ldap_compare_ext(ld,dn,a,v,sc,cc,msg) \
         ldap_compare_extA (ld,dn,a,0,v,sc,cc,msg)
 #    define ldap_search_ext(ld,base,scope,f,a,o,sc,cc,t,s,msg) \
-        ldap_search_extA (ld,base,scope,f,a,o,sc,cc,((PLDAP_TIMEVAL)t)?((PLDAP_TIMEVAL)t)->tv_sec:0,s,msg)
+        ldap_search_extA (ld,base,scope,f,a,o,sc,cc,((PLDAP_TIMEVAL) t)?((PLDAP_TIMEVAL) t)->tv_sec:0,s,msg)
 # if defined (__MINGW64_VERSION_MAJOR) || defined (_MSC_VER)
 #    define ldap_start_tls_s(ld,sc,cc) \
         ldap_start_tls_sA (ld,0,0,sc,cc)
@@ -453,7 +453,7 @@ find_book_view (EBookBackendLDAP *bl)
 
 	if (e_iterator_is_valid (iter)) {
 		/* just always use the first book view */
-		EDataBookView *v = (EDataBookView*)e_iterator_get (iter);
+		EDataBookView *v = (EDataBookView*) e_iterator_get (iter);
 		if (v)
 			rv = v;
 	}
@@ -532,7 +532,7 @@ add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc
 	GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
 	for (i = 0; i < G_N_ELEMENTS (prop_info); i++)
-		g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar *)e_contact_field_name (prop_info[i].field_id));
+		g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar *) e_contact_field_name (prop_info[i].field_id));
 
 	if (oc->oc_at_oids_must)
 		add_to_supported_fields (bl, oc->oc_at_oids_must, attr_hash);
@@ -756,7 +756,7 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
 	if (values) {
 		gchar *auth_method;
 		if (bl->priv->supported_auth_methods) {
-			g_list_foreach (bl->priv->supported_auth_methods, (GFunc)g_free, NULL);
+			g_list_foreach (bl->priv->supported_auth_methods, (GFunc) g_free, NULL);
 			g_list_free (bl->priv->supported_auth_methods);
 		}
 		bl->priv->supported_auth_methods = NULL;
@@ -1423,7 +1423,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 		     gboolean is_list, gboolean is_rename)
 {
 #define FIND_INSERT(oc) \
-	if (!g_list_find_custom (existing_objectclasses, (oc), (GCompareFunc)g_ascii_strcasecmp)) \
+	if (!g_list_find_custom (existing_objectclasses, (oc), (GCompareFunc) g_ascii_strcasecmp)) \
 		 g_ptr_array_add (objectclasses, g_strdup ((oc)))
 #define INSERT(oc) \
 		 g_ptr_array_add (objectclasses, g_strdup ((oc)))
@@ -1456,7 +1456,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 
 		if (objectclasses->len) {
 			g_ptr_array_add (objectclasses, NULL);
-			objectclass_mod->mod_values = (gchar **)objectclasses->pdata;
+			objectclass_mod->mod_values = (gchar **) objectclasses->pdata;
 			g_ptr_array_add (mod_array, objectclass_mod);
 			g_ptr_array_free (objectclasses, FALSE);
 		}
@@ -1486,7 +1486,7 @@ add_objectclass_mod (EBookBackendLDAP *bl, GPtrArray *mod_array, GList *existing
 				INSERT (EVOLUTIONPERSON);
 		}
 		g_ptr_array_add (objectclasses, NULL);
-		objectclass_mod->mod_values = (gchar **)objectclasses->pdata;
+		objectclass_mod->mod_values = (gchar **) objectclasses->pdata;
 		g_ptr_array_add (mod_array, objectclass_mod);
 		g_ptr_array_free (objectclasses, FALSE);
 	}
@@ -1501,7 +1501,7 @@ typedef struct {
 static void
 create_contact_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPCreateOp *create_op = (LDAPCreateOp*)op;
+	LDAPCreateOp *create_op = (LDAPCreateOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	gchar *ldap_error_msg;
 	gint ldap_error;
@@ -1553,7 +1553,7 @@ create_contact_handler (LDAPOp *op, LDAPMessage *res)
 static void
 create_contact_dtor (LDAPOp *op)
 {
-	LDAPCreateOp *create_op = (LDAPCreateOp*)op;
+	LDAPCreateOp *create_op = (LDAPCreateOp*) op;
 
 	g_free (create_op->dn);
 	g_object_unref (create_op->new_contact);
@@ -1669,7 +1669,7 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
 		}
 #endif
 
-		ldap_mods = (LDAPMod**)mod_array->pdata;
+		ldap_mods = (LDAPMod**) mod_array->pdata;
 
 		do {
 			book_view_notify_status (bl, book_view, _("Adding contact to LDAP server..."));
@@ -1688,12 +1688,12 @@ e_book_backend_ldap_create_contact (EBookBackend *backend,
 						    opid,
 						    ldap_error_to_response (err),
 						    NULL);
-			create_contact_dtor ((LDAPOp*)create_op);
+			create_contact_dtor ((LDAPOp*) create_op);
 			return;
 		}
 		else {
 			g_print ("ldap_add_ext returned %d\n", err);
-			ldap_op_add ((LDAPOp*)create_op, backend, book,
+			ldap_op_add ((LDAPOp*) create_op, backend, book,
 				     book_view, opid, create_contact_msgid,
 				     create_contact_handler, create_contact_dtor);
 		}
@@ -1708,7 +1708,7 @@ typedef struct {
 static void
 remove_contact_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPRemoveOp *remove_op = (LDAPRemoveOp*)op;
+	LDAPRemoveOp *remove_op = (LDAPRemoveOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	gchar *ldap_error_msg;
 	gint ldap_error;
@@ -1760,7 +1760,7 @@ remove_contact_handler (LDAPOp *op, LDAPMessage *res)
 static void
 remove_contact_dtor (LDAPOp *op)
 {
-	LDAPRemoveOp *remove_op = (LDAPRemoveOp*)op;
+	LDAPRemoveOp *remove_op = (LDAPRemoveOp*) op;
 
 	g_free (remove_op->id);
 	g_free (remove_op);
@@ -1818,13 +1818,13 @@ e_book_backend_ldap_remove_contacts (EBookBackend *backend,
 							     opid,
 							     ldap_error_to_response (ldap_error),
 							     NULL);
-			ldap_op_finished ((LDAPOp*)remove_op);
-			remove_contact_dtor ((LDAPOp*)remove_op);
+			ldap_op_finished ((LDAPOp*) remove_op);
+			remove_contact_dtor ((LDAPOp*) remove_op);
 			return;
 		}
 		else {
 			g_print ("ldap_delete_ext returned %d\n", ldap_error);
-			ldap_op_add ((LDAPOp*)remove_op, backend, book,
+			ldap_op_add ((LDAPOp*) remove_op, backend, book,
 				     book_view, opid, remove_msgid,
 				     remove_contact_handler, remove_contact_dtor);
 		}
@@ -1858,7 +1858,7 @@ typedef struct {
 static void
 modify_contact_modify_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
+	LDAPModifyOp *modify_op = (LDAPModifyOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	gchar *ldap_error_msg;
 	gint ldap_error;
@@ -1912,7 +1912,7 @@ static void modify_contact_rename_handler (LDAPOp *op, LDAPMessage *res);
 static void
 modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
+	LDAPModifyOp *modify_op = (LDAPModifyOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	gint msg_type;
 
@@ -2018,7 +2018,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 
 				if (ldap_error == LDAP_SUCCESS) {
 					op->handler = modify_contact_rename_handler;
-					ldap_op_change_id ((LDAPOp*)modify_op,
+					ldap_op_change_id ((LDAPOp*) modify_op,
 							   rename_contact_msgid);
 
 					/* Remove old entry from cache */
@@ -2050,7 +2050,7 @@ modify_contact_search_handler (LDAPOp *op, LDAPMessage *res)
 static void
 modify_contact_rename_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
+	LDAPModifyOp *modify_op = (LDAPModifyOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	gchar *ldap_error_msg;
 	gint ldap_error;
@@ -2126,7 +2126,7 @@ modify_contact_rename_handler (LDAPOp *op, LDAPMessage *res)
 		/* then put the NULL back */
 		g_ptr_array_add (modify_op->mod_array, NULL);
 
-		ldap_mods = (LDAPMod**)modify_op->mod_array->pdata;
+		ldap_mods = (LDAPMod**) modify_op->mod_array->pdata;
 #ifdef LDAP_DEBUG_MODIFY
 		if (enable_debug) {
 			gint i;
@@ -2167,7 +2167,7 @@ modify_contact_rename_handler (LDAPOp *op, LDAPMessage *res)
 
 		if (ldap_error == LDAP_SUCCESS) {
 			op->handler = modify_contact_modify_handler;
-			ldap_op_change_id ((LDAPOp*)modify_op,
+			ldap_op_change_id ((LDAPOp*) modify_op,
 					   modify_contact_msgid);
 		} else {
 			g_warning ("ldap_modify_ext returned %d\n", ldap_error);
@@ -2191,12 +2191,12 @@ modify_contact_rename_handler (LDAPOp *op, LDAPMessage *res)
 static void
 modify_contact_dtor (LDAPOp *op)
 {
-	LDAPModifyOp *modify_op = (LDAPModifyOp*)op;
+	LDAPModifyOp *modify_op = (LDAPModifyOp*) op;
 
 	g_free (modify_op->new_id);
 	g_free (modify_op->ldap_uid);
 	free_mods (modify_op->mod_array);
-	g_list_foreach (modify_op->existing_objectclasses, (GFunc)g_free, NULL);
+	g_list_foreach (modify_op->existing_objectclasses, (GFunc) g_free, NULL);
 	g_list_free (modify_op->existing_objectclasses);
 	if (modify_op->current_contact)
 		g_object_unref (modify_op->current_contact);
@@ -2254,7 +2254,7 @@ e_book_backend_ldap_modify_contact (EBookBackend *backend,
 		} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
 
 		if (ldap_error == LDAP_SUCCESS) {
-			ldap_op_add ((LDAPOp*)modify_op, backend, book,
+			ldap_op_add ((LDAPOp*) modify_op, backend, book,
 				     book_view, opid, modify_contact_msgid,
 				     modify_contact_search_handler, modify_contact_dtor);
 		}
@@ -2263,7 +2263,7 @@ e_book_backend_ldap_modify_contact (EBookBackend *backend,
 						    opid,
 						    ldap_error_to_response (ldap_error),
 						    NULL);
-			modify_contact_dtor ((LDAPOp*)modify_op);
+			modify_contact_dtor ((LDAPOp*) modify_op);
 		}
 	}
 }
@@ -2372,7 +2372,7 @@ get_contact_handler (LDAPOp *op, LDAPMessage *res)
 static void
 get_contact_dtor (LDAPOp *op)
 {
-	LDAPGetContactOp *get_contact_op = (LDAPGetContactOp*)op;
+	LDAPGetContactOp *get_contact_op = (LDAPGetContactOp*) op;
 
 	g_free (get_contact_op);
 }
@@ -2449,7 +2449,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
 		} while (e_book_backend_ldap_reconnect (bl, book_view, ldap_error));
 
 		if (ldap_error == LDAP_SUCCESS) {
-			ldap_op_add ((LDAPOp*)get_contact_op, backend, book,
+			ldap_op_add ((LDAPOp*) get_contact_op, backend, book,
 				     book_view, opid, get_contact_msgid,
 				     get_contact_handler, get_contact_dtor);
 
@@ -2467,7 +2467,7 @@ e_book_backend_ldap_get_contact (EBookBackend *backend,
 							 opid,
 							 ldap_error_to_response (ldap_error),
 							 "");
-			get_contact_dtor ((LDAPOp*)get_contact_op);
+			get_contact_dtor ((LDAPOp*) get_contact_op);
 		}
 	}
 }
@@ -2480,7 +2480,7 @@ typedef struct {
 static void
 contact_list_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPGetContactListOp *contact_list_op = (LDAPGetContactListOp*)op;
+	LDAPGetContactListOp *contact_list_op = (LDAPGetContactListOp*) op;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	LDAPMessage *e;
 	gint msg_type;
@@ -2591,7 +2591,7 @@ contact_list_handler (LDAPOp *op, LDAPMessage *res)
 static void
 contact_list_dtor (LDAPOp *op)
 {
-	LDAPGetContactListOp *contact_list_op = (LDAPGetContactListOp*)op;
+	LDAPGetContactListOp *contact_list_op = (LDAPGetContactListOp*) op;
 
 	g_free (contact_list_op);
 }
@@ -2675,7 +2675,7 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
 		g_free (ldap_query);
 
 		if (ldap_error == LDAP_SUCCESS) {
-			ldap_op_add ((LDAPOp*)contact_list_op, backend, book,
+			ldap_op_add ((LDAPOp*) contact_list_op, backend, book,
 				     book_view, opid, contact_list_msgid,
 				     contact_list_handler, contact_list_dtor);
 			if (enable_debug) {
@@ -2693,7 +2693,7 @@ e_book_backend_ldap_get_contact_list (EBookBackend *backend,
 							      opid,
 							      ldap_error_to_response (ldap_error),
 							      NULL);
-			contact_list_dtor ((LDAPOp*)contact_list_op);
+			contact_list_dtor ((LDAPOp*) contact_list_op);
 		}
 	}
 }
@@ -3183,7 +3183,7 @@ category_populate (EContact *contact, gchar **values)
 
 	e_contact_set (contact, E_CONTACT_CATEGORY_LIST, categories);
 
-	g_list_foreach (categories, (GFunc)g_free, NULL);
+	g_list_foreach (categories, (GFunc) g_free, NULL);
 	g_list_free (categories);
 }
 
@@ -3217,7 +3217,7 @@ category_ber (EContact *contact)
 		}
 	}
 
-	g_list_foreach (categories, (GFunc)g_free, NULL);
+	g_list_foreach (categories, (GFunc) g_free, NULL);
 	g_list_free (categories);
 	return result;
 }
@@ -3453,7 +3453,7 @@ photo_populate (EContact *contact, struct berval **ber_values)
 		EContactPhoto photo;
 		photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
 		photo.data.inlined.mime_type = NULL;
-		photo.data.inlined.data = (guchar *)ber_values[0]->bv_val;
+		photo.data.inlined.data = (guchar *) ber_values[0]->bv_val;
 		photo.data.inlined.length = ber_values[0]->bv_len;
 
 		e_contact_set (contact, E_CONTACT_PHOTO, &photo);
@@ -3984,7 +3984,7 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query)
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp, 0, symbols[i].name,
-					     (ESExpIFunc *)symbols[i].func, &data);
+					     (ESExpIFunc *) symbols[i].func, &data);
 		} else {
 			e_sexp_add_function (sexp, 0, symbols[i].name,
 					    symbols[i].func, &data);
@@ -4003,7 +4003,7 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query)
 		if (data.list->next) {
 			g_warning ("conversion to ldap query string failed");
 			retval = NULL;
-			g_list_foreach (data.list, (GFunc)g_free, NULL);
+			g_list_foreach (data.list, (GFunc) g_free, NULL);
 		}
 		else {
 			if (bl->priv->ldap_search_filter && *bl->priv->ldap_search_filter
@@ -4326,7 +4326,7 @@ poll_ldap (EBookBackendLDAP *bl)
 static void
 ldap_search_handler (LDAPOp *op, LDAPMessage *res)
 {
-	LDAPSearchOp *search_op = (LDAPSearchOp*)op;
+	LDAPSearchOp *search_op = (LDAPSearchOp*) op;
 	EDataBookView *view = search_op->view;
 	EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (op->backend);
 	LDAPMessage *e;
@@ -4389,7 +4389,7 @@ ldap_search_handler (LDAPOp *op, LDAPMessage *res)
 		}
 		ldap_memfree (ldap_error_msg);
 
-		if ((ldap_error == LDAP_TIMELIMIT_EXCEEDED || ldap_error == LDAP_SIZELIMIT_EXCEEDED) && can_browse ((EBookBackend *)bl))
+		if ((ldap_error == LDAP_TIMELIMIT_EXCEEDED || ldap_error == LDAP_SIZELIMIT_EXCEEDED) && can_browse ((EBookBackend *) bl))
 			/* do not complain when search limit exceeded for browseable LDAPs */
 			edb_err = EDB_ERROR (SUCCESS);
 		else if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
@@ -4484,7 +4484,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
 		ldap_query = e_book_backend_ldap_build_query (bl, e_data_book_view_get_card_query (view));
 
 		/* search for nonempty full names */
-		if (!ldap_query && can_browse ((EBookBackend *)bl))
+		if (!ldap_query && can_browse ((EBookBackend *) bl))
 			ldap_query = g_strdup ("(cn=*)");
 
 		g_static_rec_mutex_lock (&eds_ldap_handler_lock);
@@ -4537,7 +4537,7 @@ e_book_backend_ldap_search (EBookBackendLDAP *bl,
 				op->aborted = FALSE;
 				e_data_book_view_ref (view);
 
-				ldap_op_add ((LDAPOp*)op, E_BOOK_BACKEND (bl), book, view,
+				ldap_op_add ((LDAPOp*) op, E_BOOK_BACKEND (bl), book, view,
 					     0, search_msgid,
 					     ldap_search_handler, ldap_search_dtor);
 
@@ -4589,7 +4589,7 @@ e_book_backend_ldap_stop_book_view (EBookBackend  *backend,
 	op = g_object_get_data (G_OBJECT (view), "EBookBackendLDAP.BookView::search_op");
 	if (op) {
 		op->aborted = TRUE;
-		ldap_op_finished ((LDAPOp*)op);
+		ldap_op_finished ((LDAPOp*) op);
 		g_free (op);
 	}
 }
@@ -4957,9 +4957,9 @@ e_book_backend_ldap_get_required_fields (EBookBackend *backend,
 
 	/*FIMEME we should look at mandatory attributs in the schema
 	  and return all those fields here */
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FULL_NAME));
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FAMILY_NAME));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_FILE_AS));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_FULL_NAME));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_FAMILY_NAME));
 
 	e_data_book_respond_get_required_fields (book,
 						  opid,
@@ -5322,7 +5322,7 @@ e_book_backend_ldap_dispose (GObject *object)
 
 	if (bl->priv) {
 		g_static_rec_mutex_lock (&bl->priv->op_hash_mutex);
-		g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc)call_dtor, NULL);
+		g_hash_table_foreach_remove (bl->priv->id_to_op, (GHRFunc) call_dtor, NULL);
 		g_hash_table_destroy (bl->priv->id_to_op);
 		g_static_rec_mutex_unlock (&bl->priv->op_hash_mutex);
 		g_static_rec_mutex_free (&bl->priv->op_hash_mutex);
@@ -5337,12 +5337,12 @@ e_book_backend_ldap_dispose (GObject *object)
 		}
 
 		if (bl->priv->supported_fields) {
-			g_list_foreach (bl->priv->supported_fields, (GFunc)g_free, NULL);
+			g_list_foreach (bl->priv->supported_fields, (GFunc) g_free, NULL);
 			g_list_free (bl->priv->supported_fields);
 		}
 
 		if (bl->priv->supported_auth_methods) {
-			g_list_foreach (bl->priv->supported_auth_methods, (GFunc)g_free, NULL);
+			g_list_foreach (bl->priv->supported_auth_methods, (GFunc) g_free, NULL);
 			g_list_free (bl->priv->supported_auth_methods);
 		}
 		if (bl->priv->summary_file_name) {
diff --git a/addressbook/backends/ldap/openldap-extract.h b/addressbook/backends/ldap/openldap-extract.h
index 37df943..36b3825 100644
--- a/addressbook/backends/ldap/openldap-extract.h
+++ b/addressbook/backends/ldap/openldap-extract.h
@@ -300,7 +300,7 @@ ldap_int_parse_numericoid (const gchar **sp, gint *code, const gint flags)
 		}
 	}
 	if (flags & LDAP_SCHEMA_SKIP) {
-		res = (gchar *)start;
+		res = (gchar *) start;
 	} else {
 		res = LDAP_MALLOC (len+1);
 		if (!res) {
@@ -1142,7 +1142,7 @@ ldap_url_parse_ext ( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp )
 	}
 
 	/* allocate return struct */
-	ludp = (LDAPURLDesc *)LDAP_CALLOC ( 1, sizeof ( LDAPURLDesc ));
+	ludp = (LDAPURLDesc *) LDAP_CALLOC ( 1, sizeof ( LDAPURLDesc ));
 
 	if (ludp == NULL) {
 		LDAP_FREE ( url );
diff --git a/addressbook/backends/vcf/e-book-backend-vcf.c b/addressbook/backends/vcf/e-book-backend-vcf.c
index 29c8b5e..a9515f8 100644
--- a/addressbook/backends/vcf/e-book-backend-vcf.c
+++ b/addressbook/backends/vcf/e-book-backend-vcf.c
@@ -413,7 +413,7 @@ e_book_backend_vcf_get_contact_list (EBookBackendSync *backend,
 	closure.card_sexp = e_book_backend_sexp_new (search);
 	closure.list = NULL;
 
-	g_list_foreach (bvcf->priv->contact_list, (GFunc)foreach_get_contact_compare, &closure);
+	g_list_foreach (bvcf->priv->contact_list, (GFunc) foreach_get_contact_compare, &closure);
 
 	g_object_unref (closure.card_sexp);
 
@@ -446,7 +446,7 @@ init_closure (EDataBookView *book_view, EBookBackendVCF *bvcf)
 	closure->running = e_flag_new ();
 
 	g_object_set_data_full (G_OBJECT (book_view), "EBookBackendVCF.BookView::closure",
-				closure, (GDestroyNotify)closure_destroy);
+				closure, (GDestroyNotify) closure_destroy);
 
 	return closure;
 }
@@ -577,7 +577,7 @@ e_book_backend_vcf_get_supported_fields (EBookBackendSync *backend,
 	/* XXX we need a way to say "we support everything", since the
 	   vcf backend does */
 	for (i = 0; i < E_CONTACT_FIELD_LAST; i++)
-		fields = g_list_append (fields, (gchar *)e_contact_field_name (i));
+		fields = g_list_append (fields, (gchar *) e_contact_field_name (i));
 
 	*fields_out = fields;
 }
@@ -716,7 +716,7 @@ e_book_backend_vcf_dispose (GObject *object)
 			save_file (bvcf);
 
 		g_hash_table_destroy (bvcf->priv->contacts);
-		g_list_foreach (bvcf->priv->contact_list, (GFunc)g_free, NULL);
+		g_list_foreach (bvcf->priv->contact_list, (GFunc) g_free, NULL);
 		g_list_free (bvcf->priv->contact_list);
 
 		g_free (bvcf->priv->filename);
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index 29d3147..5b0213a 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -125,7 +125,7 @@ init_closure (EDataBookView *book_view, EBookBackendWebdav *webdav)
 	closure->running = e_flag_new ();
 
 	g_object_set_data_full (G_OBJECT (book_view), WEBDAV_CLOSURE_NAME, closure,
-			(GDestroyNotify)closure_destroy);
+			(GDestroyNotify) closure_destroy);
 
 	return closure;
 }
diff --git a/addressbook/libebook/e-address-western.c b/addressbook/libebook/e-address-western.c
index fa494c9..33c3ddd 100644
--- a/addressbook/libebook/e-address-western.c
+++ b/addressbook/libebook/e-address-western.c
@@ -310,7 +310,7 @@ e_address_western_parse (const gchar *in_address)
 	if (in_address == NULL)
 		return NULL;
 
-	eaw = (EAddressWestern *)g_malloc (sizeof (EAddressWestern));
+	eaw = (EAddressWestern *) g_malloc (sizeof (EAddressWestern));
 	eaw->po_box = NULL;
 	eaw->extended = NULL;
 	eaw->street = NULL;
@@ -335,7 +335,7 @@ e_address_western_parse (const gchar *in_address)
 	}
 
 	/* ... tally them. */
-	lines = (gchar **)g_malloc (sizeof (gchar *) * (linecntr+3));
+	lines = (gchar **) g_malloc (sizeof (gchar *) * (linecntr+3));
 	lineindex = 0;
 	lines[0] = &address[0];
 	linecntr = 1;
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index a3b3747..b84b0bd 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -113,7 +113,7 @@ conjoinv (EBookQueryType type, EBookQuery *q, va_list ap)
 
 	ret->type = type;
 	ret->query.andor.nqs = qs->len;
-	ret->query.andor.qs = (EBookQuery **)qs->pdata;
+	ret->query.andor.qs = (EBookQuery **) qs->pdata;
 	g_ptr_array_free (qs, FALSE);
 
 	return ret;
@@ -614,7 +614,7 @@ e_book_query_from_string  (const gchar *query_string)
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp, 0, symbols[i].name,
-					     (ESExpIFunc *)symbols[i].func, &list);
+					     (ESExpIFunc *) symbols[i].func, &list);
 		} else {
 			e_sexp_add_function (sexp, 0, symbols[i].name,
 					    symbols[i].func, &list);
@@ -633,7 +633,7 @@ e_book_query_from_string  (const gchar *query_string)
 		if (list->next) {
 			g_warning ("conversion to EBookQuery");
 			retval = NULL;
-			g_list_foreach (list, (GFunc)e_book_query_unref, NULL);
+			g_list_foreach (list, (GFunc) e_book_query_unref, NULL);
 		}
 		else {
 			retval = list->data;
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index 369c628..c571210 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -67,7 +67,7 @@ contacts_added_cb (EGdbusBookView *object, const gchar * const *vcards, EBookVie
 
 	g_signal_emit (book_view, signals[CONTACTS_ADDED], 0, contacts);
 
-	g_list_foreach (contacts, (GFunc)g_object_unref, NULL);
+	g_list_foreach (contacts, (GFunc) g_object_unref, NULL);
 	g_list_free (contacts);
 }
 
@@ -87,7 +87,7 @@ contacts_changed_cb (EGdbusBookView *object, const gchar * const *vcards, EBookV
 
 	g_signal_emit (book_view, signals[CONTACTS_CHANGED], 0, contacts);
 
-	g_list_foreach (contacts, (GFunc)g_object_unref, NULL);
+	g_list_foreach (contacts, (GFunc) g_object_unref, NULL);
 	g_list_free (contacts);
 }
 
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index e989507..9e46d18 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -493,7 +493,7 @@ photo_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 							e_vcard_attribute_param_new (EVC_TYPE),
 							image_type);
 
-		e_vcard_attribute_add_value_decoded (attr, (gchar *)photo->data.inlined.data, photo->data.inlined.length);
+		e_vcard_attribute_add_value_decoded (attr, (gchar *) photo->data.inlined.data, photo->data.inlined.length);
 		break;
 	case E_CONTACT_PHOTO_TYPE_URI:
 		e_vcard_attribute_add_param_with_value (attr,
@@ -529,7 +529,7 @@ fn_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 
 	attr = e_contact_get_first_attr (contact, EVC_N);
 	if (!attr) {
-		EContactName *name = e_contact_name_from_string ((gchar *)data);
+		EContactName *name = e_contact_name_from_string ((gchar *) data);
 
 		attr = e_vcard_attribute_new (NULL, EVC_N);
 		e_vcard_append_attribute (E_VCARD (contact), attr);
@@ -748,7 +748,7 @@ e_contact_set_property (GObject *object,
 		for (l = new_values; l; l = l->next)
 			e_vcard_append_attribute_with_value (E_VCARD (contact),
 							  e_vcard_attribute_new (NULL, info->vcard_field_name),
-							  (gchar *)l->data);
+							  (gchar *) l->data);
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_SYNTHETIC) {
 		if (info->t & E_CONTACT_FIELD_TYPE_MULTI_ELEM) {
@@ -841,11 +841,11 @@ e_contact_set_property (GObject *object,
 							GList *values = e_vcard_attribute_param_get_values (param);
 
 							while (values && values->data) {
-								if (!found_needed1 && !g_ascii_strcasecmp ((gchar *)values->data, info->attr_type1)) {
+								if (!found_needed1 && !g_ascii_strcasecmp ((gchar *) values->data, info->attr_type1)) {
 									found_needed1 = TRUE;
 									matches = TRUE;
 								}
-								else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *)values->data, info->attr_type2)) {
+								else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *) values->data, info->attr_type2)) {
 									found_needed2 = TRUE;
 									matches = TRUE;
 								} else if (found_needed1) {
@@ -894,10 +894,10 @@ e_contact_set_property (GObject *object,
 			}
 
 			if (info->t & E_CONTACT_FIELD_TYPE_STRUCT || info->t & E_CONTACT_FIELD_TYPE_GETSET) {
-				gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *)g_value_get_string (value);
+				gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *) g_value_get_string (value);
 
 				if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-				    || (data && *(gchar *)data))
+				    || (data && *(gchar *) data))
 					info->struct_setter (contact, attr, data);
 				else
 					e_vcard_remove_attribute (E_VCARD (contact), attr);
@@ -985,11 +985,11 @@ e_contact_set_property (GObject *object,
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_STRUCT || info->t & E_CONTACT_FIELD_TYPE_GETSET) {
 		EVCardAttribute *attr = e_contact_get_first_attr (contact, info->vcard_field_name);
-		gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *)g_value_get_string (value);
+		gpointer data = info->t & E_CONTACT_FIELD_TYPE_STRUCT ? g_value_get_boxed (value) : (gchar *) g_value_get_string (value);
 
 		if (attr) {
 			if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-			    || (data && *(gchar *)data)) {
+			    || (data && *(gchar *) data)) {
 				d(printf ("overwriting existing %s\n", info->vcard_field_name));
 				/* remove all existing values and parameters.
 				   the setter will add the correct ones */
@@ -1005,7 +1005,7 @@ e_contact_set_property (GObject *object,
 			}
 		}
 		else if ((info->t & E_CONTACT_FIELD_TYPE_STRUCT && data)
-			 || (data && *(gchar *)data)) {
+			 || (data && *(gchar *) data)) {
 			d(printf ("adding new %s\n", info->vcard_field_name));
 			attr = e_vcard_attribute_new (NULL, info->vcard_field_name);
 
@@ -1113,11 +1113,11 @@ e_contact_find_attribute_with_types (EContact *contact, const gchar *attr_name,
 					GList *values = e_vcard_attribute_param_get_values (param);
 
 					while (values && values->data) {
-						if (!found_needed1 && !g_ascii_strcasecmp ((gchar *)values->data, type_needed1)) {
+						if (!found_needed1 && !g_ascii_strcasecmp ((gchar *) values->data, type_needed1)) {
 							found_needed1 = TRUE;
 							matches = TRUE;
 						}
-						else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *)values->data, type_needed2)) {
+						else if (!found_needed2 && !g_ascii_strcasecmp ((gchar *) values->data, type_needed2)) {
 							found_needed2 = TRUE;
 							matches = TRUE;
 						} else if (found_needed1) {
@@ -1494,7 +1494,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 			rv = info->struct_getter (contact, attr);
 
 		if (info->t & E_CONTACT_FIELD_TYPE_STRUCT)
-			return (gpointer)info->boxed_type_getter ();
+			return (gpointer) info->boxed_type_getter ();
 		else if (!rv)
 			return NULL;
 		else
@@ -1529,7 +1529,7 @@ e_contact_get (EContact *contact, EContactField field_id)
 				GString *str = g_string_new ("");
 				GList *v = e_vcard_attribute_get_values (attr);
 				while (v) {
-					g_string_append (str, (gchar *)v->data);
+					g_string_append (str, (gchar *) v->data);
 					v = v->next;
 					if (v)
 						g_string_append (str, ", ");
@@ -1688,7 +1688,7 @@ e_contact_set_attributes (EContact *contact, EContactField field_id, GList *attr
 
 	for (l = attributes; l; l = l->next)
 		e_vcard_append_attribute (E_VCARD (contact),
-				       e_vcard_attribute_copy ((EVCardAttribute*)l->data));
+				       e_vcard_attribute_copy ((EVCardAttribute*) l->data));
 }
 
 /**
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index e5aebca..8d9fe24 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -722,7 +722,7 @@ e_destination_get_name (const EDestination *dest)
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
-	priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
+	priv = (struct _EDestinationPrivate *) dest->priv; /* cast out const */
 
 	if (priv->name == NULL) {
 		if (priv->contact != NULL) {
@@ -800,7 +800,7 @@ e_destination_get_email (const EDestination *dest)
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
-	priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
+	priv = (struct _EDestinationPrivate *) dest->priv; /* cast out const */
 
 	if (priv->email == NULL) {
 		if (priv->contact != NULL) {
@@ -813,7 +813,7 @@ e_destination_get_email (const EDestination *dest)
 					priv->email = g_strdup (e);
 			}
 			if (email) {
-				g_list_foreach (email, (GFunc)g_free, NULL);
+				g_list_foreach (email, (GFunc) g_free, NULL);
 				g_list_free (email);
 			}
 
@@ -857,7 +857,7 @@ e_destination_get_address (const EDestination *dest)
 
 	g_return_val_if_fail (dest && E_IS_DESTINATION (dest), NULL);
 
-	priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */
+	priv = (struct _EDestinationPrivate *) dest->priv; /* cast out const */
 
 	if (e_destination_is_evolution_list (dest)) {
 		GList *iter = dest->priv->list_dests;
@@ -1151,14 +1151,14 @@ e_destination_xml_encode (const EDestination *dest)
 
 			str = e_destination_get_name (list_dest);
 			if (str) {
-				xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*)str);
+				xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*) str);
 				xmlNewTextChild (list_node, NULL, (xmlChar*)"name", escaped);
 				xmlFree (escaped);
 			}
 
 			str = e_destination_get_email (list_dest);
 			if (str) {
-				xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*)str);
+				xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*) str);
 				xmlNewTextChild (list_node, NULL, (xmlChar*)"email", escaped);
 				xmlFree (escaped);
 			}
@@ -1175,7 +1175,7 @@ e_destination_xml_encode (const EDestination *dest)
 
 	str = e_destination_get_source_uid (dest);
 	if (str) {
-		xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*)str);
+		xmlChar *escaped = xmlEncodeEntitiesReentrant (NULL, (xmlChar*) str);
 		xmlNewTextChild (dest_node, NULL, (xmlChar*)"source_uid", escaped);
 		xmlFree (escaped);
 	}
@@ -1250,12 +1250,12 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 	node = node->xmlChildrenNode;
 	while (node) {
 		if (!strcmp ((gchar *)node->name, "name")) {
-			tmp = (gchar *)xmlNodeGetContent (node);
+			tmp = (gchar *) xmlNodeGetContent (node);
 			g_free (name);
 			name = g_strdup (tmp);
 			xmlFree (tmp);
 		} else if (!is_list && !strcmp ((gchar *)node->name, "email")) {
-			tmp = (gchar *)xmlNodeGetContent (node);
+			tmp = (gchar *) xmlNodeGetContent (node);
 			g_free (email);
 			email = g_strdup (tmp);
 			xmlFree (tmp);
@@ -1265,12 +1265,12 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 
 			while (subnode) {
 				if (!strcmp ((gchar *)subnode->name, "name")) {
-					tmp = (gchar *)xmlNodeGetContent (subnode);
+					tmp = (gchar *) xmlNodeGetContent (subnode);
 					g_free (list_name);
 					list_name = g_strdup (tmp);
 					xmlFree (tmp);
 				} else if (!strcmp ((gchar *)subnode->name, "email")) {
-					tmp = (gchar *)xmlNodeGetContent (subnode);
+					tmp = (gchar *) xmlNodeGetContent (subnode);
 					g_free (list_email);
 					list_email = g_strdup (tmp);
 					xmlFree (tmp);
@@ -1293,12 +1293,12 @@ e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 				list_dests = g_list_append (list_dests, list_dest);
 			}
 		} else if (!strcmp ((gchar *)node->name, "source_uid")) {
-			tmp = (gchar *)xmlNodeGetContent (node);
+			tmp = (gchar *) xmlNodeGetContent (node);
 			g_free (source_uid);
 			source_uid = g_strdup (tmp);
 			xmlFree (tmp);
 		} else if (!strcmp ((gchar *)node->name, "card_uid")) {
-			tmp = (gchar *)xmlNodeGetContent (node);
+			tmp = (gchar *) xmlNodeGetContent (node);
 			g_free (card_uid);
 			card_uid = g_strdup (tmp);
 			xmlFree (tmp);
@@ -1351,7 +1351,7 @@ null_terminate_and_remove_extra_whitespace (xmlChar *xml_in, gint size)
 	if (xml_in == NULL || size <= 0)
 		return NULL;
 
-	xml = g_strndup ((gchar *)xml_in, size);
+	xml = g_strndup ((gchar *) xml_in, size);
 	r = w = xml;
 
 	while (*r) {
@@ -1399,7 +1399,7 @@ e_destination_export (const EDestination *dest)
 	if (dest_node == NULL)
 		return NULL;
 
-	dest_doc = xmlNewDoc ((xmlChar*)XML_DEFAULT_VERSION);
+	dest_doc = xmlNewDoc ((xmlChar*) XML_DEFAULT_VERSION);
 	xmlDocSetRootElement (dest_doc, dest_node);
 
 	xmlDocDumpMemory (dest_doc, &buffer, &size);
@@ -1461,7 +1461,7 @@ e_destination_exportv (EDestination **destv)
 	if (destv == NULL || *destv == NULL)
 		return NULL;
 
-	destv_doc  = xmlNewDoc ((xmlChar*)XML_DEFAULT_VERSION);
+	destv_doc  = xmlNewDoc ((xmlChar*) XML_DEFAULT_VERSION);
 	destv_node = xmlNewNode (NULL, (xmlChar*)"destinations");
 	xmlDocSetRootElement (destv_doc, destv_node);
 
@@ -1502,7 +1502,7 @@ e_destination_importv (const gchar *str)
 	if (!(str && *str))
 		return NULL;
 
-	destv_doc = xmlParseMemory ((gchar *)str, strlen (str));
+	destv_doc = xmlParseMemory ((gchar *) str, strlen (str));
 	if (destv_doc == NULL)
 		return NULL;
 
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index e05a952..cab97b3 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -73,7 +73,7 @@ e_vcard_dispose (GObject *object)
 
 	if (evc->priv) {
 
-		g_list_foreach (evc->priv->attributes, (GFunc)e_vcard_attribute_free, NULL);
+		g_list_foreach (evc->priv->attributes, (GFunc) e_vcard_attribute_free, NULL);
 		g_list_free (evc->priv->attributes);
 
 		g_free (evc->priv);
@@ -990,7 +990,7 @@ e_vcard_dump_structure (EVCard *evc)
 				printf ("    |   [%d] = %s", i,param->name);
 				printf ("(");
 				for (v = param->values; v; v = v->next) {
-					gchar *value = e_vcard_escape_string ((gchar *)v->data);
+					gchar *value = e_vcard_escape_string ((gchar *) v->data);
 					printf ("%s", value);
 					if (v->next)
 						printf (",");
@@ -1368,11 +1368,11 @@ e_vcard_attribute_remove_values (EVCardAttribute *attr)
 {
 	g_return_if_fail (attr != NULL);
 
-	g_list_foreach (attr->values, (GFunc)g_free, NULL);
+	g_list_foreach (attr->values, (GFunc) g_free, NULL);
 	g_list_free (attr->values);
 	attr->values = NULL;
 
-	g_list_foreach (attr->decoded_values, (GFunc)free_gstring, NULL);
+	g_list_foreach (attr->decoded_values, (GFunc) free_gstring, NULL);
 	g_list_free (attr->decoded_values);
 	attr->decoded_values = NULL;
 }
@@ -1392,7 +1392,7 @@ e_vcard_attribute_remove_value (EVCardAttribute *attr, const gchar *s)
 	g_return_if_fail (attr != NULL);
 	g_return_if_fail (s != NULL);
 
-	l = g_list_find_custom (attr->values, s, (GCompareFunc)strcmp);
+	l = g_list_find_custom (attr->values, s, (GCompareFunc) strcmp);
 	if (l == NULL) {
 		return;
 	}
@@ -1440,7 +1440,7 @@ e_vcard_attribute_remove_params (EVCardAttribute *attr)
 {
 	g_return_if_fail (attr != NULL);
 
-	g_list_foreach (attr->params, (GFunc)e_vcard_attribute_param_free, NULL);
+	g_list_foreach (attr->params, (GFunc) e_vcard_attribute_param_free, NULL);
 	g_list_free (attr->params);
 	attr->params = NULL;
 
@@ -1551,11 +1551,11 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
 				const gchar *my_value;
 				GList *vals2,*v2;
 
-				my_value = (const gchar *)v->data;
+				my_value = (const gchar *) v->data;
 				vals2 = param2->values;
 
 				for (v2 = vals2; v2; v2 = v2->next) {
-					if (g_ascii_strcasecmp ((const gchar *)v2->data, my_value) == 0) {
+					if (g_ascii_strcasecmp ((const gchar *) v2->data, my_value) == 0) {
 						break;
 					}
 				}
@@ -1590,11 +1590,11 @@ e_vcard_attribute_add_param (EVCardAttribute *attr,
 			if (!g_ascii_strcasecmp ((gchar *)param->values->data, "b") ||
 			    !g_ascii_strcasecmp ((gchar *)param->values->data, "BASE64"))
 				attr->encoding = EVC_ENCODING_BASE64;
-			else if (!g_ascii_strcasecmp ((gchar *)param->values->data, EVC_QUOTEDPRINTABLE))
+			else if (!g_ascii_strcasecmp ((gchar *) param->values->data, EVC_QUOTEDPRINTABLE))
 				attr->encoding = EVC_ENCODING_QP;
 			else {
 				g_warning ("Unknown value `%s' for ENCODING parameter.  values will be treated as raw",
-					   (gchar *)param->values->data);
+					   (gchar *) param->values->data);
 			}
 
 			attr->encoding_set = TRUE;
@@ -1711,7 +1711,7 @@ e_vcard_attribute_param_remove_values (EVCardAttributeParam *param)
 {
 	g_return_if_fail (param != NULL);
 
-	g_list_foreach (param->values, (GFunc)g_free, NULL);
+	g_list_foreach (param->values, (GFunc) g_free, NULL);
 	g_list_free (param->values);
 	param->values = NULL;
 }
@@ -1739,7 +1739,7 @@ e_vcard_attribute_remove_param_value (EVCardAttribute *attr, const gchar *param_
 	for (l = params; l; l = l->next) {
 		param = l->data;
 		if (g_ascii_strcasecmp (e_vcard_attribute_param_get_name (param), param_name) == 0) {
-			l = g_list_find_custom (param->values, s, (GCompareFunc)strcmp);
+			l = g_list_find_custom (param->values, s, (GCompareFunc) strcmp);
 			if (l == NULL) {
 				return;
 			}
@@ -1872,7 +1872,7 @@ e_vcard_attribute_get_values_decoded (EVCardAttribute *attr)
 		switch (attr->encoding) {
 		case EVC_ENCODING_RAW:
 			for (l = attr->values; l; l = l->next)
-				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new ((gchar *)l->data));
+				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new ((gchar *) l->data));
 			attr->decoded_values = g_list_reverse (attr->decoded_values);
 			break;
 		case EVC_ENCODING_BASE64:
@@ -1935,7 +1935,7 @@ e_vcard_attribute_get_value (EVCardAttribute *attr)
 	if (!e_vcard_attribute_is_single_valued (attr))
 		g_warning ("e_vcard_attribute_get_value called on multivalued attribute");
 
-	return values ? g_strdup ((gchar *)values->data) : NULL;
+	return values ? g_strdup ((gchar *) values->data) : NULL;
 }
 
 /**
@@ -1996,7 +1996,7 @@ e_vcard_attribute_has_type (EVCardAttribute *attr, const gchar *typestr)
 			GList *v;
 
 			for (v = values; v; v = v->next) {
-				if (!g_ascii_strcasecmp ((gchar *)v->data, typestr))
+				if (!g_ascii_strcasecmp ((gchar *) v->data, typestr))
 					return TRUE;
 			}
 		}
diff --git a/addressbook/libedata-book/e-book-backend-db-cache.c b/addressbook/libedata-book/e-book-backend-db-cache.c
index fa22c87..b846696 100644
--- a/addressbook/libedata-book/e-book-backend-db-cache.c
+++ b/addressbook/libedata-book/e-book-backend-db-cache.c
@@ -33,7 +33,7 @@ void
 string_to_dbt (const gchar *str, DBT *dbt)
 {
 	memset (dbt, 0, sizeof (dbt));
-	dbt->data = (gpointer)str;
+	dbt->data = (gpointer) str;
 	dbt->size = strlen (str) + 1;
 	dbt->flags = DB_DBT_USERMEM;
 }
@@ -142,7 +142,7 @@ e_book_backend_db_cache_get_contact (DB *db, const gchar *uid)
 		return NULL;
 	}
 
-	contact = e_contact_new_from_vcard ((const gchar *)vcard_dbt.data);
+	contact = e_contact_new_from_vcard ((const gchar *) vcard_dbt.data);
 	g_free (vcard_dbt.data);
 	return contact;
 }
@@ -169,8 +169,8 @@ e_book_backend_db_cache_add_contact (DB *db,
 	if (!uid) {
 		printf ("no uid\n");
 		printf("name:%s, email:%s\n",
-			(gchar *)e_contact_get (contact, E_CONTACT_GIVEN_NAME),
-			(gchar *)e_contact_get (contact, E_CONTACT_EMAIL_1));
+			(gchar *) e_contact_get (contact, E_CONTACT_GIVEN_NAME),
+			(gchar *) e_contact_get (contact, E_CONTACT_EMAIL_1));
 		return FALSE;
 	}
 	string_to_dbt (uid, &uid_dbt);
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index 7867f4e..638735e 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -57,7 +57,7 @@ compare_im (EContact *contact, const gchar *str,
 		}
 	}
 
-	g_list_foreach (aims, (GFunc)g_free, NULL);
+	g_list_foreach (aims, (GFunc) g_free, NULL);
 	g_list_free (aims);
 
 	return found_it;
@@ -229,7 +229,7 @@ compare_category (EContact *contact, const gchar *str,
 		}
 	}
 
-	g_list_foreach (categories, (GFunc)g_free, NULL);
+	g_list_foreach (categories, (GFunc) g_free, NULL);
 	g_list_free (categories);
 
 	return ret_val;
@@ -393,7 +393,7 @@ static void
 contains_helper_free_word (gpointer data, gpointer user_data)
 {
 	if (data) {
-		g_string_free ((GString *)data, TRUE);
+		g_string_free ((GString *) data, TRUE);
 	}
 }
 
@@ -407,7 +407,7 @@ try_contains_word (const gchar *s1, GSList *word)
 	if (s1 == NULL)
 		return NULL;
 	if (word == NULL)
-		return (gchar *)s1; /* previous was last word */
+		return (gchar *) s1; /* previous was last word */
 	if (word->data == NULL)
 		return NULL; /* illegal structure */
 
@@ -434,7 +434,7 @@ try_contains_word (const gchar *s1, GSList *word)
 				/* we read whole word and no illegal character has been found */
 				if (word->next == NULL ||
 				    try_contains_word (e_util_unicode_get_utf8 (o, &unival), word->next)) {
-					return (gchar *)o;
+					return (gchar *) o;
 				}
 			}
 		}
@@ -501,7 +501,7 @@ contains_helper (const gchar *s1, const gchar *s2)
 
 	/* the initial word contains an empty string for sure */
 	if (!*s2)
-		return (gchar *)s1;
+		return (gchar *) s1;
 
 	s1uni = chars_to_unistring_lowercase (s1);
 	if (s1uni == NULL)
@@ -521,7 +521,7 @@ contains_helper (const gchar *s1, const gchar *s2)
 
 		/* both are empty strings */
 		if (len1 == len2)
-			return (gchar *)s1;
+			return (gchar *) s1;
 
 		return NULL;
 	}
@@ -590,7 +590,7 @@ is_helper (const gchar *ps1, const gchar *ps2)
 	s2 = e_util_utf8_remove_accents (ps2);
 
 	if (!e_util_utf8_strcasecmp (s1, s2))
-		res = (gchar *)ps1;
+		res = (gchar *) ps1;
 	else
 		res = NULL;
 
@@ -620,7 +620,7 @@ endswith_helper (const gchar *ps1, const gchar *ps2)
 	if (s1len < s2len)
 		res = NULL;
 	else
-		res = (gchar *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
+		res = (gchar *) e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -645,7 +645,7 @@ beginswith_helper (const gchar *ps1, const gchar *ps2)
 
 	if ((p = (gchar *) e_util_utf8_strstrcase (s1, s2))
 	    && (p == s1))
-		res = (gchar *)ps1;
+		res = (gchar *) ps1;
 	else
 		res = NULL;
 
@@ -670,7 +670,7 @@ exists_helper (const gchar *ps1, const gchar *ps2)
 	gchar *s1 = e_util_utf8_remove_accents (ps1);
 	gchar *s2 = e_util_utf8_remove_accents (ps2);
 
-	res = (gchar *)e_util_utf8_strstrcase (s1, s2);
+	res = (gchar *) e_util_utf8_strstrcase (s1, s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -875,7 +875,7 @@ e_book_backend_sexp_new (const gchar *text)
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp->priv->search_sexp, 0, symbols[i].name,
-					     (ESExpIFunc *)symbols[i].func, sexp->priv->search_context);
+					     (ESExpIFunc *) symbols[i].func, sexp->priv->search_context);
 		}
 		else {
 			e_sexp_add_function (sexp->priv->search_sexp, 0, symbols[i].name,
diff --git a/addressbook/libedata-book/e-book-backend-summary.c b/addressbook/libedata-book/e-book-backend-summary.c
index a2201cd..d5b3738 100644
--- a/addressbook/libedata-book/e-book-backend-summary.c
+++ b/addressbook/libedata-book/e-book-backend-summary.c
@@ -968,7 +968,7 @@ e_book_backend_summary_is_summary_query (EBookBackendSummary *summary, const gch
 	for (i = 0; i < G_N_ELEMENTS (check_symbols); i++) {
 		if (check_symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp, 0, check_symbols[i].name,
-					     (ESExpIFunc *)check_symbols[i].func, summary);
+					     (ESExpIFunc *) check_symbols[i].func, summary);
 		} else {
 			e_sexp_add_function (sexp, 0, check_symbols[i].name,
 					    check_symbols[i].func, summary);
@@ -1082,7 +1082,7 @@ is_helper (const gchar *ps1, const gchar *ps2)
 	gchar *res;
 
 	if (!e_util_utf8_strcasecmp (s1, s2))
-		res = (gchar *)ps1;
+		res = (gchar *) ps1;
 	else
 		res = NULL;
 
@@ -1112,7 +1112,7 @@ endswith_helper (const gchar *ps1, const gchar *ps2)
 	if (s1len < s2len)
 		res = NULL;
 	else
-		res = (gchar *)e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
+		res = (gchar *) e_util_utf8_strstrcase (g_utf8_offset_to_pointer (s1, s1len - s2len), s2);
 
 	g_free (s1);
 	g_free (s2);
@@ -1137,7 +1137,7 @@ beginswith_helper (const gchar *ps1, const gchar *ps2)
 
 	if ((p = (gchar *) e_util_utf8_strstrcase (s1, s2))
 	    && (p == s1))
-		res = (gchar *)ps1;
+		res = (gchar *) ps1;
 	else
 		res = NULL;
 
@@ -1193,7 +1193,7 @@ e_book_backend_summary_search (EBookBackendSummary *summary, const gchar *query)
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp, 0, symbols[i].name,
-					     (ESExpIFunc *)symbols[i].func, summary);
+					     (ESExpIFunc *) symbols[i].func, summary);
 		} else {
 			e_sexp_add_function (sexp, 0, symbols[i].name,
 					    symbols[i].func, summary);
diff --git a/addressbook/libedata-book/e-book-backend-sync.c b/addressbook/libedata-book/e-book-backend-sync.c
index 4492441..1f0a134 100644
--- a/addressbook/libedata-book/e-book-backend-sync.c
+++ b/addressbook/libedata-book/e-book-backend-sync.c
@@ -487,7 +487,7 @@ _e_book_backend_get_required_fields (EBookBackend *backend,
 	e_data_book_respond_get_required_fields (book, opid, error, fields);
 
 	if (fields) {
-		g_list_foreach (fields, (GFunc)g_free, NULL);
+		g_list_foreach (fields, (GFunc) g_free, NULL);
 		g_list_free (fields);
 	}
 }
@@ -505,7 +505,7 @@ _e_book_backend_get_supported_fields (EBookBackend *backend,
 	e_data_book_respond_get_supported_fields (book, opid, error, fields);
 
 	if (fields) {
-		g_list_foreach (fields, (GFunc)g_free, NULL);
+		g_list_foreach (fields, (GFunc) g_free, NULL);
 		g_list_free (fields);
 	}
 }
@@ -523,7 +523,7 @@ _e_book_backend_get_supported_auth_methods (EBookBackend *backend,
 	e_data_book_respond_get_supported_auth_methods (book, opid, error, methods);
 
 	if (methods) {
-		g_list_foreach (methods, (GFunc)g_free, NULL);
+		g_list_foreach (methods, (GFunc) g_free, NULL);
 		g_list_free (methods);
 	}
 }
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 88228ac..ad0492b 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -1097,7 +1097,7 @@ e_book_backend_foreach_view (EBookBackend *backend,
 	iter = e_list_get_iterator (views);
 
 	while (e_iterator_is_valid (iter)) {
-		view = (EDataBookView*)e_iterator_get (iter);
+		view = (EDataBookView*) e_iterator_get (iter);
 
 		e_data_book_view_ref (view);
 		callback (view, user_data);
@@ -1155,7 +1155,7 @@ view_notify_remove (EDataBookView *view, gpointer id)
 void
 e_book_backend_notify_remove (EBookBackend *backend, const gchar *id)
 {
-	e_book_backend_foreach_view (backend, view_notify_remove, (gpointer)id);
+	e_book_backend_foreach_view (backend, view_notify_remove, (gpointer) id);
 }
 
 static void
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index ccd109f..71a98c2 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -131,7 +131,7 @@ operation_thread (gpointer data, gpointer user_data)
 		break;
 	case OP_REMOVE_CONTACTS:
 		e_book_backend_remove_contacts (backend, op->book, op->id, op->d.ids);
-		g_list_foreach (op->d.ids, (GFunc)g_free, NULL);
+		g_list_foreach (op->d.ids, (GFunc) g_free, NULL);
 		g_list_free (op->d.ids);
 		break;
 	case OP_GET_CHANGES:
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index 63f5259..98afd27 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -1693,14 +1693,14 @@ remove_complist_from_cache_and_notify_cb (gpointer key, gpointer value, gpointer
 		if (e_cal_backend_store_remove_component (priv->store, id->uid, id->rid)) {
 			gchar *old_str = e_cal_component_get_as_string (old_comp);
 
-			e_cal_backend_notify_object_removed ((ECalBackend *)cbdav, id, old_str, NULL);
+			e_cal_backend_notify_object_removed ((ECalBackend *) cbdav, id, old_str, NULL);
 
 			g_free (old_str);
 		}
 
 		e_cal_component_free_id (id);
 	}
-	remove_cached_attachment (cbdav, (const gchar *)key);
+	remove_cached_attachment (cbdav, (const gchar *) key);
 
 	return FALSE;
 }
@@ -1760,7 +1760,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav, time_t start_time, time_t end_time)
 	/* do not store changes in cache immediately - makes things significantly quicker */
 	e_cal_backend_store_freeze_changes (priv->store);
 
-	c_uid2complist = g_tree_new_full ((GCompareDataFunc)g_strcmp0, NULL, g_free, free_comp_list);
+	c_uid2complist = g_tree_new_full ((GCompareDataFunc) g_strcmp0, NULL, g_free, free_comp_list);
 	c_href2uid = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
 	/* fill indexed hash and tree with cached components */
@@ -1800,7 +1800,7 @@ synchronize_cache (ECalBackendCalDAV *cbdav, time_t start_time, time_t end_time)
 			/* uid is from a component or c_uid2complist key, thus will not be
 			   freed before a removal from c_uid2complist, thus do not duplicate it,
 			   rather save memory */
-			g_hash_table_insert (c_href2uid, href, (gpointer)uid);
+			g_hash_table_insert (c_href2uid, href, (gpointer) uid);
 		} else {
 			g_free (href);
 		}
@@ -2607,8 +2607,8 @@ remove_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar
 		GSList *objects = e_cal_backend_store_get_components_by_uid (priv->store, uid);
 
 		if (objects) {
-			g_slist_foreach (objects, (GFunc)remove_comp_from_cache_cb, priv->store);
-			g_slist_foreach (objects, (GFunc)g_object_unref, NULL);
+			g_slist_foreach (objects, (GFunc) remove_comp_from_cache_cb, priv->store);
+			g_slist_foreach (objects, (GFunc) g_object_unref, NULL);
 			g_slist_free (objects);
 
 			res = TRUE;
@@ -2636,8 +2636,8 @@ sort_master_first (gconstpointer a, gconstpointer b)
 {
 	icalcomponent *ca, *cb;
 
-	ca = e_cal_component_get_icalcomponent ((ECalComponent *)a);
-	cb = e_cal_component_get_icalcomponent ((ECalComponent *)b);
+	ca = e_cal_component_get_icalcomponent ((ECalComponent *) a);
+	cb = e_cal_component_get_icalcomponent ((ECalComponent *) b);
 
 	if (!ca) {
 		if (!cb)
@@ -2692,7 +2692,7 @@ get_comp_from_cache (ECalBackendCalDAV *cbdav, const gchar *uid, const gchar *ri
 		if (etag)
 			*etag = ecalcomp_get_etag (objects->data);
 
-		g_slist_foreach (objects, (GFunc)g_object_unref, NULL);
+		g_slist_foreach (objects, (GFunc) g_object_unref, NULL);
 		g_slist_free (objects);
 	} else {
 		/* get the exact object */
@@ -2821,7 +2821,7 @@ convert_to_inline_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 	     p = icalcomponent_get_next_property (icalcomp, ICAL_ATTACH_PROPERTY)) {
 		icalattach *attach;
 
-		attach = icalproperty_get_attach ((const icalproperty *)p);
+		attach = icalproperty_get_attach ((const icalproperty *) p);
 		if (icalattach_get_is_url (attach)) {
 			const gchar *url;
 
@@ -2845,7 +2845,7 @@ convert_to_inline_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 		gchar *content;
 		gsize len;
 
-		attach = icalproperty_get_attach ((const icalproperty *)p);
+		attach = icalproperty_get_attach ((const icalproperty *) p);
 		if (!icalattach_get_is_url (attach))
 			continue;
 
@@ -2916,7 +2916,7 @@ convert_to_url_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 	     p = icalcomponent_get_next_property (icalcomp, ICAL_ATTACH_PROPERTY)) {
 		icalattach *attach;
 
-		attach = icalproperty_get_attach ((const icalproperty *)p);
+		attach = icalproperty_get_attach ((const icalproperty *) p);
 		if (!icalattach_get_is_url (attach))
 			to_remove = g_slist_prepend (to_remove, p);
 	}
@@ -2930,7 +2930,7 @@ convert_to_url_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 		icalattach *attach;
 		gchar *dir;
 
-		attach = icalproperty_get_attach ((const icalproperty *)p);
+		attach = icalproperty_get_attach ((const icalproperty *) p);
 		if (icalattach_get_is_url (attach))
 			continue;
 
@@ -2949,8 +2949,8 @@ convert_to_url_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 			dest = g_build_filename (dir, basename, NULL);
 			g_free (basename);
 
-			content = (gchar *)icalattach_get_data (attach);
-			decoded = (gchar *)g_base64_decode (content, &len);
+			content = (gchar *) icalattach_get_data (attach);
+			decoded = (gchar *) g_base64_decode (content, &len);
 			if (g_file_set_contents (dest, decoded, len, &error) == TRUE) {
 				icalproperty *prop;
 				gchar *url;
@@ -3018,7 +3018,7 @@ remove_cached_attachment (ECalBackendCalDAV *cbdav, const gchar *uid)
 	priv = cbdav->priv;
 	l = e_cal_backend_store_get_components_by_uid (priv->store, uid);
 	len = g_slist_length (l);
-	g_slist_foreach (l, (GFunc)g_object_unref, NULL);
+	g_slist_foreach (l, (GFunc) g_object_unref, NULL);
 	g_slist_free (l);
 	if (len > 0)
 		return;
@@ -3143,7 +3143,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((gchar *)dt.tzid);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtstart (comp, &dt);
 		}
@@ -3155,7 +3155,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((gchar *)dt.tzid);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtend (comp, &dt);
 		}
@@ -3167,7 +3167,7 @@ sanitize_component (ECalBackend *cb, ECalComponent *comp)
 		zone = caldav_internal_get_timezone (cb, dt.tzid);
 		if (!zone) {
 			default_zone = caldav_internal_get_default_timezone (cb);
-			g_free ((gchar *)dt.tzid);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_due (comp, &dt);
 		}
@@ -3367,7 +3367,7 @@ do_create_object (ECalBackendCalDAV *cbdav, gchar **calobj, gchar **uid, GError
 	e_cal_component_set_last_modified (comp, &current);
 
 	/* sanitize the component*/
-	sanitize_component ((ECalBackend *)cbdav, comp);
+	sanitize_component ((ECalBackend *) cbdav, comp);
 
 	if (online) {
 		CalDAVObject object;
@@ -3446,7 +3446,7 @@ do_modify_object (ECalBackendCalDAV *cbdav, const gchar *calobj, CalObjModType m
 	e_cal_component_set_last_modified (comp, &current);
 
 	/* sanitize the component */
-	sanitize_component ((ECalBackend *)cbdav, comp);
+	sanitize_component ((ECalBackend *) cbdav, comp);
 
 	id = e_cal_component_get_id (comp);
 	e_return_data_cal_error_if_fail (id != NULL, InvalidObject);
@@ -4377,7 +4377,7 @@ caldav_get_free_busy (ECalBackendSync  *backend,
 							}
 						}
 
-						g_list_foreach (objects, (GFunc)icalcomponent_free, NULL);
+						g_list_foreach (objects, (GFunc) icalcomponent_free, NULL);
 						g_list_free (objects);
 
 						if (icalcomp)
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index e8cf1cb..7d9866f 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -131,9 +131,9 @@ book_record_new (ECalBackendContacts *cbc, ESource *source)
 	}
 
         /* Create book view */
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_BIRTH_DATE));
-	fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_ANNIVERSARY));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_FILE_AS));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_BIRTH_DATE));
+	fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_ANNIVERSARY));
         query = e_book_query_any_field_contains ("");
 
 	if (!e_book_get_book_view (book, query, fields, -1, &book_view, &error)) {
@@ -437,7 +437,7 @@ contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_
                 /* Because this is a change of contact, then always remove old tracked data
 		   and if possible, add with (possibly) new values.
 		*/
-		g_hash_table_remove (cbc->priv->tracked_contacts, (gchar *)uid);
+		g_hash_table_remove (cbc->priv->tracked_contacts, (gchar *) uid);
 
 		birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
 		anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
@@ -1025,7 +1025,7 @@ e_cal_backend_contacts_open (ECalBackendSync *backend, EDataCal *cal,
 	}
 
 	/* initialize addressbook sources in new thread to make this function quick as much as possible */
-	if (!g_thread_create ((GThreadFunc)init_sources_cb, cbc, FALSE, &error)) {
+	if (!g_thread_create ((GThreadFunc) init_sources_cb, cbc, FALSE, &error)) {
 		e_flag_set (priv->init_done_flag);
 		g_warning ("%s: Cannot create thread to initialize sources! (%s)", G_STRFUNC, error ? error->message : "Unknown error");
 		if (error)
@@ -1253,7 +1253,7 @@ e_cal_backend_contacts_init (ECalBackendContacts *cbc)
 	priv->addressbooks = g_hash_table_new_full (g_str_hash, g_str_equal,
 						    g_free, (GDestroyNotify) book_record_free);
 	priv->tracked_contacts = g_hash_table_new_full (g_str_hash, g_str_equal,
-							g_free, (GDestroyNotify)contact_record_free);
+							g_free, (GDestroyNotify) contact_record_free);
 
 	priv->zones = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_zone);
 	priv->default_zone = icaltimezone_get_utc_timezone ();
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 7aff3f6..0bbd4aa 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -1807,7 +1807,7 @@ e_cal_backend_file_get_object_list (ECalBackendSync *backend, EDataCal *cal, con
 	*objects = match_data.obj_list;
 
 	if (objs_occuring_in_tw) {
-		g_list_foreach (objs_occuring_in_tw, (GFunc)g_object_unref, NULL);
+		g_list_foreach (objs_occuring_in_tw, (GFunc) g_object_unref, NULL);
 		g_list_free (objs_occuring_in_tw);
 	}
 
@@ -1895,7 +1895,7 @@ e_cal_backend_file_start_query (ECalBackend *backend, EDataCalView *query)
 	}
 
 	if (objs_occuring_in_tw) {
-		g_list_foreach (objs_occuring_in_tw, (GFunc)g_object_unref, NULL);
+		g_list_foreach (objs_occuring_in_tw, (GFunc) g_object_unref, NULL);
 		g_list_free (objs_occuring_in_tw);
 	}
 	g_object_unref (match_data.obj_sexp);
@@ -2151,7 +2151,7 @@ e_cal_backend_file_compute_changes (ECalBackendFile *cbfile, const gchar *change
 	be_data.deletes = NULL;
 	be_data.ehash = ehash;
 
-	e_xmlhash_foreach_key_remove (ehash, (EXmlHashRemoveFunc)e_cal_backend_file_compute_changes_foreach_key, &be_data);
+	e_xmlhash_foreach_key_remove (ehash, (EXmlHashRemoveFunc) e_cal_backend_file_compute_changes_foreach_key, &be_data);
 
 	*deletes = be_data.deletes;
 
@@ -2237,10 +2237,10 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 	 * list */
 	e_cal_component_get_dtstart (comp, &dt);
 	if (dt.value && dt.tzid) {
-		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
+		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *) cbfile, dt.tzid);
 		if (!zone) {
-			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((gchar *)dt.tzid);
+			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *) cbfile);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtstart (comp, &dt);
 		}
@@ -2249,10 +2249,10 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 
 	e_cal_component_get_dtend (comp, &dt);
 	if (dt.value && dt.tzid) {
-		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
+		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *) cbfile, dt.tzid);
 		if (!zone) {
-			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((gchar *)dt.tzid);
+			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *) cbfile);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_dtend (comp, &dt);
 		}
@@ -2261,10 +2261,10 @@ sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
 
 	e_cal_component_get_due (comp, &dt);
 	if (dt.value && dt.tzid) {
-		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *)cbfile, dt.tzid);
+		zone = e_cal_backend_file_internal_get_timezone ((ECalBackend *) cbfile, dt.tzid);
 		if (!zone) {
-			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *)cbfile);
-			g_free ((gchar *)dt.tzid);
+			default_zone = e_cal_backend_file_internal_get_default_timezone ((ECalBackend *) cbfile);
+			g_free ((gchar *) dt.tzid);
 			dt.tzid = g_strdup (icaltimezone_get_tzid (default_zone));
 			e_cal_component_set_due (comp, &dt);
 		}
@@ -2871,7 +2871,7 @@ fetch_attachments (ECalBackendSync *backend, ECalComponent *comp)
 		user_data_dir, "calendar", "system", NULL);
 
 	for (l = attach_list; l; l = l->next) {
-		gchar *sfname = g_filename_from_uri ((const gchar *)l->data, NULL, NULL);
+		gchar *sfname = g_filename_from_uri ((const gchar *) l->data, NULL, NULL);
 		gchar *filename, *new_filename;
 		GMappedFile *mapped_file;
 		GError *error = NULL;
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index dfcc56a..7bf25e7 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -1236,7 +1236,7 @@ create_user_free_busy (ECalBackendHttp *cbhttp, const gchar *address, const gcha
 						vfb,
 						resolve_tzid,
 						vcalendar_comp,
-						(icaltimezone *)e_cal_backend_store_get_default_timezone (store));
+						(icaltimezone *) e_cal_backend_store_get_default_timezone (store));
 	}
 	g_object_unref (obj_sexp);
 
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index 6e62126..1886a3b 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -431,7 +431,7 @@ create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_foreca
 	}
 	comp_summary.altrep = NULL;
 	e_cal_component_set_summary (cal_comp, &comp_summary);
-	g_free ((gchar *)comp_summary.value);
+	g_free ((gchar *) comp_summary.value);
 
 	tmp = weather_info_get_forecast (report);
 	comp_summary.value = weather_info_get_weather_summary (report);
@@ -441,7 +441,7 @@ create_weather (ECalBackendWeather *cbw, WeatherInfo *report, gboolean is_foreca
 	description->altrep = "";
 	text_list = g_slist_append (text_list, description);
 	e_cal_component_set_description_list (cal_comp, text_list);
-	g_free ((gchar *)comp_summary.value);
+	g_free ((gchar *) comp_summary.value);
 
 	/* Set category and visibility */
 	e_cal_component_set_categories (cal_comp, getCategory (report));
diff --git a/calendar/backends/weather/e-weather-source-ccf.c b/calendar/backends/weather/e-weather-source-ccf.c
index f20b802..f8735ec 100644
--- a/calendar/backends/weather/e-weather-source-ccf.c
+++ b/calendar/backends/weather/e-weather-source-ccf.c
@@ -67,7 +67,7 @@ static gboolean
 find_location_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *node, gpointer data)
 {
 	WeatherLocation *wl = NULL;
-	struct search_struct *search = (struct search_struct *)data;
+	struct search_struct *search = (struct search_struct *) data;
 
 	gtk_tree_model_get (model, node, GWEATHER_XML_COL_POINTER, &wl, -1);
 	if (!wl || !wl->name || !wl->code || !search || search->location)
diff --git a/calendar/libecal/e-cal-check-timezones.c b/calendar/libecal/e-cal-check-timezones.c
index 3e10744..5da2cdf 100644
--- a/calendar/libecal/e-cal-check-timezones.c
+++ b/calendar/libecal/e-cal-check-timezones.c
@@ -465,7 +465,7 @@ e_cal_tzlookup_ecal (const gchar *tzid,
                      gconstpointer custom,
                      GError **error)
 {
-	ECal *ecal = (ECal *)custom;
+	ECal *ecal = (ECal *) custom;
 	icaltimezone *zone = NULL;
 	GError *local_error = NULL;
 
@@ -503,7 +503,7 @@ e_cal_tzlookup_icomp (const gchar *tzid,
                       gconstpointer custom,
                       GError **error)
 {
-    icalcomponent *icomp = (icalcomponent *)custom;
+    icalcomponent *icomp = (icalcomponent *) custom;
 
-    return icalcomponent_get_timezone (icomp, (gchar *)tzid);
+    return icalcomponent_get_timezone (icomp, (gchar *) tzid);
 }
diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c
index 21f8f6f..7da9ad9 100644
--- a/calendar/libecal/e-cal-component.c
+++ b/calendar/libecal/e-cal-component.c
@@ -1630,7 +1630,7 @@ set_attachment_list (icalcomponent *icalcomp,
 		gchar *buf;
 
 		attachment = g_new0 (struct attachment, 1);
-		buf_size = 2 * strlen ((gchar *)l->data);
+		buf_size = 2 * strlen ((gchar *) l->data);
 		buf = g_malloc0 (buf_size);
 		icalvalue_encode_ical_string (l->data, buf, buf_size);
 		attachment->attach = icalattach_new_from_url ((gchar *) buf);
@@ -4848,7 +4848,7 @@ e_cal_component_free_datetime (ECalComponentDateTime *dt)
 	g_return_if_fail (dt != NULL);
 
 	g_free (dt->value);
-	g_free ((gchar *)dt->tzid);
+	g_free ((gchar *) dt->tzid);
 
 	dt->value = NULL;
 	dt->tzid = NULL;
@@ -4888,7 +4888,7 @@ e_cal_component_free_exdate_list (GSList *exdate_list)
 
 		g_return_if_fail (cdt->value != NULL);
 		g_free (cdt->value);
-		g_free ((gchar *)cdt->tzid);
+		g_free ((gchar *) cdt->tzid);
 
 		g_free (cdt);
 	}
diff --git a/calendar/libecal/e-cal-view.c b/calendar/libecal/e-cal-view.c
index 379df5f..98f6df7 100644
--- a/calendar/libecal/e-cal-view.c
+++ b/calendar/libecal/e-cal-view.c
@@ -72,7 +72,7 @@ build_object_list (const gchar * const *seq)
 	for (i = 0; seq[i]; i++) {
 		icalcomponent *comp;
 
-		comp = icalcomponent_new_from_string ((gchar *)seq[i]);
+		comp = icalcomponent_new_from_string ((gchar *) seq[i]);
 		if (!comp)
 			continue;
 
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index b38d639..b7d0e70 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -1742,7 +1742,7 @@ e_cal_get_local_attachment_store (ECal *ecal)
 	g_return_val_if_fail (E_IS_CAL (ecal), NULL);
 
 	priv = ecal->priv;
-	return (const gchar *)priv->local_attachment_store;
+	return (const gchar *) priv->local_attachment_store;
 }
 
 /**
@@ -2647,7 +2647,7 @@ build_free_busy_list (const gchar **seq)
 		icalcomponent *icalcomp;
 		icalcomponent_kind kind;
 
-		icalcomp = icalcomponent_new_from_string ((gchar *)seq[i]);
+		icalcomp = icalcomponent_new_from_string ((gchar *) seq[i]);
 		if (!icalcomp)
 			continue;
 
diff --git a/calendar/libedata-cal/e-cal-backend-cache.c b/calendar/libedata-cal/e-cal-backend-cache.c
index f90e19d..c304a70 100644
--- a/calendar/libedata-cal/e-cal-backend-cache.c
+++ b/calendar/libedata-cal/e-cal-backend-cache.c
@@ -405,18 +405,18 @@ e_cal_backend_cache_put_timezone (ECalBackendCache *cache, const icaltimezone *z
 	priv = cache->priv;
 
 	/* add the timezone to the cache file */
-	icalcomp = icaltimezone_get_component ((icaltimezone *)zone);
+	icalcomp = icaltimezone_get_component ((icaltimezone *) zone);
 	if (!icalcomp)
 		return FALSE;
 
 	obj = icalcomponent_as_ical_string_r (icalcomp);
-	if (e_file_cache_get_object (E_FILE_CACHE (cache), icaltimezone_get_tzid ((icaltimezone *)zone))) {
+	if (e_file_cache_get_object (E_FILE_CACHE (cache), icaltimezone_get_tzid ((icaltimezone *) zone))) {
 		retval = e_file_cache_replace_object (E_FILE_CACHE (cache),
-						      icaltimezone_get_tzid ((icaltimezone *)zone),
+						      icaltimezone_get_tzid ((icaltimezone *) zone),
 						      obj);
 	} else {
 		retval = e_file_cache_add_object (E_FILE_CACHE (cache),
-						  icaltimezone_get_tzid ((icaltimezone *)zone),
+						  icaltimezone_get_tzid ((icaltimezone *) zone),
 						  obj);
 	}
 	g_free (obj);
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index e408d3d..729285f 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -1386,7 +1386,7 @@ e_cal_backend_sexp_new (const gchar *text)
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
 			e_sexp_add_ifunction (sexp->priv->search_sexp, 0, symbols[i].name,
-					     (ESExpIFunc *)symbols[i].func, sexp->priv->search_context);
+					     (ESExpIFunc *) symbols[i].func, sexp->priv->search_context);
 		} else {
 			e_sexp_add_function (sexp->priv->search_sexp, 0, symbols[i].name,
 					    symbols[i].func, sexp->priv->search_context);
diff --git a/calendar/libedata-cal/e-data-cal-view.c b/calendar/libedata-cal/e-data-cal-view.c
index d8b1b1a..78407aa 100644
--- a/calendar/libedata-cal/e-data-cal-view.c
+++ b/calendar/libedata-cal/e-data-cal-view.c
@@ -410,7 +410,7 @@ e_data_cal_view_init (EDataCalView *query)
 	priv->changes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD_ITEMS);
 	priv->removes = g_array_sized_new (TRUE, TRUE, sizeof (gchar *), THRESHOLD_ITEMS);
 
-	priv->ids = g_hash_table_new_full (id_hash, id_equal, (GDestroyNotify)e_cal_component_free_id, NULL);
+	priv->ids = g_hash_table_new_full (id_hash, id_equal, (GDestroyNotify) e_cal_component_free_id, NULL);
 
 	priv->pending_mutex = g_mutex_new ();
 	priv->flush_id = 0;
@@ -642,7 +642,7 @@ e_data_cal_view_notify_objects_added_1 (EDataCalView *view, const gchar *object)
 	g_return_if_fail (view && E_IS_DATA_CAL_VIEW (view));
 	g_return_if_fail (object);
 
-	l.data = (gpointer)object;
+	l.data = (gpointer) object;
 	e_data_cal_view_notify_objects_added (view, &l);
 }
 
@@ -690,7 +690,7 @@ e_data_cal_view_notify_objects_modified_1 (EDataCalView *view, const gchar *obje
 	g_return_if_fail (view && E_IS_DATA_CAL_VIEW (view));
 	g_return_if_fail (object);
 
-	l.data = (gpointer)object;
+	l.data = (gpointer) object;
 	e_data_cal_view_notify_objects_modified (view, &l);
 }
 
@@ -739,7 +739,7 @@ e_data_cal_view_notify_objects_removed_1 (EDataCalView *view, const ECalComponen
 	g_return_if_fail (view && E_IS_DATA_CAL_VIEW (view));
 	g_return_if_fail (id);
 
-	l.data = (gpointer)id;
+	l.data = (gpointer) id;
 	e_data_cal_view_notify_objects_removed (view, &l);
 }
 
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 87e9dd6..2e7d580 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -376,11 +376,11 @@ impl_Cal_getFreeBusy (EGdbusCal *object, GDBusMethodInvocation *invocation, cons
 		gint i;
 
 		for (i = 0; user_list[i]; i++)
-			users = g_list_append (users, (gpointer)user_list[i]);
+			users = g_list_append (users, (gpointer) user_list[i]);
 	}
 
 	/* call the backend's get_free_busy method */
-	e_cal_backend_get_free_busy (cal->priv->backend, cal, invocation, users, (time_t)start, (time_t)end);
+	e_cal_backend_get_free_busy (cal->priv->backend, cal, invocation, users, (time_t) start, (time_t) end);
 
 	return TRUE;
 }
diff --git a/camel/camel-block-file.c b/camel/camel-block-file.c
index 0b93d2a..1dd811b 100644
--- a/camel/camel-block-file.c
+++ b/camel/camel-block-file.c
@@ -156,10 +156,10 @@ block_file_finalize (GObject *object)
 	LOCK (block_file_lock);
 	if (bs->fd != -1)
 		block_file_count--;
-	camel_dlist_remove ((CamelDListNode *)p);
+	camel_dlist_remove ((CamelDListNode *) p);
 	UNLOCK (block_file_lock);
 
-	bl = (CamelBlock *)bs->block_cache.head;
+	bl = (CamelBlock *) bs->block_cache.head;
 	bn = bl->next;
 	while (bn) {
 		if (bl->refcount != 0)
@@ -213,7 +213,7 @@ camel_block_file_init (CamelBlockFile *bs)
 	bs->fd = -1;
 	bs->block_size = CAMEL_BLOCK_SIZE;
 	camel_dlist_init (&bs->block_cache);
-	bs->blocks = g_hash_table_new ((GHashFunc)block_hash_func, NULL);
+	bs->blocks = g_hash_table_new ((GHashFunc) block_hash_func, NULL);
 	/* this cache size and the text index size have been tuned for about the best
 	   with moderate memory usage.  Doubling the memory usage barely affects performance. */
 	bs->block_cache_limit = 256;
@@ -227,7 +227,7 @@ camel_block_file_init (CamelBlockFile *bs)
 
 	/* link into lru list */
 	LOCK (block_file_lock);
-	camel_dlist_addhead (&block_file_list, (CamelDListNode *)p);
+	camel_dlist_addhead (&block_file_list, (CamelDListNode *) p);
 
 #if 0
 	{
@@ -281,12 +281,12 @@ block_file_use (CamelBlockFile *bs)
 	}
 
 	LOCK (block_file_lock);
-	camel_dlist_remove ((CamelDListNode *)p);
-	camel_dlist_addtail (&block_file_active_list, (CamelDListNode *)p);
+	camel_dlist_remove ((CamelDListNode *) p);
+	camel_dlist_addtail (&block_file_active_list, (CamelDListNode *) p);
 
 	block_file_count++;
 
-	nw = (struct _CamelBlockFilePrivate *)block_file_list.head;
+	nw = (struct _CamelBlockFilePrivate *) block_file_list.head;
 	nn = nw->next;
 	while (block_file_count > block_file_threshhold && nn) {
 		/* We never hit the current blockfile here, as its removed from the list first */
@@ -322,8 +322,8 @@ static void
 block_file_unuse (CamelBlockFile *bs)
 {
 	LOCK (block_file_lock);
-	camel_dlist_remove ((CamelDListNode *)bs->priv);
-	camel_dlist_addtail (&block_file_list, (CamelDListNode *)bs->priv);
+	camel_dlist_remove ((CamelDListNode *) bs->priv);
+	camel_dlist_addtail (&block_file_list, (CamelDListNode *) bs->priv);
 	UNLOCK (block_file_lock);
 
 	CAMEL_BLOCK_FILE_UNLOCK (bs, io_lock);
@@ -480,7 +480,7 @@ camel_block_file_new_block (CamelBlockFile *bs)
 		bl = camel_block_file_get_block (bs, bs->root->free);
 		if (bl == NULL)
 			goto fail;
-		bs->root->free = ((camel_block_t *)bl->data)[0];
+		bs->root->free = ((camel_block_t *) bl->data)[0];
 	} else {
 		bl = camel_block_file_get_block (bs, bs->root->last);
 		if (bl == NULL)
@@ -519,7 +519,7 @@ camel_block_file_free_block (CamelBlockFile *bs,
 
 	CAMEL_BLOCK_FILE_LOCK (bs, root_lock);
 
-	((camel_block_t *)bl->data)[0] = bs->root->free;
+	((camel_block_t *) bl->data)[0] = bs->root->free;
 	bs->root->free = bl->id;
 	bs->root_block->flags |= CAMEL_BLOCK_DIRTY;
 	bl->flags |= CAMEL_BLOCK_DIRTY;
@@ -584,13 +584,13 @@ camel_block_file_get_block (CamelBlockFile *bs,
 		g_hash_table_insert (bs->blocks, GUINT_TO_POINTER (bl->id), bl);
 
 		/* flush old blocks */
-		flush = (CamelBlock *)bs->block_cache.tailpred;
+		flush = (CamelBlock *) bs->block_cache.tailpred;
 		prev = flush->prev;
 		while (bs->block_cache_count > bs->block_cache_limit && prev) {
 			if (flush->refcount == 0) {
 				if (sync_block_nolock (bs, flush) != -1) {
 					g_hash_table_remove (bs->blocks, GUINT_TO_POINTER (flush->id));
-					camel_dlist_remove ((CamelDListNode *)flush);
+					camel_dlist_remove ((CamelDListNode *) flush);
 					g_free (flush);
 					bs->block_cache_count--;
 				}
@@ -601,10 +601,10 @@ camel_block_file_get_block (CamelBlockFile *bs,
 		/* UNLOCK io_lock */
 		block_file_unuse (bs);
 	} else {
-		camel_dlist_remove ((CamelDListNode *)bl);
+		camel_dlist_remove ((CamelDListNode *) bl);
 	}
 
-	camel_dlist_addhead (&bs->block_cache, (CamelDListNode *)bl);
+	camel_dlist_addhead (&bs->block_cache, (CamelDListNode *) bl);
 	bl->refcount++;
 
 	CAMEL_BLOCK_FILE_UNLOCK (bs, cache_lock);
@@ -633,7 +633,7 @@ camel_block_file_detach_block (CamelBlockFile *bs, CamelBlock *bl)
 	CAMEL_BLOCK_FILE_LOCK (bs, cache_lock);
 
 	g_hash_table_remove (bs->blocks, GUINT_TO_POINTER (bl->id));
-	camel_dlist_remove ((CamelDListNode *)bl);
+	camel_dlist_remove ((CamelDListNode *) bl);
 	bl->flags |= CAMEL_BLOCK_DETACHED;
 
 	CAMEL_BLOCK_FILE_UNLOCK (bs, cache_lock);
@@ -655,7 +655,7 @@ camel_block_file_attach_block (CamelBlockFile *bs, CamelBlock *bl)
 	CAMEL_BLOCK_FILE_LOCK (bs, cache_lock);
 
 	g_hash_table_insert (bs->blocks, GUINT_TO_POINTER (bl->id), bl);
-	camel_dlist_addtail (&bs->block_cache, (CamelDListNode *)bl);
+	camel_dlist_addtail (&bs->block_cache, (CamelDListNode *) bl);
 	bl->flags &= ~CAMEL_BLOCK_DETACHED;
 
 	CAMEL_BLOCK_FILE_UNLOCK (bs, cache_lock);
@@ -740,7 +740,7 @@ sync_nolock (CamelBlockFile *bs)
 	CamelBlock *bl, *bn;
 	gint work = FALSE;
 
-	bl = (CamelBlock *)bs->block_cache.head;
+	bl = (CamelBlock *) bs->block_cache.head;
 	bn = bl->next;
 	while (bn) {
 		if (bl->flags & CAMEL_BLOCK_DIRTY) {
@@ -858,7 +858,7 @@ key_file_finalize (GObject *object)
 	struct _CamelKeyFilePrivate *p = bs->priv;
 
 	LOCK (key_file_lock);
-	camel_dlist_remove ((CamelDListNode *)p);
+	camel_dlist_remove ((CamelDListNode *) p);
 
 	if (bs-> fp) {
 		key_file_count--;
@@ -897,7 +897,7 @@ camel_key_file_init (CamelKeyFile *bs)
 	g_static_mutex_init (&p->lock);
 
 	LOCK (key_file_lock);
-	camel_dlist_addhead (&key_file_list, (CamelDListNode *)p);
+	camel_dlist_addhead (&key_file_list, (CamelDListNode *) p);
 	UNLOCK (key_file_lock);
 }
 
@@ -949,12 +949,12 @@ key_file_use (CamelKeyFile *bs)
 	}
 
 	LOCK (key_file_lock);
-	camel_dlist_remove ((CamelDListNode *)p);
-	camel_dlist_addtail (&key_file_active_list, (CamelDListNode *)p);
+	camel_dlist_remove ((CamelDListNode *) p);
+	camel_dlist_addtail (&key_file_active_list, (CamelDListNode *) p);
 
 	key_file_count++;
 
-	nw = (struct _CamelKeyFilePrivate *)key_file_list.head;
+	nw = (struct _CamelKeyFilePrivate *) key_file_list.head;
 	nn = nw->next;
 	while (key_file_count > key_file_threshhold && nn) {
 		/* We never hit the current keyfile here, as its removed from the list first */
@@ -983,8 +983,8 @@ static void
 key_file_unuse (CamelKeyFile *bs)
 {
 	LOCK (key_file_lock);
-	camel_dlist_remove ((CamelDListNode *)bs->priv);
-	camel_dlist_addtail (&key_file_list, (CamelDListNode *)bs->priv);
+	camel_dlist_remove ((CamelDListNode *) bs->priv);
+	camel_dlist_addtail (&key_file_list, (CamelDListNode *) bs->priv);
 	UNLOCK (key_file_lock);
 
 	CAMEL_KEY_FILE_UNLOCK (bs, lock);
diff --git a/camel/camel-cipher-context.c b/camel/camel-cipher-context.c
index 623e086..ee9442b 100644
--- a/camel/camel-cipher-context.c
+++ b/camel/camel-cipher-context.c
@@ -1594,7 +1594,7 @@ camel_cipher_validity_clone (CamelCipherValidity *vin)
 	vo->encrypt.status = vin->encrypt.status;
 	vo->encrypt.description = g_strdup (vin->encrypt.description);
 
-	info = (CamelCipherCertInfo *)vin->sign.signers.head;
+	info = (CamelCipherCertInfo *) vin->sign.signers.head;
 	while (info->next) {
 		if (info->cert_data && info->cert_data_clone && info->cert_data_free)
 			camel_cipher_validity_add_certinfo_ex (vo, CAMEL_CIPHER_VALIDITY_SIGN, info->name, info->email, info->cert_data_clone (info->cert_data), info->cert_data_free, info->cert_data_clone);
@@ -1603,7 +1603,7 @@ camel_cipher_validity_clone (CamelCipherValidity *vin)
 		info = info->next;
 	}
 
-	info = (CamelCipherCertInfo *)vin->encrypt.encrypters.head;
+	info = (CamelCipherCertInfo *) vin->encrypt.encrypters.head;
 	while (info->next) {
 		if (info->cert_data && info->cert_data_clone && info->cert_data_free)
 			camel_cipher_validity_add_certinfo_ex (vo, CAMEL_CIPHER_VALIDITY_SIGN, info->name, info->email, info->cert_data_clone (info->cert_data), info->cert_data_free, info->cert_data_clone);
@@ -1660,7 +1660,7 @@ camel_cipher_validity_add_certinfo_ex (CamelCipherValidity *vin, camel_cipher_va
 	}
 
 	list = (mode==CAMEL_CIPHER_VALIDITY_SIGN)?&vin->sign.signers:&vin->encrypt.encrypters;
-	camel_dlist_addtail (list, (CamelDListNode *)info);
+	camel_dlist_addtail (list, (CamelDListNode *) info);
 }
 
 /**
@@ -1683,7 +1683,7 @@ camel_cipher_validity_envelope (CamelCipherValidity *parent, CamelCipherValidity
 		/* case 1: only signed inside only encrypted -> merge both */
 		parent->encrypt.status = valid->encrypt.status;
 		parent->encrypt.description = g_strdup (valid->encrypt.description);
-		info = (CamelCipherCertInfo *)valid->encrypt.encrypters.head;
+		info = (CamelCipherCertInfo *) valid->encrypt.encrypters.head;
 		while (info->next) {
 			camel_cipher_validity_add_certinfo (parent, CAMEL_CIPHER_VALIDITY_ENCRYPT, info->name, info->email);
 			info = info->next;
@@ -1695,7 +1695,7 @@ camel_cipher_validity_envelope (CamelCipherValidity *parent, CamelCipherValidity
 		/* case 2: only encrypted inside only signed */
 		parent->sign.status = valid->sign.status;
 		parent->sign.description = g_strdup (valid->sign.description);
-		info = (CamelCipherCertInfo *)valid->sign.signers.head;
+		info = (CamelCipherCertInfo *) valid->sign.signers.head;
 		while (info->next) {
 			camel_cipher_validity_add_certinfo (parent, CAMEL_CIPHER_VALIDITY_SIGN, info->name, info->email);
 			info = info->next;
@@ -1713,13 +1713,13 @@ camel_cipher_validity_free (CamelCipherValidity *validity)
 	if (validity == NULL)
 		return;
 
-	while ((child = (CamelCipherValidity *)camel_dlist_remhead (&validity->children)))
+	while ((child = (CamelCipherValidity *) camel_dlist_remhead (&validity->children)))
 		camel_cipher_validity_free (child);
 
-	while ((info = (CamelCipherCertInfo *)camel_dlist_remhead (&validity->sign.signers)))
+	while ((info = (CamelCipherCertInfo *) camel_dlist_remhead (&validity->sign.signers)))
 		ccv_certinfo_free (info);
 
-	while ((info = (CamelCipherCertInfo *)camel_dlist_remhead (&validity->encrypt.encrypters)))
+	while ((info = (CamelCipherCertInfo *) camel_dlist_remhead (&validity->encrypt.encrypters)))
 		ccv_certinfo_free (info);
 
 	camel_cipher_validity_clear (validity);
@@ -1772,16 +1772,16 @@ cc_prepare_sign (CamelMimePart *part)
 	CamelTransferEncoding encoding;
 	gint parts, i;
 
-	dw = camel_medium_get_content ((CamelMedium *)part);
+	dw = camel_medium_get_content ((CamelMedium *) part);
 	if (!dw)
 		return;
 
 	if (CAMEL_IS_MULTIPART (dw)) {
-		parts = camel_multipart_get_number ((CamelMultipart *)dw);
+		parts = camel_multipart_get_number ((CamelMultipart *) dw);
 		for (i = 0; i < parts; i++)
-			cc_prepare_sign (camel_multipart_get_part ((CamelMultipart *)dw, i));
+			cc_prepare_sign (camel_multipart_get_part ((CamelMultipart *) dw, i));
 	} else if (CAMEL_IS_MIME_MESSAGE (dw)) {
-		cc_prepare_sign ((CamelMimePart *)dw);
+		cc_prepare_sign ((CamelMimePart *) dw);
 	} else {
 		encoding = camel_mime_part_get_encoding (part);
 
diff --git a/camel/camel-db.c b/camel/camel-db.c
index b9ad2bb..5eb1ee8 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -266,7 +266,7 @@ camel_sqlite3_vfs_xOpen (sqlite3_vfs *pVfs, const gchar *zPath, sqlite3_file *pF
 	g_return_val_if_fail (old_vfs != NULL, -1);
 	g_return_val_if_fail (pFile != NULL, -1);
 
-	cFile = (CamelSqlite3File *)pFile;
+	cFile = (CamelSqlite3File *) pFile;
 	cFile->old_vfs_file = g_malloc0 (old_vfs->szOsFile);
 
 	res = old_vfs->xOpen (old_vfs, zPath, cFile->old_vfs_file, flags, pOutFlags);
@@ -1183,7 +1183,7 @@ camel_db_get_folder_deleted_uids (CamelDB *db,
 static gint
 read_preview_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
 {
-	GHashTable *hash = (GHashTable *)ref;
+	GHashTable *hash = (GHashTable *) ref;
 	const gchar *uid=NULL;
 	gchar *msg=NULL;
 	gint i;
@@ -1198,7 +1198,7 @@ read_preview_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
 			msg = g_strdup (cols[i]);
 	}
 
-	g_hash_table_insert (hash, (gchar *)uid, msg);
+	g_hash_table_insert (hash, (gchar *) uid, msg);
 
 	return 0;
 }
@@ -1256,7 +1256,7 @@ camel_db_write_preview_record (CamelDB *db,
 static gint
 read_vuids_callback (gpointer ref, gint ncol, gchar ** cols, gchar ** name)
 {
-	GPtrArray *array = (GPtrArray *)ref;
+	GPtrArray *array = (GPtrArray *) ref;
 
 	#if 0
 	gint i;
diff --git a/camel/camel-debug.c b/camel/camel-debug.c
index 711c540..c5a11eb 100644
--- a/camel/camel-debug.c
+++ b/camel/camel-debug.c
@@ -172,7 +172,7 @@ i386_length_and_rw_bits (gint len, enum target_hw_bp_type type)
 #endif
       default:
 	internal_error (__FILE__, __LINE__, "\
-Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (gint)type);
+Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (gint) type);
     }
 
   switch (len)
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index fb3c1db..a237d50 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -272,7 +272,7 @@ disco_store_set_status (CamelDiscoStore *disco_store,
 	if (network_available) {
 		if (disco_store->status == CAMEL_DISCO_STORE_ONLINE
 		    && status == CAMEL_DISCO_STORE_OFFLINE) {
-			if (((CamelStore *)disco_store)->folders) {
+			if (((CamelStore *) disco_store)->folders) {
 				GPtrArray *folders;
 				CamelFolder *folder;
 				CamelURL *url;
@@ -281,7 +281,7 @@ disco_store_set_status (CamelDiscoStore *disco_store,
 				url = camel_service_get_camel_url (service);
 				sync =  camel_url_get_param (url, "offline_sync") != NULL;
 
-				folders = camel_object_bag_list (((CamelStore *)disco_store)->folders);
+				folders = camel_object_bag_list (((CamelStore *) disco_store)->folders);
 				for (i=0;i<folders->len;i++) {
 					folder = folders->pdata[i];
 					if (G_TYPE_CHECK_INSTANCE_TYPE (folder, CAMEL_TYPE_DISCO_FOLDER)
@@ -456,7 +456,7 @@ camel_disco_store_prepare_for_offline (CamelDiscoStore *disco_store,
 
 	if (camel_session_get_network_available (session)) {
 		if (disco_store->status == CAMEL_DISCO_STORE_ONLINE) {
-			if (((CamelStore *)disco_store)->folders) {
+			if (((CamelStore *) disco_store)->folders) {
 				GPtrArray *folders;
 				CamelFolder *folder;
 				CamelURL *url;
@@ -465,7 +465,7 @@ camel_disco_store_prepare_for_offline (CamelDiscoStore *disco_store,
 				url = camel_service_get_camel_url (service);
 				sync = camel_url_get_param (url, "offline_sync") != NULL;
 
-				folders = camel_object_bag_list (((CamelStore *)disco_store)->folders);
+				folders = camel_object_bag_list (((CamelStore *) disco_store)->folders);
 				for (i=0;i<folders->len;i++) {
 					folder = folders->pdata[i];
 					if (G_TYPE_CHECK_INSTANCE_TYPE (folder, CAMEL_TYPE_DISCO_FOLDER)
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
index 15aebbd..bbf4610 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -166,7 +166,7 @@ camel_file_util_decode_##type (FILE *in, type *dest)	\
 	gint v = EOF;					\
 							\
 	while (i >= 0 && (v = fgetc (in)) != EOF) {	\
-		save |= ((type)v) << (i * 8);		\
+		save |= ((type) v) << (i * 8);		\
 		i--;					\
 	}						\
 	*dest = save;					\
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 9aea4fa..d10c058 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -365,7 +365,7 @@ camel_filter_driver_add_rule (CamelFilterDriver *d, const gchar *name, const gch
 	node->match = g_strdup (match);
 	node->action = g_strdup (action);
 	node->name = g_strdup (name);
-	camel_dlist_addtail (&d->priv->rules, (CamelDListNode *)node);
+	camel_dlist_addtail (&d->priv->rules, (CamelDListNode *) node);
 }
 
 gint
diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c
index b15f925..a2433ff 100644
--- a/camel/camel-filter-search.c
+++ b/camel/camel-filter-search.c
@@ -734,7 +734,7 @@ camel_filter_search_match (CamelSession *session,
 
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1)
-			e_sexp_add_ifunction (sexp, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, &fms);
+			e_sexp_add_ifunction (sexp, 0, symbols[i].name, (ESExpIFunc *) symbols[i].func, &fms);
 		else
 			e_sexp_add_function (sexp, 0, symbols[i].name, symbols[i].func, &fms);
 	}
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index c4dc3df..af8cf3b 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -212,16 +212,16 @@ camel_folder_search_construct (CamelFolderSearch *search)
 	for (i = 0; i < G_N_ELEMENTS (builtins); i++) {
 		gpointer func;
 		/* c is sure messy sometimes */
-		func = *((gpointer *)(((gchar *)class)+builtins[i].offset));
+		func = *((gpointer *)(((gchar *) class)+builtins[i].offset));
 		if (func == NULL && builtins[i].flags&1) {
 			g_warning("Search class doesn't implement '%s' method: %s", builtins[i].name, G_OBJECT_TYPE_NAME (search));
-			func = (gpointer)search_dummy;
+			func = (gpointer) search_dummy;
 		}
 		if (func != NULL) {
 			if (builtins[i].flags&2) {
-				e_sexp_add_ifunction (search->sexp, 0, builtins[i].name, (ESExpIFunc *)func, search);
+				e_sexp_add_ifunction (search->sexp, 0, builtins[i].name, (ESExpIFunc *) func, search);
 			} else {
-				e_sexp_add_function (search->sexp, 0, builtins[i].name, (ESExpFunc *)func, search);
+				e_sexp_add_function (search->sexp, 0, builtins[i].name, (ESExpFunc *) func, search);
 			}
 		}
 	}
@@ -772,7 +772,7 @@ search_not (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolder
 				}
 
 				if (!found)
-					g_ptr_array_add (r->value.ptrarray, (gchar *)uid);
+					g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
 			} else if (search->summary == NULL) {
 				g_warning("No summary set, 'not' against an array requires a summary");
 			} else {
@@ -781,12 +781,12 @@ search_not (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFolder
 				gchar **s;
 				gchar **m;
 
-				s = (gchar **)v->pdata;
+				s = (gchar **) v->pdata;
 				for (i=0;i<v->len;i++)
 					g_hash_table_insert (have, s[i], s[i]);
 
 				v = search->summary_set?search->summary_set:search->summary;
-				m = (gchar **)v->pdata;
+				m = (gchar **) v->pdata;
 				for (i=0;i<v->len;i++) {
 					gchar *uid = m[i];
 
@@ -876,7 +876,7 @@ search_match_all (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFo
 			r1 = e_sexp_term_eval (f, argv[0]);
 			if (r1->type == ESEXP_RES_BOOL) {
 				if (r1->value.boolean)
-					g_ptr_array_add (r->value.ptrarray, (gchar *)uid);
+					g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
 			} else {
 				g_warning("invalid syntax, matches require a single bool result");
 				error_msg = g_strdup_printf(_("(%s) requires a single bool result"), "match-all");
@@ -885,7 +885,7 @@ search_match_all (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, CamelFo
 			}
 			e_sexp_result_free (f, r1);
 		} else {
-			g_ptr_array_add (r->value.ptrarray, (gchar *)uid);
+			g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
 		}
 		camel_message_info_free (search->current);
 	}
@@ -897,7 +897,7 @@ static void
 fill_thread_table (struct _CamelFolderThreadNode *root, GHashTable *id_hash)
 {
 	while (root) {
-		g_hash_table_insert (id_hash, (gchar *)camel_message_info_uid (root->message), root);
+		g_hash_table_insert (id_hash, (gchar *) camel_message_info_uid (root->message), root);
 		if (root->child)
 			fill_thread_table (root->child, id_hash);
 		root = root->next;
@@ -908,7 +908,7 @@ static void
 add_thread_results (struct _CamelFolderThreadNode *root, GHashTable *result_hash)
 {
 	while (root) {
-		g_hash_table_insert (result_hash, (gchar *)camel_message_info_uid (root->message), GINT_TO_POINTER (1));
+		g_hash_table_insert (result_hash, (gchar *) camel_message_info_uid (root->message), GINT_TO_POINTER (1));
 		if (root->child)
 			add_thread_results (root->child, result_hash);
 		root = root->next;
@@ -1001,26 +1001,26 @@ search_match_threads (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, Cam
 		if (type != 4)
 			g_hash_table_insert (results, g_ptr_array_index (r->value.ptrarray, i), GINT_TO_POINTER (1));
 
-		node = g_hash_table_lookup (p->threads_hash, (gchar *)g_ptr_array_index (r->value.ptrarray, i));
+		node = g_hash_table_lookup (p->threads_hash, (gchar *) g_ptr_array_index (r->value.ptrarray, i));
 		if (node == NULL) /* this shouldn't happen but why cry over spilt milk */
 			continue;
 
 		/* select messages in thread according to search criteria */
 		if (type == 4) {
 			if (node->child == NULL && node->parent == NULL)
-				g_hash_table_insert (results, (gchar *)camel_message_info_uid (node->message), GINT_TO_POINTER (1));
+				g_hash_table_insert (results, (gchar *) camel_message_info_uid (node->message), GINT_TO_POINTER (1));
 		} else {
 			if (type == 3) {
 				scan = node;
 				while (scan && scan->parent) {
 					scan = scan->parent;
-					g_hash_table_insert (results, (gchar *)camel_message_info_uid (scan->message), GINT_TO_POINTER (1));
+					g_hash_table_insert (results, (gchar *) camel_message_info_uid (scan->message), GINT_TO_POINTER (1));
 				}
 			} else if (type == 1) {
 				while (node && node->parent)
 					node = node->parent;
 			}
-			g_hash_table_insert (results, (gchar *)camel_message_info_uid (node->message), GINT_TO_POINTER (1));
+			g_hash_table_insert (results, (gchar *) camel_message_info_uid (node->message), GINT_TO_POINTER (1));
 			if (node->child)
 				add_thread_results (node->child, results);
 		}
@@ -1030,7 +1030,7 @@ search_match_threads (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, Cam
 	r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
 	r->value.ptrarray = g_ptr_array_new ();
 
-	g_hash_table_foreach (results, (GHFunc)add_results, r->value.ptrarray);
+	g_hash_table_foreach (results, (GHFunc) add_results, r->value.ptrarray);
 	g_hash_table_destroy (results);
 
 	return r;
@@ -1113,7 +1113,7 @@ check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFold
 					truth = TRUE;
 					for (j=0;j<words->len && truth;j++) {
 						if (message) {
-							for (raw_header = ((CamelMimePart *)message)->headers; raw_header; raw_header = raw_header->next) {
+							for (raw_header = ((CamelMimePart *) message)->headers; raw_header; raw_header = raw_header->next) {
 								if (!g_ascii_strcasecmp (raw_header->name, headername)) {
 									if (camel_search_header_match (raw_header->value, words->words[j]->word, how, type, charset))
 										break;;
@@ -1127,7 +1127,7 @@ check_header (struct _ESExp *f, gint argc, struct _ESExpResult **argv, CamelFold
 					camel_search_words_free (words);
 				} else {
 					if (message) {
-						for (raw_header = ((CamelMimePart *)message)->headers; raw_header && !truth; raw_header = raw_header->next) {
+						for (raw_header = ((CamelMimePart *) message)->headers; raw_header && !truth; raw_header = raw_header->next) {
 							if (!g_ascii_strcasecmp (raw_header->name, headername)) {
 								truth = camel_search_header_match (raw_header->value, argv[i]->value.string, how, type, charset);
 							}
@@ -1391,7 +1391,7 @@ match_words_index (CamelFolderSearch *search,
 
 		lambdafoo.uids = result;
 		lambdafoo.count = (1 << words->len) - 1;
-		g_hash_table_foreach (ht, (GHFunc)htand, &lambdafoo);
+		g_hash_table_foreach (ht, (GHFunc) htand, &lambdafoo);
 		g_hash_table_destroy (ht);
 	}
 
@@ -1414,13 +1414,13 @@ match_words_1message (CamelDataWrapper *object, struct _camel_search_words *word
 	if (CAMEL_IS_MULTIPART (containee)) {
 		parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
 		for (i = 0; i < parts && truth == FALSE; i++) {
-			CamelDataWrapper *part = (CamelDataWrapper *)camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
+			CamelDataWrapper *part = (CamelDataWrapper *) camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
 			if (part)
 				truth = match_words_1message (part, words, mask);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
 		/* for messages we only look at its contents */
-		truth = match_words_1message ((CamelDataWrapper *)containee, words, mask);
+		truth = match_words_1message ((CamelDataWrapper *) containee, words, mask);
 	} else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")) {
 		/* for all other text parts, we look inside, otherwise we dont care */
 		CamelStream *stream;
@@ -1464,7 +1464,7 @@ match_words_message (CamelFolder *folder,
 	msg = camel_folder_get_message_sync (folder, uid, cancellable, error);
 	if (msg) {
 		mask = 0;
-		truth = match_words_1message ((CamelDataWrapper *)msg, words, &mask);
+		truth = match_words_1message ((CamelDataWrapper *) msg, words, &mask);
 		g_object_unref (msg);
 	}
 
@@ -1494,7 +1494,7 @@ match_words_messages (CamelFolderSearch *search,
 			if (match_words_message (
 					search->folder, uid, words,
 					cancellable, error))
-				g_ptr_array_add (matches, (gchar *)uid);
+				g_ptr_array_add (matches, (gchar *) uid);
 		}
 
 		g_ptr_array_free (indexed, TRUE);
@@ -1507,7 +1507,7 @@ match_words_messages (CamelFolderSearch *search,
 			if (match_words_message (
 				search->folder, uid, words,
 				cancellable, error))
-				g_ptr_array_add (matches, (gchar *)uid);
+				g_ptr_array_add (matches, (gchar *) uid);
 		}
 	}
 
@@ -1580,7 +1580,7 @@ search_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, C
 				}
 			}
 			lambdafoo.uids = r->value.ptrarray;
-			g_hash_table_foreach (ht, (GHFunc)htor, &lambdafoo);
+			g_hash_table_foreach (ht, (GHFunc) htor, &lambdafoo);
 			g_hash_table_destroy (ht);
 		}
 	}
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index a540940..6b701ce 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -324,7 +324,7 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *record)
 	gint count;
 	gchar *part, *label;
 
-	mi = (CamelMessageInfoBase *)camel_message_info_new (s);
+	mi = (CamelMessageInfoBase *) camel_message_info_new (s);
 
 	io(printf("Loading message info from db\n"));
 
@@ -631,11 +631,11 @@ summary_header_save (CamelFolderSummary *s, FILE *out)
 static CamelMessageInfo *
 message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 {
-	CamelMessageInfoBase *to, *from = (CamelMessageInfoBase *)mi;
+	CamelMessageInfoBase *to, *from = (CamelMessageInfoBase *) mi;
 	CamelFlag *flag;
 	CamelTag *tag;
 
-	to = (CamelMessageInfoBase *)camel_message_info_new (s);
+	to = (CamelMessageInfoBase *) camel_message_info_new (s);
 
 	to->flags = from->flags;
 	to->size = from->size;
@@ -675,7 +675,7 @@ message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 		/* FIXME: copy content-infos */
 	}
 
-	return (CamelMessageInfo *)to;
+	return (CamelMessageInfo *) to;
 }
 
 static gconstpointer
@@ -683,29 +683,29 @@ info_ptr (const CamelMessageInfo *mi, gint id)
 {
 	switch (id) {
 		case CAMEL_MESSAGE_INFO_SUBJECT:
-			return ((const CamelMessageInfoBase *)mi)->subject;
+			return ((const CamelMessageInfoBase *) mi)->subject;
 		case CAMEL_MESSAGE_INFO_FROM:
-			return ((const CamelMessageInfoBase *)mi)->from;
+			return ((const CamelMessageInfoBase *) mi)->from;
 		case CAMEL_MESSAGE_INFO_TO:
-			return ((const CamelMessageInfoBase *)mi)->to;
+			return ((const CamelMessageInfoBase *) mi)->to;
 		case CAMEL_MESSAGE_INFO_CC:
-			return ((const CamelMessageInfoBase *)mi)->cc;
+			return ((const CamelMessageInfoBase *) mi)->cc;
 		case CAMEL_MESSAGE_INFO_MLIST:
-			return ((const CamelMessageInfoBase *)mi)->mlist;
+			return ((const CamelMessageInfoBase *) mi)->mlist;
 		case CAMEL_MESSAGE_INFO_MESSAGE_ID:
-			return &((const CamelMessageInfoBase *)mi)->message_id;
+			return &((const CamelMessageInfoBase *) mi)->message_id;
 		case CAMEL_MESSAGE_INFO_REFERENCES:
-			return ((const CamelMessageInfoBase *)mi)->references;
+			return ((const CamelMessageInfoBase *) mi)->references;
 		case CAMEL_MESSAGE_INFO_USER_FLAGS:
-			return ((const CamelMessageInfoBase *)mi)->user_flags;
+			return ((const CamelMessageInfoBase *) mi)->user_flags;
 		case CAMEL_MESSAGE_INFO_USER_TAGS:
-			return ((const CamelMessageInfoBase *)mi)->user_tags;
+			return ((const CamelMessageInfoBase *) mi)->user_tags;
 		case CAMEL_MESSAGE_INFO_HEADERS:
-			return ((const CamelMessageInfoBase *)mi)->headers;
+			return ((const CamelMessageInfoBase *) mi)->headers;
 		case CAMEL_MESSAGE_INFO_CONTENT:
-			return ((const CamelMessageInfoBase *)mi)->content;
+			return ((const CamelMessageInfoBase *) mi)->content;
 		case CAMEL_MESSAGE_INFO_PREVIEW:
-			return ((const CamelMessageInfoBase *)mi)->preview;
+			return ((const CamelMessageInfoBase *) mi)->preview;
 		default:
 			g_return_val_if_reached (NULL);
 	}
@@ -716,9 +716,9 @@ info_uint32 (const CamelMessageInfo *mi, gint id)
 {
 	switch (id) {
 		case CAMEL_MESSAGE_INFO_FLAGS:
-			return ((const CamelMessageInfoBase *)mi)->flags;
+			return ((const CamelMessageInfoBase *) mi)->flags;
 		case CAMEL_MESSAGE_INFO_SIZE:
-			return ((const CamelMessageInfoBase *)mi)->size;
+			return ((const CamelMessageInfoBase *) mi)->size;
 		default:
 			g_return_val_if_reached (0);
 	}
@@ -729,9 +729,9 @@ info_time (const CamelMessageInfo *mi, gint id)
 {
 	switch (id) {
 		case CAMEL_MESSAGE_INFO_DATE_SENT:
-			return ((const CamelMessageInfoBase *)mi)->date_sent;
+			return ((const CamelMessageInfoBase *) mi)->date_sent;
 		case CAMEL_MESSAGE_INFO_DATE_RECEIVED:
-			return ((const CamelMessageInfoBase *)mi)->date_received;
+			return ((const CamelMessageInfoBase *) mi)->date_received;
 		default:
 			g_return_val_if_reached (0);
 	}
@@ -740,19 +740,19 @@ info_time (const CamelMessageInfo *mi, gint id)
 static gboolean
 info_user_flag (const CamelMessageInfo *mi, const gchar *id)
 {
-	return camel_flag_get (&((CamelMessageInfoBase *)mi)->user_flags, id);
+	return camel_flag_get (&((CamelMessageInfoBase *) mi)->user_flags, id);
 }
 
 static const gchar *
 info_user_tag (const CamelMessageInfo *mi, const gchar *id)
 {
-	return camel_tag_get (&((CamelMessageInfoBase *)mi)->user_tags, id);
+	return camel_tag_get (&((CamelMessageInfoBase *) mi)->user_tags, id);
 }
 
 static gboolean
 info_set_user_flag (CamelMessageInfo *info, const gchar *name, gboolean value)
 {
-	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+	CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
 	gint res;
 
 	res = camel_flag_set (&mi->user_flags, name, value);
@@ -775,7 +775,7 @@ info_set_user_flag (CamelMessageInfo *info, const gchar *name, gboolean value)
 static gboolean
 info_set_user_tag (CamelMessageInfo *info, const gchar *name, const gchar *value)
 {
-	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+	CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
 	gint res;
 
 	res = camel_tag_set (&mi->user_tags, name, value);
@@ -798,7 +798,7 @@ static gboolean
 info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
 {
 	guint32 old;
-	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+	CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
 	gint read=0, deleted=0, junk=0;
 	/* TODO: locking? */
 
@@ -1165,7 +1165,7 @@ camel_folder_summary_array (CamelFolderSummary *s)
 
 	g_ptr_array_set_size (res, s->uids->len);
 	for (i=0;i<s->uids->len;i++)
-		res->pdata[i] = (gpointer) camel_pstring_strdup ((gchar *)g_ptr_array_index (s->uids, i));
+		res->pdata[i] = (gpointer) camel_pstring_strdup ((gchar *) g_ptr_array_index (s->uids, i));
 
 	camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 
@@ -1194,7 +1194,7 @@ camel_folder_summary_get_hashtable (CamelFolderSummary *s)
 	camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 
 	for (i=0;i<s->uids->len;i++)
-		g_hash_table_insert (hash, (gpointer)camel_pstring_strdup ((gchar *)g_ptr_array_index (s->uids, i)), GINT_TO_POINTER (1));
+		g_hash_table_insert (hash, (gpointer) camel_pstring_strdup ((gchar *) g_ptr_array_index (s->uids, i)), GINT_TO_POINTER (1));
 
 	camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 
@@ -1209,7 +1209,7 @@ camel_folder_summary_get_hashtable (CamelFolderSummary *s)
 void
 camel_folder_summary_free_hashtable (GHashTable *ht)
 {
-	g_hash_table_foreach (ht, (GHFunc)camel_pstring_free, NULL);
+	g_hash_table_foreach (ht, (GHFunc) camel_pstring_free, NULL);
 	g_hash_table_destroy (ht);
 }
 
@@ -1395,7 +1395,7 @@ perform_content_info_load_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 	for (i=0;i<count;i++) {
 		pci = perform_content_info_load_from_db (s, mir);
 		if (pci ) {
-			my_list_append ((struct _node **)&ci->childs, (struct _node *)pci);
+			my_list_append ((struct _node **)&ci->childs, (struct _node *) pci);
 			pci->parent = ci;
 		} else {
 			d(fprintf (stderr, "Summary file format messed up?"));
@@ -1426,7 +1426,7 @@ perform_content_info_migrate (CamelFolderSummary *s, FILE *in)
 	for (i=0;i<count;i++) {
 		part = perform_content_info_migrate (s, in);
 		if (part) {
-			my_list_append ((struct _node **)&ci->childs, (struct _node *)part);
+			my_list_append ((struct _node **)&ci->childs, (struct _node *) part);
 			part->parent = ci;
 		} else {
 			d(fprintf (stderr, "Summary file format messed up?"));
@@ -1441,7 +1441,7 @@ static void
 append_changed_uids (gchar *key, CamelMessageInfoBase *info, GPtrArray *array)
 {
 	if (info->dirty || info->flags & CAMEL_MESSAGE_FOLDER_FLAGGED)
-		g_ptr_array_add (array, (gpointer)camel_pstring_strdup ((camel_message_info_uid (info))));
+		g_ptr_array_add (array, (gpointer) camel_pstring_strdup ((camel_message_info_uid (info))));
 }
 
 /**
@@ -1595,7 +1595,7 @@ cfs_cache_size (CamelFolderSummary *s)
 static void
 msg_update_preview (const gchar *uid, gpointer value, CamelFolder *folder)
 {
-	CamelMessageInfoBase *info = (CamelMessageInfoBase *)camel_folder_summary_uid (folder->summary, uid);
+	CamelMessageInfoBase *info = (CamelMessageInfoBase *) camel_folder_summary_uid (folder->summary, uid);
 	CamelMimeMessage *msg;
 	CamelStore *parent_store;
 	const gchar *full_name;
@@ -1606,7 +1606,7 @@ msg_update_preview (const gchar *uid, gpointer value, CamelFolder *folder)
 	/* FIXME Pass a GCancellable */
 	msg = camel_folder_get_message_sync (folder, uid, NULL, NULL);
 	if (msg != NULL) {
-		if (camel_mime_message_build_preview ((CamelMimePart *)msg, (CamelMessageInfo *)info) && info->preview)
+		if (camel_mime_message_build_preview ((CamelMimePart *) msg, (CamelMessageInfo *) info) && info->preview)
 			camel_db_write_preview_record (parent_store->cdb_w, full_name, info->uid, info->preview, NULL);
 	}
 	camel_message_info_free (info);
@@ -1616,7 +1616,7 @@ static void
 pick_uids (const gchar *uid, CamelMessageInfoBase *mi, GPtrArray *array)
 {
 	if (mi->preview)
-		g_ptr_array_add (array, (gchar *)camel_pstring_strdup (uid));
+		g_ptr_array_add (array, (gchar *) camel_pstring_strdup (uid));
 }
 
 static gboolean
@@ -1626,7 +1626,7 @@ fill_mi (const gchar *uid, const gchar *msg, CamelFolder *folder)
 
 	info = g_hash_table_lookup (folder->summary->loaded_infos, uid);
 	if (info) /* We re assign the memory of msg */
-		info->preview = (gchar *)msg;
+		info->preview = (gchar *) msg;
 	camel_pstring_free (uid); /* unref the uid */
 
 	return TRUE;
@@ -1650,12 +1650,12 @@ preview_update (CamelSession *session,
 	parent_store = camel_folder_get_parent_store (folder);
 	preview_data = camel_db_get_folder_preview (parent_store->cdb_r, full_name, NULL);
 	if (preview_data) {
-		g_hash_table_foreach_remove (preview_data, (GHRFunc)fill_mi, folder);
+		g_hash_table_foreach_remove (preview_data, (GHRFunc) fill_mi, folder);
 		g_hash_table_destroy (preview_data);
 	}
 
 	camel_folder_summary_lock (folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
-	g_hash_table_foreach (folder->summary->loaded_infos, (GHFunc)pick_uids, uids_uncached);
+	g_hash_table_foreach (folder->summary->loaded_infos, (GHFunc) pick_uids, uids_uncached);
 	camel_folder_summary_unlock (folder->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 
 	for (i=0; i < uids_uncached->len; i++) {
@@ -1665,7 +1665,7 @@ preview_update (CamelSession *session,
 
 	camel_folder_lock (folder, CAMEL_FOLDER_REC_LOCK);
 	camel_db_begin_transaction (parent_store->cdb_w, NULL);
-	g_hash_table_foreach (hash, (GHFunc)msg_update_preview, folder);
+	g_hash_table_foreach (hash, (GHFunc) msg_update_preview, folder);
 	camel_db_end_transaction (parent_store->cdb_w, NULL);
 	camel_folder_unlock (folder, CAMEL_FOLDER_REC_LOCK);
 	camel_folder_free_uids (folder, uids_uncached);
@@ -1721,7 +1721,7 @@ void
 camel_folder_summary_add_preview (CamelFolderSummary *s, CamelMessageInfo *info)
 {
 	camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
-	g_hash_table_insert (s->priv->preview_updates, (gchar *)info->uid, ((CamelMessageInfoBase *)info)->preview);
+	g_hash_table_insert (s->priv->preview_updates, (gchar *) info->uid, ((CamelMessageInfoBase *) info)->preview);
 	camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 }
 
@@ -1894,8 +1894,8 @@ camel_read_mir_callback (gpointer  ref, gint ncol, gchar ** cols, gchar ** name)
 			gchar *tmp;
 			tmp = mir->cinfo;
 			/* FIXME: this should be done differently, how i don't know */
-			((CamelMessageInfoBase *)info)->content = perform_content_info_load_from_db (s, mir);
-			if (((CamelMessageInfoBase *)info)->content == NULL) {
+			((CamelMessageInfoBase *) info)->content = perform_content_info_load_from_db (s, mir);
+			if (((CamelMessageInfoBase *) info)->content == NULL) {
 				camel_message_info_free (info);
 				info = NULL;
 			}
@@ -1908,7 +1908,7 @@ camel_read_mir_callback (gpointer  ref, gint ncol, gchar ** cols, gchar ** name)
 		}
 
 		/* Just now we are reading from the DB, it can't be dirty. */
-		((CamelMessageInfoBase *)info)->dirty = FALSE;
+		((CamelMessageInfoBase *) info)->dirty = FALSE;
 		if (data->add)
 			camel_folder_summary_add (s, info);
 		else
@@ -1974,14 +1974,14 @@ camel_folder_summary_migrate_infos (CamelFolderSummary *s)
 
 		/* FIXME: this should be done differently, how i don't know */
 		if (s->build_content) {
-			((CamelMessageInfoBase *)mi)->content = perform_content_info_migrate (s, in);
-			if (((CamelMessageInfoBase *)mi)->content == NULL) {
+			((CamelMessageInfoBase *) mi)->content = perform_content_info_migrate (s, in);
+			if (((CamelMessageInfoBase *) mi)->content == NULL) {
 				camel_message_info_free (mi);
 				goto error;
 			}
 		}
 
-		info = (CamelMessageInfoBase *)mi;
+		info = (CamelMessageInfoBase *) mi;
 		tag = info->user_tags;
 		while (tag) {
 			if (strcmp (tag->name, "label")) {
@@ -2070,8 +2070,8 @@ save_to_db_cb (gpointer key, gpointer value, gpointer data)
 {
 	SaveToDBArgs *args = (SaveToDBArgs *) data;
 	GError **error = args->error;
-	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)value;
-	CamelFolderSummary *s = (CamelFolderSummary *)mi->summary;
+	CamelMessageInfoBase *mi = (CamelMessageInfoBase *) value;
+	CamelFolderSummary *s = (CamelFolderSummary *) mi->summary;
 	CamelStore *parent_store;
 	const gchar *full_name;
 	CamelDB *cdb;
@@ -2087,7 +2087,7 @@ save_to_db_cb (gpointer key, gpointer value, gpointer data)
 	mir = CAMEL_FOLDER_SUMMARY_GET_CLASS (s)->message_info_to_db (s, (CamelMessageInfo *) mi);
 
 	if (mir && s->build_content) {
-		if (perform_content_info_save_to_db (s, ((CamelMessageInfoBase *)mi)->content, mir) == -1) {
+		if (perform_content_info_save_to_db (s, ((CamelMessageInfoBase *) mi)->content, mir) == -1) {
 			g_warning ("unable to save mir+cinfo for uid: %s\n", mir->uid);
 			camel_db_camel_mir_free (mir);
 			/* FIXME: Add exception here */
@@ -2165,7 +2165,7 @@ msg_save_preview (const gchar *uid, gpointer value, CamelFolder *folder)
 	parent_store = camel_folder_get_parent_store (folder);
 
 	camel_db_write_preview_record (
-		parent_store->cdb_w, full_name, uid, (gchar *)value, NULL);
+		parent_store->cdb_w, full_name, uid, (gchar *) value, NULL);
 }
 
 /**
@@ -2192,7 +2192,7 @@ camel_folder_summary_save_to_db (CamelFolderSummary *s,
 	if (s->priv->need_preview && g_hash_table_size (s->priv->preview_updates)) {
 		camel_db_begin_transaction (parent_store->cdb_w, NULL);
 		camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
-		g_hash_table_foreach (s->priv->preview_updates, (GHFunc)msg_save_preview, s->folder);
+		g_hash_table_foreach (s->priv->preview_updates, (GHFunc) msg_save_preview, s->folder);
 		g_hash_table_remove_all (s->priv->preview_updates);
 		camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 		camel_db_end_transaction (parent_store->cdb_w, NULL);
@@ -2350,7 +2350,7 @@ summary_assign_uid (CamelFolderSummary *s, CamelMessageInfo *info)
 
 	if (uid == NULL || uid[0] == 0) {
 		camel_pstring_free (info->uid);
-		uid = info->uid = (gchar *)camel_pstring_add (camel_folder_summary_next_uid_string (s), TRUE);
+		uid = info->uid = (gchar *) camel_pstring_add (camel_folder_summary_next_uid_string (s), TRUE);
 	}
 
 	camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -2659,7 +2659,7 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *s, CamelMimeParse
 		}
 
 		/* always scan the content info, even if we dont save it */
-		((CamelMessageInfoBase *)info)->content = summary_build_content_info (s, info, mp);
+		((CamelMessageInfoBase *) info)->content = summary_build_content_info (s, info, mp);
 
 		if (name && p->index) {
 			camel_index_write_name (p->index, name);
@@ -2670,7 +2670,7 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *s, CamelMimeParse
 
 		camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_FILTER_LOCK);
 
-		((CamelMessageInfoBase *)info)->size = camel_mime_parser_tell (mp) - start;
+		((CamelMessageInfoBase *) info)->size = camel_mime_parser_tell (mp) - start;
 	}
 	return info;
 }
@@ -2718,7 +2718,7 @@ camel_folder_summary_info_new_from_message (CamelFolderSummary *s, CamelMimeMess
 		}
 	}
 
-	((CamelMessageInfoBase *)info)->content = summary_build_content_info_message (s, info, (CamelMimePart *)msg);
+	((CamelMessageInfoBase *) info)->content = summary_build_content_info_message (s, info, (CamelMimePart *) msg);
 
 	if (name) {
 		camel_index_write_name (p->index, name);
@@ -3173,7 +3173,7 @@ camel_folder_summary_encode_token (FILE *out, const gchar *str)
 				lower[i] = tolower (str[i]);
 			lower[i] = 0;
 #ifdef USE_BSEARCH
-			match = bsearch (lower, tokens, G_N_ELEMENTS (tokens), sizeof (gchar *), (gint (*)(gconstpointer , gconstpointer ))token_search_cmp);
+			match = bsearch (lower, tokens, G_N_ELEMENTS (tokens), sizeof (gchar *), (gint (*)(gconstpointer , gconstpointer )) token_search_cmp);
 			if (match)
 				token = match-tokens;
 #else
@@ -3272,7 +3272,7 @@ static gint
 my_list_size (struct _node **list)
 {
 	gint len = 0;
-	struct _node *ln = (struct _node *)list;
+	struct _node *ln = (struct _node *) list;
 	while (ln->next) {
 		ln = ln->next;
 		len++;
@@ -3373,8 +3373,8 @@ message_info_new_from_message (CamelFolderSummary *s, CamelMimeMessage *msg, con
 {
 	CamelMessageInfo *mi;
 
-	mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->message_info_new_from_header (s, ((CamelMimePart *)msg)->headers);
-	((CamelMessageInfoBase *)mi)->bodystructure = g_strdup (bodystructure);
+	mi = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS (s)))->message_info_new_from_header (s, ((CamelMimePart *) msg)->headers);
+	((CamelMessageInfoBase *) mi)->bodystructure = g_strdup (bodystructure);
 
 	return mi;
 }
@@ -3472,7 +3472,7 @@ message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h
 	length = g_checksum_type_get_length (G_CHECKSUM_MD5);
 	digest = g_alloca (length);
 
-	mi = (CamelMessageInfoBase *)camel_message_info_new (s);
+	mi = (CamelMessageInfoBase *) camel_message_info_new (s);
 
 	if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
 	     && (ct = camel_content_type_decode (content))
@@ -3561,7 +3561,7 @@ message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h
 		camel_header_references_list_clear (&refs);
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static CamelMessageInfo *
@@ -3572,7 +3572,7 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 	gint i;
 	gchar *subject, *from, *to, *cc, *mlist, *uid;
 
-	mi = (CamelMessageInfoBase *)camel_message_info_new (s);
+	mi = (CamelMessageInfoBase *) camel_message_info_new (s);
 
 	io(printf("Loading message info\n"));
 
@@ -3636,10 +3636,10 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 	}
 
 	if (!ferror (in))
-		return (CamelMessageInfo *)mi;
+		return (CamelMessageInfo *) mi;
 
 error:
-	camel_message_info_free ((CamelMessageInfo *)mi);
+	camel_message_info_free ((CamelMessageInfo *) mi);
 
 	return NULL;
 }
@@ -3648,7 +3648,7 @@ static void
 message_info_free (CamelFolderSummary *s, CamelMessageInfo *info)
 {
 	CamelFolderSummaryClass *class;
-	CamelMessageInfoBase *mi = (CamelMessageInfoBase *)info;
+	CamelMessageInfoBase *mi = (CamelMessageInfoBase *) info;
 
 	if (mi->uid) {
 		if (s && g_hash_table_lookup (s->loaded_infos, mi->uid) == mi) {
@@ -3862,7 +3862,7 @@ summary_build_content_info (CamelFolderSummary *s, CamelMessageInfo *msginfo, Ca
 					if (mfc)
 						g_hash_table_insert (p->filter_charset, g_strdup (charset), mfc);
 				} else {
-					camel_mime_filter_reset ((CamelMimeFilter *)mfc);
+					camel_mime_filter_reset ((CamelMimeFilter *) mfc);
 				}
 				if (mfc) {
 					chr_id = camel_mime_parser_filter_add (mp, mfc);
@@ -3877,8 +3877,8 @@ summary_build_content_info (CamelFolderSummary *s, CamelMessageInfo *msginfo, Ca
 				if (p->filter_html == NULL)
 					p->filter_html = camel_mime_filter_html_new ();
 				else
-					camel_mime_filter_reset ((CamelMimeFilter *)p->filter_html);
-				html_id = camel_mime_parser_filter_add (mp, (CamelMimeFilter *)p->filter_html);
+					camel_mime_filter_reset ((CamelMimeFilter *) p->filter_html);
+				html_id = camel_mime_parser_filter_add (mp, (CamelMimeFilter *) p->filter_html);
 			}
 
 			/* and this filter actually does the indexing */
@@ -3908,7 +3908,7 @@ summary_build_content_info (CamelFolderSummary *s, CamelMessageInfo *msginfo, Ca
 			part = summary_build_content_info (s, msginfo, mp);
 			if (part) {
 				part->parent = info;
-				my_list_append ((struct _node **)&info->childs, (struct _node *)part);
+				my_list_append ((struct _node **)&info->childs, (struct _node *) part);
 			}
 		}
 		break;
@@ -3920,7 +3920,7 @@ summary_build_content_info (CamelFolderSummary *s, CamelMessageInfo *msginfo, Ca
 		part = summary_build_content_info (s, msginfo, mp);
 		if (part) {
 			part->parent = info;
-			my_list_append ((struct _node **)&info->childs, (struct _node *)part);
+			my_list_append ((struct _node **)&info->childs, (struct _node *) part);
 		}
 		state = camel_mime_parser_step (mp, &buffer, &len);
 		if (state != CAMEL_MIME_PARSER_STATE_MESSAGE_END) {
@@ -3959,7 +3959,7 @@ summary_build_content_info_message (CamelFolderSummary *s, CamelMessageInfo *msg
 	   add a reference, probably need fixing for multithreading */
 
 	/* check for attachments */
-	ct = ((CamelDataWrapper *)containee)->mime_type;
+	ct = ((CamelDataWrapper *) containee)->mime_type;
 	if (camel_content_type_is(ct, "multipart", "*")) {
 		if (camel_content_type_is(ct, "multipart", "mixed"))
 			camel_message_info_set_flags (msginfo, CAMEL_MESSAGE_ATTACHMENTS, CAMEL_MESSAGE_ATTACHMENTS);
@@ -4001,15 +4001,15 @@ summary_build_content_info_message (CamelFolderSummary *s, CamelMessageInfo *msg
 			child = summary_build_content_info_message (s, msginfo, part);
 			if (child) {
 				child->parent = info;
-				my_list_append ((struct _node **)&info->childs, (struct _node *)child);
+				my_list_append ((struct _node **)&info->childs, (struct _node *) child);
 			}
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
 		/* for messages we only look at its contents */
-		child = summary_build_content_info_message (s, msginfo, (CamelMimePart *)containee);
+		child = summary_build_content_info_message (s, msginfo, (CamelMimePart *) containee);
 		if (child) {
 			child->parent = info;
-			my_list_append ((struct _node **)&info->childs, (struct _node *)child);
+			my_list_append ((struct _node **)&info->childs, (struct _node *) child);
 		}
 	} else if (p->filter_stream
 		   && camel_content_type_is(ct, "text", "*")) {
@@ -4020,10 +4020,10 @@ summary_build_content_info_message (CamelFolderSummary *s, CamelMessageInfo *msg
 			if (p->filter_html == NULL)
 				p->filter_html = camel_mime_filter_html_new ();
 			else
-				camel_mime_filter_reset ((CamelMimeFilter *)p->filter_html);
+				camel_mime_filter_reset ((CamelMimeFilter *) p->filter_html);
 			html_id = camel_stream_filter_add (
 				CAMEL_STREAM_FILTER (p->filter_stream),
-				(CamelMimeFilter *)p->filter_html);
+				(CamelMimeFilter *) p->filter_html);
 		}
 		idx_id = camel_stream_filter_add (
 			CAMEL_STREAM_FILTER (p->filter_stream),
@@ -4085,7 +4085,7 @@ camel_flag_set (CamelFlag **list, const gchar *name, gboolean value)
 		return TRUE;
 
 	/* this 'trick' works because flag->next is the first element */
-	flag = (CamelFlag *)list;
+	flag = (CamelFlag *) list;
 	while (flag->next) {
 		tmp = flag->next;
 		if (!strcmp (flag->next->name, name)) {
@@ -4167,7 +4167,7 @@ camel_flag_list_copy (CamelFlag **to, CamelFlag **from)
 		return FALSE;
 
 	/* Remove any now-missing flags */
-	flag = (CamelFlag *)to;
+	flag = (CamelFlag *) to;
 	while (flag->next) {
 		tmp = flag->next;
 		if (!camel_flag_get (from, tmp->name)) {
@@ -4206,7 +4206,7 @@ camel_tag_get (CamelTag **list, const gchar *name)
 	tag = *list;
 	while (tag) {
 		if (!strcmp (tag->name, name))
-			return (const gchar *)tag->value;
+			return (const gchar *) tag->value;
 		tag = tag->next;
 	}
 	return NULL;
@@ -4228,7 +4228,7 @@ camel_tag_set (CamelTag **list, const gchar *name, const gchar *value)
 	CamelTag *tag, *tmp;
 
 	/* this 'trick' works because tag->next is the first element */
-	tag = (CamelTag *)list;
+	tag = (CamelTag *) list;
 	while (tag->next) {
 		tmp = tag->next;
 		if (!strcmp (tmp->name, name)) {
@@ -4320,7 +4320,7 @@ camel_tag_list_copy (CamelTag **to, CamelTag **from)
 	}
 
 	if (g_hash_table_size (left)>0) {
-		g_hash_table_foreach (left, (GHFunc)rem_tag, to);
+		g_hash_table_foreach (left, (GHFunc) rem_tag, to);
 		changed = TRUE;
 	}
 	g_hash_table_destroy (left);
@@ -4428,7 +4428,7 @@ camel_message_info_new (CamelFolderSummary *s)
 	info->summary = s;
 
 	/* We assume that mi is always dirty unless freshly read or just saved*/
-	((CamelMessageInfoBase *)info)->dirty = TRUE;
+	((CamelMessageInfoBase *) info)->dirty = TRUE;
 
 	return info;
 }
@@ -4507,8 +4507,8 @@ camel_message_info_free (gpointer o)
 
 		/* FIXME: this is kinda busted, should really be handled by message info free */
 		if (mi->summary->build_content
-		    && ((CamelMessageInfoBase *)mi)->content) {
-			camel_folder_summary_content_info_free (mi->summary, ((CamelMessageInfoBase *)mi)->content);
+		    && ((CamelMessageInfoBase *) mi)->content) {
+			camel_folder_summary_content_info_free (mi->summary, ((CamelMessageInfoBase *) mi)->content);
 		}
 
 		CAMEL_FOLDER_SUMMARY_GET_CLASS (mi->summary)->message_info_free (mi->summary, mi);
diff --git a/camel/camel-folder-thread.c b/camel/camel-folder-thread.c
index 8f5908b..316e3ca 100644
--- a/camel/camel-folder-thread.c
+++ b/camel/camel-folder-thread.c
@@ -103,7 +103,7 @@ prune_empty (CamelFolderThread *thread, CamelFolderThreadNode **cp)
 	CamelFolderThreadNode *child, *next, *c, *lastc;
 
 	/* yes, this is intentional */
-	lastc = (CamelFolderThreadNode *)cp;
+	lastc = (CamelFolderThreadNode *) cp;
 	while (lastc->next) {
 		c = lastc->next;
 		prune_empty (thread, &c->child);
@@ -160,13 +160,13 @@ get_root_subject (CamelFolderThreadNode *c)
 	s = NULL;
 	c->re = FALSE;
 	if (c->message)
-		s = (gchar *)camel_message_info_subject (c->message);
+		s = (gchar *) camel_message_info_subject (c->message);
 	else {
 		/* one of the children will always have a message */
 		scan = c->child;
 		while (scan) {
 			if (scan->message) {
-				s = (gchar *)camel_message_info_subject (scan->message);
+				s = (gchar *) camel_message_info_subject (scan->message);
 				break;
 			}
 			scan = scan->next;
@@ -210,7 +210,7 @@ remove_node (CamelFolderThreadNode **list, CamelFolderThreadNode *node, CamelFol
 	if (node->parent) {
 		c = (CamelFolderThreadNode *)&node->parent->child;
 	} else {
-		c = (CamelFolderThreadNode *)list;
+		c = (CamelFolderThreadNode *) list;
 	}
 	while (c->next) {
 		if (c->next == node) {
@@ -233,7 +233,7 @@ group_root_set (CamelFolderThread *thread, CamelFolderThreadNode **cp)
 
 	/* gather subject lines */
 	d(printf("gathering subject lines\n"));
-	clast = (CamelFolderThreadNode *)cp;
+	clast = (CamelFolderThreadNode *) cp;
 	c = clast->next;
 	while (c) {
 		c->root_subject = get_root_subject (c);
@@ -249,7 +249,7 @@ group_root_set (CamelFolderThread *thread, CamelFolderThreadNode **cp)
 	}
 
 	/* merge common subjects? */
-	clast = (CamelFolderThreadNode *)cp;
+	clast = (CamelFolderThreadNode *) cp;
 	while (clast->next) {
 		c = clast->next;
 		d(printf("checking %p %s\n", c, c->root_subject));
@@ -360,8 +360,8 @@ camel_folder_threaded_messages_dump (CamelFolderThreadNode *c)
 static gint
 sort_node (gconstpointer a, gconstpointer b)
 {
-	const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **)a)[0];
-	const CamelFolderThreadNode *b1 = ((CamelFolderThreadNode **)b)[0];
+	const CamelFolderThreadNode *a1 = ((CamelFolderThreadNode **) a)[0];
+	const CamelFolderThreadNode *b1 = ((CamelFolderThreadNode **) b)[0];
 
 	/* if we have no message, it must be a dummy node, which
 	   also means it must have a child, just use that as the
@@ -418,14 +418,14 @@ sort_thread (CamelFolderThreadNode **cp)
 
 static guint id_hash (gpointer key)
 {
-	CamelSummaryMessageID *id = (CamelSummaryMessageID *)key;
+	CamelSummaryMessageID *id = (CamelSummaryMessageID *) key;
 
 	return id->id.part.lo;
 }
 
 static gint id_equal (gpointer a, gpointer b)
 {
-	return ((CamelSummaryMessageID *)a)->id.id == ((CamelSummaryMessageID *)b)->id.id;
+	return ((CamelSummaryMessageID *) a)->id.id == ((CamelSummaryMessageID *) b)->id.id;
 }
 
 /* perform actual threading */
@@ -442,7 +442,7 @@ thread_summary (CamelFolderThread *thread, GPtrArray *summary)
 	gettimeofday (&start, NULL);
 #endif
 
-	id_table = g_hash_table_new ((GHashFunc)id_hash, (GCompareFunc)id_equal);
+	id_table = g_hash_table_new ((GHashFunc) id_hash, (GCompareFunc) id_equal);
 	no_id_table = g_hash_table_new (NULL, NULL);
 	for (i=0;i<summary->len;i++) {
 		CamelMessageInfo *mi = summary->pdata[i];
@@ -457,16 +457,16 @@ thread_summary (CamelFolderThread *thread, GPtrArray *summary)
 				   into the right spot in the tree */
 				d(printf("doing: (duplicate message id)\n"));
 				c = e_memchunk_alloc0 (thread->node_chunks);
-				g_hash_table_insert (no_id_table, (gpointer)mi, c);
+				g_hash_table_insert (no_id_table, (gpointer) mi, c);
 			} else if (!c) {
 				d(printf("doing : %08x%08x (%s)\n", mid->id.part.hi, mid->id.part.lo, camel_message_info_subject(mi)));
 				c = e_memchunk_alloc0 (thread->node_chunks);
-				g_hash_table_insert (id_table, (gpointer)mid, c);
+				g_hash_table_insert (id_table, (gpointer) mid, c);
 			}
 		} else {
 			d(printf("doing : (no message id)\n"));
 			c = e_memchunk_alloc0 (thread->node_chunks);
-			g_hash_table_insert (no_id_table, (gpointer)mi, c);
+			g_hash_table_insert (no_id_table, (gpointer) mi, c);
 		}
 
 		c->message = mi;
@@ -647,11 +647,11 @@ add_present_rec (CamelFolderThread *thread, GHashTable *have, GPtrArray *summary
 	while (node) {
 		const gchar *uid = camel_message_info_uid (node->message);
 
-		if (g_hash_table_lookup (have, (gchar *)uid)) {
-			g_hash_table_remove (have, (gchar *)camel_message_info_uid (node->message));
+		if (g_hash_table_lookup (have, (gchar *) uid)) {
+			g_hash_table_remove (have, (gchar *) camel_message_info_uid (node->message));
 			g_ptr_array_add (summary, (gpointer) node->message);
 		} else {
-			camel_folder_free_message_info (thread->folder, (CamelMessageInfo *)node->message);
+			camel_folder_free_message_info (thread->folder, (CamelMessageInfo *) node->message);
 		}
 
 		if (node->child)
@@ -765,7 +765,7 @@ build_summary_rec (GHashTable *have, GPtrArray *summary, CamelFolderThreadNode *
 {
 	while (node) {
 		if (node->message)
-			g_hash_table_insert (have, (gchar *)camel_message_info_uid (node->message), node->message);
+			g_hash_table_insert (have, (gchar *) camel_message_info_uid (node->message), node->message);
 		g_ptr_array_add (summary, node);
 		if (node->child)
 			build_summary_rec (have, summary, node->child);
@@ -809,7 +809,7 @@ remove_uid_node_rec (CamelFolderThread *thread, GHashTable *table, CamelFolderTh
 	CamelFolderThreadNode *prev = NULL;
 	CamelFolderThreadNode *node, *next, *child, *rest;
 
-	node = (CamelFolderThreadNode *)list;
+	node = (CamelFolderThreadNode *) list;
 	next = node->next;
 	while (next) {
 
@@ -817,7 +817,7 @@ remove_uid_node_rec (CamelFolderThread *thread, GHashTable *table, CamelFolderTh
 			remove_uid_node_rec (thread, table, &next->child, next);
 
 		/* do we have a node to remove? */
-		if (next->message && g_hash_table_lookup (table, (gchar *)camel_message_info_uid (node->message))) {
+		if (next->message && g_hash_table_lookup (table, (gchar *) camel_message_info_uid (node->message))) {
 			child = next->child;
 			if (child) {
 				/*
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index ab405fa..446a02b 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -379,7 +379,7 @@ folder_transfer_message_to (CamelFolder *source,
 		info = camel_message_info_clone (minfo);
 		camel_folder_free_message_info (source, minfo);
 	} else
-		info = camel_message_info_new_from_header (NULL, ((CamelMimePart *)msg)->headers);
+		info = camel_message_info_new_from_header (NULL, ((CamelMimePart *) msg)->headers);
 
 	/* FIXME decide this based on the source folder */
 //	camel_message_info_set_flags (info, CAMEL_MESSAGE_DELETED, 0);
@@ -3855,7 +3855,7 @@ camel_folder_change_info_build_diff (CamelFolderChangeInfo *info)
 	p = info->priv;
 
 	if (p->uid_source) {
-		g_hash_table_foreach (p->uid_source, (GHFunc)change_info_remove, info);
+		g_hash_table_foreach (p->uid_source, (GHFunc) change_info_remove, info);
 		g_hash_table_destroy (p->uid_source);
 		p->uid_source = NULL;
 	}
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index bbcf6e7..d1edf23 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -937,7 +937,7 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg,
 				gpg->hadsig = TRUE;
 				status += 8;
 				/* there's a key ID, then the email address */
-				status = (const guchar *)strchr ((const gchar *)status, ' ');
+				status = (const guchar *) strchr ((const gchar *) status, ' ');
 				if (status) {
 					const gchar *str = (const gchar *) status + 1;
 					const gchar *eml = strchr (str, '<');
@@ -1597,7 +1597,7 @@ gpg_sign_sync (CamelCipherContext *context,
 	camel_data_wrapper_set_mime_type_field (dw, ct);
 	camel_content_type_unref (ct);
 
-	camel_medium_set_content ((CamelMedium *)sigpart, dw);
+	camel_medium_set_content ((CamelMedium *) sigpart, dw);
 	g_object_unref (dw);
 
 	camel_mime_part_set_description(sigpart, "This is a digitally signed message part");
@@ -1606,16 +1606,16 @@ gpg_sign_sync (CamelCipherContext *context,
 	ct = camel_content_type_new("multipart", "signed");
 	camel_content_type_set_param(ct, "micalg", camel_cipher_context_hash_to_id (context, hash == CAMEL_CIPHER_HASH_DEFAULT ? gpg->hash : hash));
 	camel_content_type_set_param(ct, "protocol", class->sign_protocol);
-	camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *)mps, ct);
+	camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) mps, ct);
 	camel_content_type_unref (ct);
-	camel_multipart_set_boundary ((CamelMultipart *)mps, NULL);
+	camel_multipart_set_boundary ((CamelMultipart *) mps, NULL);
 
 	mps->signature = sigpart;
 	mps->contentraw = istream;
 	camel_stream_reset (istream, NULL);
 	g_object_ref (istream);
 
-	camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mps);
+	camel_medium_set_content ((CamelMedium *) opart, (CamelDataWrapper *) mps);
 fail:
 	g_object_unref (ostream);
 
@@ -1645,8 +1645,8 @@ gpg_verify_sync (CamelCipherContext *context,
 
 	class = CAMEL_CIPHER_CONTEXT_GET_CLASS (context);
 
-	mps = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)ipart);
-	ct = ((CamelDataWrapper *)mps)->mime_type;
+	mps = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) ipart);
+	ct = ((CamelDataWrapper *) mps)->mime_type;
 
 	/* Inline signature (using our fake mime type) or PGP/Mime signature */
 	if (camel_content_type_is(ct, "multipart", "signed")) {
@@ -1721,7 +1721,7 @@ gpg_verify_sync (CamelCipherContext *context,
 			out = camel_stream_fs_new_with_name (name, O_CREAT|O_TRUNC|O_WRONLY, 0666);
 			if (out) {
 				printf("Writing gpg verify signature to '%s'\n", name);
-				camel_data_wrapper_write_to_stream ((CamelDataWrapper *)sigpart, out);
+				camel_data_wrapper_write_to_stream ((CamelDataWrapper *) sigpart, out);
 				g_object_unref (out);
 			}
 			g_free (name);
@@ -1905,7 +1905,7 @@ gpg_encrypt_sync (CamelCipherContext *context,
 	camel_data_wrapper_set_mime_type_field (dw, ct);
 	camel_content_type_unref (ct);
 
-	camel_medium_set_content ((CamelMedium *)encpart, dw);
+	camel_medium_set_content ((CamelMedium *) encpart, dw);
 	g_object_unref (dw);
 
 	camel_mime_part_set_description(encpart, _("This is a digitally encrypted message part"));
@@ -1920,24 +1920,24 @@ gpg_encrypt_sync (CamelCipherContext *context,
 	camel_data_wrapper_construct_from_stream_sync (
 		dw, vstream, NULL, NULL);
 	g_object_unref (vstream);
-	camel_medium_set_content ((CamelMedium *)verpart, dw);
+	camel_medium_set_content ((CamelMedium *) verpart, dw);
 	g_object_unref (dw);
 
 	mpe = camel_multipart_encrypted_new ();
 	ct = camel_content_type_new("multipart", "encrypted");
 	camel_content_type_set_param(ct, "protocol", class->encrypt_protocol);
-	camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *)mpe, ct);
+	camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) mpe, ct);
 	camel_content_type_unref (ct);
-	camel_multipart_set_boundary ((CamelMultipart *)mpe, NULL);
+	camel_multipart_set_boundary ((CamelMultipart *) mpe, NULL);
 
 	mpe->decrypted = g_object_ref (ipart);
 
-	camel_multipart_add_part ((CamelMultipart *)mpe, verpart);
+	camel_multipart_add_part ((CamelMultipart *) mpe, verpart);
 	g_object_unref (verpart);
-	camel_multipart_add_part ((CamelMultipart *)mpe, encpart);
+	camel_multipart_add_part ((CamelMultipart *) mpe, encpart);
 	g_object_unref (encpart);
 
-	camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mpe);
+	camel_medium_set_content ((CamelMedium *) opart, (CamelDataWrapper *) mpe);
 fail:
 	gpg_ctx_free (gpg);
 fail1:
@@ -1970,7 +1970,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
 		return NULL;
 	}
 
-	content = camel_medium_get_content ((CamelMedium *)ipart);
+	content = camel_medium_get_content ((CamelMedium *) ipart);
 
 	if (!content) {
 		g_set_error (
@@ -2011,7 +2011,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
 	camel_stream_reset (istream, NULL);
 
 	ostream = camel_stream_mem_new ();
-	camel_stream_mem_set_secure ((CamelStreamMem *)ostream);
+	camel_stream_mem_set_secure ((CamelStreamMem *) ostream);
 
 	gpg = gpg_ctx_new (context);
 	gpg_ctx_set_mode (gpg, GPG_CTX_MODE_DECRYPT);
@@ -2049,7 +2049,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
 			CAMEL_DATA_WRAPPER (opart),
 			ostream, NULL, error);
 
-		dw = camel_medium_get_content ((CamelMedium *)opart);
+		dw = camel_medium_get_content ((CamelMedium *) opart);
 		if (!camel_data_wrapper_decode_to_stream_sync (
 			dw, null, cancellable, NULL)) {
 			/* nothing had been decoded from the stream, it doesn't
@@ -2067,7 +2067,7 @@ gpg_decrypt_sync (CamelCipherContext *context,
 		success = camel_data_wrapper_construct_from_stream_sync (
 			dw, ostream, NULL, error);
 		camel_data_wrapper_set_mime_type(dw, "application/octet-stream");
-		camel_medium_set_content ((CamelMedium *)opart, dw);
+		camel_medium_set_content ((CamelMedium *) opart, dw);
 		g_object_unref (dw);
 		/* Set mime/type of this new part to application/octet-stream to force type snooping */
 		camel_mime_part_set_content_type(opart, "application/octet-stream");
diff --git a/camel/camel-html-parser.c b/camel/camel-html-parser.c
index ccf9bc5..3acb1e3 100644
--- a/camel/camel-html-parser.c
+++ b/camel/camel-html-parser.c
@@ -107,14 +107,14 @@ void camel_html_parser_set_data (CamelHTMLParser *hp, const gchar *start, gint l
 {
 	CamelHTMLParserPrivate *p = hp->priv;
 
-	p->inptr = p->inbuf = (gchar *)start;
-	p->inend = (gchar *)start+len;
+	p->inptr = p->inbuf = (gchar *) start;
+	p->inend = (gchar *) start+len;
 	p->eof = last;
 }
 
 camel_html_parser_t camel_html_parser_step (CamelHTMLParser *hp, const gchar **datap, gint *lenp)
 {
-	return tokenize_step (hp->priv, (gchar **)datap, lenp);
+	return tokenize_step (hp->priv, (gchar **) datap, lenp);
 }
 
 const gchar *camel_html_parser_left (CamelHTMLParser *hp, gint *lenp)
@@ -138,8 +138,8 @@ const gchar *camel_html_parser_attr (CamelHTMLParser *hp, const gchar *name)
 	CamelHTMLParserPrivate *p = hp->priv;
 
 	for (i=0;i<p->attrs->len;i++) {
-		if (!g_ascii_strcasecmp (((GString *)p->attrs->pdata[i])->str, name)) {
-			return ((GString *)p->values->pdata[i])->str;
+		if (!g_ascii_strcasecmp (((GString *) p->attrs->pdata[i])->str, name)) {
+			return ((GString *) p->values->pdata[i])->str;
 		}
 	}
 
@@ -444,7 +444,7 @@ static void tokenize_setup (void)
 	if (entities == NULL) {
 		entities = g_hash_table_new (g_str_hash, g_str_equal);
 		for (i = 0; i < G_N_ELEMENTS (entity_map); i++) {
-			g_hash_table_insert (entities, (gchar *)entity_map[i].name, GUINT_TO_POINTER (entity_map[i].val));
+			g_hash_table_insert (entities, (gchar *) entity_map[i].name, GUINT_TO_POINTER (entity_map[i].val));
 		}
 	}
 }
diff --git a/camel/camel-http-stream.c b/camel/camel-http-stream.c
index 8bac0f2..8736087 100644
--- a/camel/camel-http-stream.c
+++ b/camel/camel-http-stream.c
@@ -588,7 +588,7 @@ camel_http_stream_new (CamelHttpMethod method, struct _CamelSession *session, Ca
 	stream->url = camel_url_new (str, NULL);
 	g_free (str);
 
-	return (CamelStream *)stream;
+	return (CamelStream *) stream;
 }
 
 CamelContentType *
diff --git a/camel/camel-iconv.c b/camel/camel-iconv.c
index cb92933..44ef076 100644
--- a/camel/camel-iconv.c
+++ b/camel/camel-iconv.c
@@ -425,7 +425,7 @@ flush_entry (struct _iconv_cache *ic)
 {
 	struct _iconv_cache_node *in, *nn;
 
-	in = (struct _iconv_cache_node *)ic->open.head;
+	in = (struct _iconv_cache_node *) ic->open.head;
 	nn = in->next;
 	while (nn) {
 		if (in->ip != (iconv_t)-1) {
@@ -465,17 +465,17 @@ camel_iconv_open (const gchar *oto, const gchar *ofrom)
 
 	ic = g_hash_table_lookup (iconv_cache, tofrom);
 	if (ic) {
-		camel_dlist_remove ((CamelDListNode *)ic);
+		camel_dlist_remove ((CamelDListNode *) ic);
 	} else {
-		struct _iconv_cache *last = (struct _iconv_cache *)iconv_cache_list.tailpred;
+		struct _iconv_cache *last = (struct _iconv_cache *) iconv_cache_list.tailpred;
 		struct _iconv_cache *prev;
 
 		prev = last->prev;
 		while (prev && iconv_cache_size > E_ICONV_CACHE_SIZE) {
-			in = (struct _iconv_cache_node *)last->open.head;
+			in = (struct _iconv_cache_node *) last->open.head;
 			if (in->next && !in->busy) {
 				cd(printf("Flushing iconv converter '%s'\n", last->conv));
-				camel_dlist_remove ((CamelDListNode *)last);
+				camel_dlist_remove ((CamelDListNode *) last);
 				g_hash_table_remove (iconv_cache, last->conv);
 				flush_entry (last);
 				iconv_cache_size--;
@@ -493,10 +493,10 @@ camel_iconv_open (const gchar *oto, const gchar *ofrom)
 
 		cd(printf("Creating iconv converter '%s'\n", ic->conv));
 	}
-	camel_dlist_addhead (&iconv_cache_list, (CamelDListNode *)ic);
+	camel_dlist_addhead (&iconv_cache_list, (CamelDListNode *) ic);
 
 	/* If we have a free iconv, use it */
-	in = (struct _iconv_cache_node *)ic->open.tailpred;
+	in = (struct _iconv_cache_node *) ic->open.tailpred;
 	if (in->prev && !in->busy) {
 		cd(printf("using existing iconv converter '%s'\n", ic->conv));
 		ip = in->ip;
@@ -510,8 +510,8 @@ camel_iconv_open (const gchar *oto, const gchar *ofrom)
 			/* resets the converter */
 			iconv (ip, &buggy_iconv_buf, &buggy_iconv_len, &buggy_iconv_buf, &buggy_iconv_len);
 			in->busy = TRUE;
-			camel_dlist_remove ((CamelDListNode *)in);
-			camel_dlist_addhead (&ic->open, (CamelDListNode *)in);
+			camel_dlist_remove ((CamelDListNode *) in);
+			camel_dlist_addhead (&ic->open, (CamelDListNode *) in);
 		}
 	} else {
 		cd(printf("creating new iconv converter '%s'\n", ic->conv));
@@ -519,7 +519,7 @@ camel_iconv_open (const gchar *oto, const gchar *ofrom)
 		in = g_malloc (sizeof (*in));
 		in->ip = ip;
 		in->parent = ic;
-		camel_dlist_addhead (&ic->open, (CamelDListNode *)in);
+		camel_dlist_addhead (&ic->open, (CamelDListNode *) in);
 		if (ip != (iconv_t)-1) {
 			g_hash_table_insert (iconv_cache_open, ip, in);
 			in->busy = TRUE;
@@ -555,9 +555,9 @@ camel_iconv_close (iconv_t ip)
 	in = g_hash_table_lookup (iconv_cache_open, ip);
 	if (in) {
 		cd(printf("closing iconv converter '%s'\n", in->parent->conv));
-		camel_dlist_remove ((CamelDListNode *)in);
+		camel_dlist_remove ((CamelDListNode *) in);
 		in->busy = FALSE;
-		camel_dlist_addtail (&in->parent->open, (CamelDListNode *)in);
+		camel_dlist_addtail (&in->parent->open, (CamelDListNode *) in);
 	} else {
 		g_warning("trying to close iconv i dont know about: %p", ip);
 		iconv_close (ip);
diff --git a/camel/camel-index-control.c b/camel/camel-index-control.c
index fade5b8..53384b6 100644
--- a/camel/camel-index-control.c
+++ b/camel/camel-index-control.c
@@ -39,7 +39,7 @@ do_compress (gint argc, gchar **argv)
 
 	for (i=2;i<argc;i++) {
 		printf("Opening index file: %s\n", argv[i]);
-		idx = (CamelIndex *)camel_text_index_new (argv[i], O_RDWR);
+		idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDWR);
 		if (idx) {
 			printf(" Compressing ...\n");
 			if (camel_index_compress (idx) == -1) {
@@ -63,10 +63,10 @@ do_dump (gint argc, gchar **argv)
 
 	for (i=2;i<argc;i++) {
 		printf("Opening index file: %s\n", argv[i]);
-		idx = (CamelIndex *)camel_text_index_new (argv[i], O_RDONLY);
+		idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
 		if (idx) {
 			printf(" Dumping ...\n");
-			camel_text_index_dump ((CamelTextIndex *)idx);
+			camel_text_index_dump ((CamelTextIndex *) idx);
 			g_object_unref (idx);
 		} else {
 			printf(" Failed: %s\n", g_strerror (errno));
@@ -84,9 +84,9 @@ do_info (gint argc, gchar **argv)
 
 	for (i=2;i<argc;i++) {
 		printf("Opening index file: %s\n", argv[i]);
-		idx = (CamelIndex *)camel_text_index_new (argv[i], O_RDONLY);
+		idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
 		if (idx) {
-			camel_text_index_info ((CamelTextIndex *)idx);
+			camel_text_index_info ((CamelTextIndex *) idx);
 			g_object_unref (idx);
 		} else {
 			printf(" Failed: %s\n", g_strerror (errno));
@@ -104,9 +104,9 @@ do_check (gint argc, gchar **argv)
 
 	for (i=2;i<argc;i++) {
 		printf("Opening index file: %s\n", argv[i]);
-		idx = (CamelIndex *)camel_text_index_new (argv[i], O_RDONLY);
+		idx = (CamelIndex *) camel_text_index_new (argv[i], O_RDONLY);
 		if (idx) {
-			camel_text_index_validate ((CamelTextIndex *)idx);
+			camel_text_index_validate ((CamelTextIndex *) idx);
 			g_object_unref (idx);
 		} else {
 			printf(" Failed: %s\n", g_strerror (errno));
@@ -177,7 +177,7 @@ do_perf (gint argc, gchar **argv)
 	filter = camel_stream_filter_new (null);
 	g_object_unref (null);
 	filter_index = camel_mime_filter_index_new (idx);
-	camel_stream_filter_add ((CamelStreamFilter *)filter, filter_index);
+	camel_stream_filter_add ((CamelStreamFilter *) filter, filter_index);
 
 	while ((d = readdir (dir))) {
 		printf("indexing '%s'\n", d->d_name);
diff --git a/camel/camel-index.c b/camel/camel-index.c
index 17baffe..70971fe 100644
--- a/camel/camel-index.c
+++ b/camel/camel-index.c
@@ -379,7 +379,7 @@ camel_index_name_add_word (CamelIndexName *idn,
                            const gchar *word)
 {
 	CamelIndexNameClass *class;
-	gchar *b = (gchar *)word;
+	gchar *b = (gchar *) word;
 
 	g_return_if_fail (CAMEL_IS_INDEX_NAME (idn));
 
diff --git a/camel/camel-internet-address.c b/camel/camel-internet-address.c
index 9db2361..90073d2 100644
--- a/camel/camel-internet-address.c
+++ b/camel/camel-internet-address.c
@@ -45,12 +45,12 @@ internet_address_decode (CamelAddress *a, const gchar *raw)
 		n = ha;
 		while (n) {
 			if (n->type == CAMEL_HEADER_ADDRESS_NAME) {
-				camel_internet_address_add ((CamelInternetAddress *)a, n->name, n->v.addr);
+				camel_internet_address_add ((CamelInternetAddress *) a, n->name, n->v.addr);
 			} else if (n->type == CAMEL_HEADER_ADDRESS_GROUP) {
 				struct _camel_header_address *g = n->v.members;
 				while (g) {
 					if (g->type == CAMEL_HEADER_ADDRESS_NAME)
-						camel_internet_address_add ((CamelInternetAddress *)a, g->name, g->v.addr);
+						camel_internet_address_add ((CamelInternetAddress *) a, g->name, g->v.addr);
 					/* otherwise, it's an error, infact */
 					g = g->next;
 				}
@@ -147,7 +147,7 @@ internet_address_unformat (CamelAddress *a, const gchar *raw)
 			addr = g_strstrip (addr);
 			if (addr[0]) {
 				d(printf("found address: '%s' <%s>\n", name, addr));
-				camel_internet_address_add ((CamelInternetAddress *)a, name, addr);
+				camel_internet_address_add ((CamelInternetAddress *) a, name, addr);
 			}
 			name = NULL;
 			addr = p;
@@ -214,7 +214,7 @@ internet_address_cat (CamelAddress *dest, CamelAddress *source)
 
 	for (i=0;i<source->addresses->len;i++) {
 		struct _address *addr = g_ptr_array_index (source->addresses, i);
-		camel_internet_address_add ((CamelInternetAddress *)dest, addr->name, addr->address);
+		camel_internet_address_add ((CamelInternetAddress *) dest, addr->name, addr->address);
 	}
 
 	return i;
@@ -273,8 +273,8 @@ camel_internet_address_add (CamelInternetAddress *addr, const gchar *name, const
 	new = g_malloc (sizeof (*new));
 	new->name = g_strdup (name);
 	new->address = g_strdup (address);
-	index = ((CamelAddress *)addr)->addresses->len;
-	g_ptr_array_add (((CamelAddress *)addr)->addresses, new);
+	index = ((CamelAddress *) addr)->addresses->len;
+	g_ptr_array_add (((CamelAddress *) addr)->addresses, new);
 
 	return index;
 }
@@ -297,10 +297,10 @@ camel_internet_address_get (CamelInternetAddress *addr, gint index, const gchar
 
 	g_assert (CAMEL_IS_INTERNET_ADDRESS (addr));
 
-	if (index < 0 || index >= ((CamelAddress *)addr)->addresses->len)
+	if (index < 0 || index >= ((CamelAddress *) addr)->addresses->len)
 		return FALSE;
 
-	a = g_ptr_array_index (((CamelAddress *)addr)->addresses, index);
+	a = g_ptr_array_index (((CamelAddress *) addr)->addresses, index);
 	if (namep)
 		*namep = a->name;
 	if (addressp)
@@ -327,9 +327,9 @@ camel_internet_address_find_name (CamelInternetAddress *addr, const gchar *name,
 
 	g_assert (CAMEL_IS_INTERNET_ADDRESS (addr));
 
-	len = ((CamelAddress *)addr)->addresses->len;
+	len = ((CamelAddress *) addr)->addresses->len;
 	for (i=0;i<len;i++) {
-		a = g_ptr_array_index (((CamelAddress *)addr)->addresses, i);
+		a = g_ptr_array_index (((CamelAddress *) addr)->addresses, i);
 		if (a->name && !strcmp (a->name, name)) {
 			if (addressp)
 				*addressp = a->address;
@@ -357,9 +357,9 @@ camel_internet_address_find_address (CamelInternetAddress *addr, const gchar *ad
 
 	g_assert (CAMEL_IS_INTERNET_ADDRESS (addr));
 
-	len = ((CamelAddress *)addr)->addresses->len;
+	len = ((CamelAddress *) addr)->addresses->len;
 	for (i=0;i<len;i++) {
-		a = g_ptr_array_index (((CamelAddress *)addr)->addresses, i);
+		a = g_ptr_array_index (((CamelAddress *) addr)->addresses, i);
 		if (!strcmp (a->address, address)) {
 			if (namep)
 				*namep = a->name;
diff --git a/camel/camel-list-utils.c b/camel/camel-list-utils.c
index a7614bc..feb9972 100644
--- a/camel/camel-list-utils.c
+++ b/camel/camel-list-utils.c
@@ -206,7 +206,7 @@ camel_slist_addtail (CamelSList *l, CamelSListNode *n)
 {
 	CamelSListNode *p;
 
-	p = (CamelSListNode *)l;
+	p = (CamelSListNode *) l;
 	while (p->next)
 		p = p->next;
 	n->next = NULL;
@@ -220,7 +220,7 @@ camel_slist_remove (CamelSList *l, CamelSListNode *n)
 {
 	CamelSListNode *p, *q;
 
-	p = (CamelSListNode *)l;
+	p = (CamelSListNode *) l;
 	while ((q = p->next)) {
 		if (q == n) {
 			p->next = n->next;
@@ -254,7 +254,7 @@ camel_slist_remtail (CamelSList *l)
 	n = l->head;
 	if (l->head == NULL)
 		return NULL;
-	p = (CamelSListNode *)l;
+	p = (CamelSListNode *) l;
 	while (n->next) {
 		p = n;
 		n = n->next;
diff --git a/camel/camel-lock.c b/camel/camel-lock.c
index 203de9b..8b9a7fb 100644
--- a/camel/camel-lock.c
+++ b/camel/camel-lock.c
@@ -165,7 +165,7 @@ camel_unlock_dot (const gchar *path)
 	lock = alloca(strlen(path) + strlen(".lock") + 1);
 	sprintf(lock, "%s.lock", path);
 	d(printf("unlocking %s\n", lock));
-	(void)unlink (lock);
+	(void) unlink (lock);
 #endif
 }
 
@@ -289,7 +289,7 @@ camel_unlock_flock (gint fd)
 #ifdef USE_FLOCK
 	d(printf("flock unlocking %d\n", fd));
 
-	(void)flock (fd, LOCK_UN);
+	(void) flock (fd, LOCK_UN);
 #endif
 }
 
diff --git a/camel/camel-mime-filter-canon.c b/camel/camel-mime-filter-canon.c
index fb837cb..aa074f1 100644
--- a/camel/camel-mime-filter-canon.c
+++ b/camel/camel-mime-filter-canon.c
@@ -57,7 +57,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
 	priv = CAMEL_MIME_FILTER_CANON (mime_filter)->priv;
 
 	/* first, work out how much space we need */
-	inptr = (guchar *)in;
+	inptr = (guchar *) in;
 	inend = (const guchar *) (in+len);
 	while (inptr < inend)
 		if (*inptr++ == '\n')
@@ -70,7 +70,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
 	camel_mime_filter_set_size (mime_filter, len+lf*3+4, FALSE);
 
 	o = mime_filter->outbuf;
-	inptr = (guchar *)in;
+	inptr = (guchar *) in;
 	start = inptr;
 	starto = o;
 	while (inptr < inend) {
@@ -131,7 +131,7 @@ mime_filter_canon_run (CamelMimeFilter *mime_filter,
 		*outlen = o - mime_filter->outbuf;
 	} else {
 		camel_mime_filter_backup (
-			mime_filter, (const gchar *)start, inend - start);
+			mime_filter, (const gchar *) start, inend - start);
 		*outlen = starto - mime_filter->outbuf;
 	}
 
diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c
index c33b92c..aa827eb 100644
--- a/camel/camel-mime-filter-enriched.c
+++ b/camel/camel-mime-filter-enriched.c
@@ -596,7 +596,7 @@ camel_enriched_to_html (const gchar *in, guint32 flags)
 
 	filter = camel_mime_filter_enriched_new (flags);
 
-	camel_mime_filter_complete (filter, (gchar *)in, strlen (in), 0, &outbuf, &outlen, &outpre);
+	camel_mime_filter_complete (filter, (gchar *) in, strlen (in), 0, &outbuf, &outlen, &outpre);
 	outbuf = g_strndup (outbuf, outlen);
 	g_object_unref (filter);
 
diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c
index 54ebdb1..1db6c54 100644
--- a/camel/camel-mime-filter-tohtml.c
+++ b/camel/camel-mime-filter-tohtml.c
@@ -309,7 +309,7 @@ html_convert (CamelMimeFilter *mime_filter,
 			do {
 				if (camel_url_scanner_scan (priv->scanner, start, len - (len > 0 && start[len - 1] == 0 ? 1 : 0), &match)) {
 					/* write out anything before the first regex match */
-					outptr = writeln (mime_filter, (const guchar *)start, (const guchar *)start + match.um_so,
+					outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) start + match.um_so,
 							  outptr, &outend);
 
 					start += match.um_so;
@@ -321,19 +321,19 @@ html_convert (CamelMimeFilter *mime_filter,
 					outptr = append_string_verbatim (mime_filter, "<a href=\"", outptr, &outend);
 					/* prefix shouldn't need escaping, but let's be safe */
 					outptr = writeln (mime_filter,
-							(const guchar *)match.prefix,
-							(const guchar *)match.prefix + strlen (match.prefix),
+							(const guchar *) match.prefix,
+							(const guchar *) match.prefix + strlen (match.prefix),
 							outptr, &outend);
 					outptr = writeln (mime_filter,
-							(const guchar *)start,
-							(const guchar *)start + matchlen,
+							(const guchar *) start,
+							(const guchar *) start + matchlen,
 							outptr, &outend);
 					outptr = append_string_verbatim (mime_filter, "\">", outptr, &outend);
 
 					/* now write the matched string */
 					outptr = writeln (mime_filter,
-							(const guchar *)start,
-							(const guchar *)start + matchlen,
+							(const guchar *) start,
+							(const guchar *) start + matchlen,
 							outptr, &outend);
 					priv->column += matchlen;
 					start += matchlen;
@@ -343,12 +343,12 @@ html_convert (CamelMimeFilter *mime_filter,
 					outptr = append_string_verbatim (mime_filter, "</a>", outptr, &outend);
 				} else {
 					/* nothing matched so write out the remainder of this line buffer */
-					outptr = writeln (mime_filter, (const guchar *)start, (const guchar *)start + len, outptr, &outend);
+					outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) start + len, outptr, &outend);
 					break;
 				}
 			} while (len > 0);
 		} else {
-			outptr = writeln (mime_filter, (const guchar *)start, (const guchar *)inptr, outptr, &outend);
+			outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) inptr, outptr, &outend);
 		}
 
 		if ((priv->flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) && depth > 0) {
@@ -371,7 +371,7 @@ html_convert (CamelMimeFilter *mime_filter,
 	if (flush) {
 		/* flush the rest of our input buffer */
 		if (start < inend)
-			outptr = writeln (mime_filter, (const guchar *)start, (const guchar *)inend, outptr, &outend);
+			outptr = writeln (mime_filter, (const guchar *) start, (const guchar *) inend, outptr, &outend);
 
 		if (priv->pre_open) {
 			/* close the pre-tag */
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 3eb49ce..82fa7f4 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -559,8 +559,8 @@ camel_mime_message_set_reply_to (CamelMimeMessage *msg, CamelInternetAddress *re
 		return;
 	}
 
-	msg->reply_to = (CamelInternetAddress *)camel_address_new_clone ((CamelAddress *)reply_to);
-	addr = camel_address_encode ((CamelAddress *)msg->reply_to);
+	msg->reply_to = (CamelInternetAddress *) camel_address_new_clone ((CamelAddress *) reply_to);
+	addr = camel_address_encode ((CamelAddress *) msg->reply_to);
 	CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header (CAMEL_MEDIUM (msg), "Reply-To", addr);
 	g_free (addr);
 }
@@ -654,13 +654,13 @@ camel_mime_message_set_from (CamelMimeMessage *msg, CamelInternetAddress *from)
 		msg->from = NULL;
 	}
 
-	if (from == NULL || camel_address_length ((CamelAddress *)from) == 0) {
+	if (from == NULL || camel_address_length ((CamelAddress *) from) == 0) {
 		CAMEL_MEDIUM_CLASS(camel_mime_message_parent_class)->remove_header(CAMEL_MEDIUM(msg), "From");
 		return;
 	}
 
-	msg->from = (CamelInternetAddress *)camel_address_new_clone ((CamelAddress *)from);
-	addr = camel_address_encode ((CamelAddress *)msg->from);
+	msg->from = (CamelInternetAddress *) camel_address_new_clone ((CamelAddress *) from);
+	addr = camel_address_encode ((CamelAddress *) msg->from);
 	CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->set_header(CAMEL_MEDIUM(msg), "From", addr);
 	g_free (addr);
 }
@@ -707,14 +707,14 @@ camel_mime_message_set_recipients (CamelMimeMessage *mime_message, const gchar *
 		return;
 	}
 
-	if (r == NULL || camel_address_length ((CamelAddress *)r) == 0) {
-		camel_address_remove ((CamelAddress *)addr, -1);
+	if (r == NULL || camel_address_length ((CamelAddress *) r) == 0) {
+		camel_address_remove ((CamelAddress *) addr, -1);
 		CAMEL_MEDIUM_CLASS (camel_mime_message_parent_class)->remove_header (CAMEL_MEDIUM (mime_message), type);
 		return;
 	}
 
 	/* note this does copy, and not append (cat) */
-	camel_address_copy ((CamelAddress *)addr, (CamelAddress *)r);
+	camel_address_copy ((CamelAddress *) addr, (CamelAddress *) r);
 
 	/* and sync our headers */
 	text = camel_address_encode (CAMEL_ADDRESS (addr));
@@ -812,7 +812,7 @@ message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartF
 			go = message_foreach_part_rec (msg, mpart, callback, data);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
-		go = message_foreach_part_rec (msg, (CamelMimePart *)containee, callback, data);
+		go = message_foreach_part_rec (msg, (CamelMimePart *) containee, callback, data);
 	}
 
 	return go;
@@ -823,7 +823,7 @@ message_foreach_part_rec (CamelMimeMessage *msg, CamelMimePart *part, CamelPartF
 static void
 camel_mime_message_foreach_part (CamelMimeMessage *msg, CamelPartFunc callback, gpointer data)
 {
-	message_foreach_part_rec (msg, (CamelMimePart *)msg, callback, data);
+	message_foreach_part_rec (msg, (CamelMimePart *) msg, callback, data);
 }
 
 static gboolean
@@ -883,7 +883,7 @@ find_best_encoding (CamelMimePart *part,
 
 	d(printf("starting to check part\n"));
 
-	content = camel_medium_get_content ((CamelMedium *)part);
+	content = camel_medium_get_content ((CamelMedium *) part);
 	if (content == NULL) {
 		/* charset might not be right here, but it'll get the right stuff
 		   if it is ever set */
@@ -906,7 +906,7 @@ find_best_encoding (CamelMimePart *part,
 	flags |= callerflags;
 
 	/* first a null stream, so any filtering is thrown away; we only want the sideeffects */
-	null = (CamelStream *)camel_stream_null_new ();
+	null = (CamelStream *) camel_stream_null_new ();
 	filter = camel_stream_filter_new (null);
 
 	/* if we're looking for the best charset, then we need to convert to UTF-8 */
@@ -1147,7 +1147,7 @@ static const gchar tz_days[][4] = {
 gchar *
 camel_mime_message_build_mbox_from (CamelMimeMessage *message)
 {
-	struct _camel_header_raw *header = ((CamelMimePart *)message)->headers;
+	struct _camel_header_raw *header = ((CamelMimePart *) message)->headers;
 	GString *out = g_string_new("From ");
 	gchar *ret;
 	const gchar *tmp;
@@ -1204,7 +1204,7 @@ static gboolean
 find_attachment (CamelMimeMessage *msg, CamelMimePart *part, gpointer data)
 {
 	const CamelContentDisposition *cd;
-	gboolean *found = (gboolean *)data;
+	gboolean *found = (gboolean *) data;
 
 	g_return_val_if_fail (part != NULL, FALSE);
 
@@ -1259,7 +1259,7 @@ cmm_dump_rec (CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
 	printf("%sclass: %s\n", s, G_OBJECT_TYPE_NAME (part));
 	printf("%smime-type: %s\n", s, camel_content_type_format(((CamelDataWrapper *)part)->mime_type));
 
-	containee = camel_medium_get_content ((CamelMedium *)part);
+	containee = camel_medium_get_content ((CamelMedium *) part);
 
 	if (containee == NULL)
 		return;
@@ -1269,14 +1269,14 @@ cmm_dump_rec (CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
 
 	/* using the object types is more accurate than using the mime/types */
 	if (CAMEL_IS_MULTIPART (containee)) {
-		parts = camel_multipart_get_number ((CamelMultipart *)containee);
+		parts = camel_multipart_get_number ((CamelMultipart *) containee);
 		for (i = 0; go && i < parts; i++) {
-			CamelMimePart *mpart = camel_multipart_get_part ((CamelMultipart *)containee, i);
+			CamelMimePart *mpart = camel_multipart_get_part ((CamelMultipart *) containee, i);
 
 			cmm_dump_rec (msg, mpart, body, depth+2);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
-		cmm_dump_rec (msg, (CamelMimePart *)containee, body, depth+2);
+		cmm_dump_rec (msg, (CamelMimePart *) containee, body, depth+2);
 	}
 }
 
@@ -1292,5 +1292,5 @@ cmm_dump_rec (CamelMimeMessage *msg, CamelMimePart *part, gint body, gint depth)
 void
 camel_mime_message_dump (CamelMimeMessage *msg, gint body)
 {
-	cmm_dump_rec (msg, (CamelMimePart *)msg, body, 0);
+	cmm_dump_rec (msg, (CamelMimePart *) msg, body, 0);
 }
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index 9607140..7d496dc 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -122,7 +122,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
 		d(printf("Creating message part\n"));
 		content = (CamelDataWrapper *) camel_mime_message_new ();
 		success = camel_mime_part_construct_from_parser_sync (
-			(CamelMimePart *)content, mp, cancellable, error);
+			(CamelMimePart *) content, mp, cancellable, error);
 		break;
 	case CAMEL_MIME_PARSER_STATE_MULTIPART:
 		d(printf("Creating multi-part\n"));
@@ -133,7 +133,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
 		else
 			content = (CamelDataWrapper *) camel_multipart_new ();
 
-		camel_multipart_construct_from_parser ((CamelMultipart *)content, mp);
+		camel_multipart_construct_from_parser ((CamelMultipart *) content, mp);
 		d(printf("Created multi-part\n"));
 		break;
 	default:
@@ -146,7 +146,7 @@ camel_mime_part_construct_content_from_parser (CamelMimePart *dw,
 
 		/* would you believe you have to set this BEFORE you set the content object???  oh my god !!!! */
 		camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type (dw));
-		camel_medium_set_content ((CamelMedium *)dw, content);
+		camel_medium_set_content ((CamelMedium *) dw, content);
 		g_object_unref (content);
 	}
 
@@ -173,10 +173,10 @@ camel_mime_message_build_preview (CamelMimePart *msg,
 	CamelDataWrapper *dw;
 	gboolean got_plain = FALSE;
 
-	dw = camel_medium_get_content ((CamelMedium *)msg);
+	dw = camel_medium_get_content ((CamelMedium *) msg);
 	if (camel_content_type_is (dw->mime_type, "multipart", "*")) {
 		gint i, nparts;
-		CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)msg);
+		CamelMultipart *mp = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg);
 
 		if (!CAMEL_IS_MULTIPART (mp))
 			g_assert (0);
@@ -201,7 +201,7 @@ camel_mime_message_build_preview (CamelMimePart *msg,
 			bstream = camel_stream_buffer_new (mstream, CAMEL_STREAM_BUFFER_READ|CAMEL_STREAM_BUFFER_BUFFER);
 
 			/* We should fetch just 200 unquoted lines. */
-			while ((line = camel_stream_buffer_read_line ((CamelStreamBuffer *)bstream, NULL, NULL)) && str->len < 200) {
+			while ((line = camel_stream_buffer_read_line ((CamelStreamBuffer *) bstream, NULL, NULL)) && str->len < 200) {
 				gchar *tmp = line;
 				if (!line)
 					continue;
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 0924ce8..7d8abb1 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -444,7 +444,7 @@ static void
 mime_part_remove_header (CamelMedium *medium,
                          const gchar *name)
 {
-	CamelMimePart *part = (CamelMimePart *)medium;
+	CamelMimePart *part = (CamelMimePart *) medium;
 
 	mime_part_process_header (medium, name, NULL);
 	camel_header_raw_remove (&part->headers, name);
@@ -454,7 +454,7 @@ static gconstpointer
 mime_part_get_header (CamelMedium *medium,
                       const gchar *name)
 {
-	CamelMimePart *part = (CamelMimePart *)medium;
+	CamelMimePart *part = (CamelMimePart *) medium;
 	const gchar *value;
 
 	value = camel_header_raw_find (&part->headers, name, NULL);
@@ -469,7 +469,7 @@ mime_part_get_header (CamelMedium *medium,
 static GArray *
 mime_part_get_headers (CamelMedium *medium)
 {
-	CamelMimePart *part = (CamelMimePart *)medium;
+	CamelMimePart *part = (CamelMimePart *) medium;
 	GArray *headers;
 	CamelMediumHeader header;
 	struct _camel_header_raw *h;
@@ -746,7 +746,7 @@ mime_part_construct_from_parser_sync (CamelMimePart *mime_part,
 			    && headers->value != content)
 				camel_medium_add_header((CamelMedium *)dw, "X-Invalid-Content-Type", headers->value);
 			else
-				camel_medium_add_header ((CamelMedium *)dw, headers->name, headers->value);
+				camel_medium_add_header ((CamelMedium *) dw, headers->name, headers->value);
 			headers = headers->next;
 		}
 
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index 1f6c8c5..989ccda 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -2069,7 +2069,7 @@ camel_header_param (struct _camel_header_param *p, const gchar *name)
 struct _camel_header_param *
 camel_header_set_param (struct _camel_header_param **l, const gchar *name, const gchar *value)
 {
-	struct _camel_header_param *p = (struct _camel_header_param *)l, *pn;
+	struct _camel_header_param *p = (struct _camel_header_param *) l, *pn;
 
 	if (name == NULL)
 		return NULL;
@@ -2786,7 +2786,7 @@ camel_header_contentid_decode (const gchar *in)
 void
 camel_header_references_list_append_asis (struct _camel_header_references **list, gchar *ref)
 {
-	struct _camel_header_references *w = (struct _camel_header_references *)list, *n;
+	struct _camel_header_references *w = (struct _camel_header_references *) list, *n;
 	while (w->next)
 		w = w->next;
 	n = g_malloc (sizeof (*n));
@@ -3053,8 +3053,8 @@ struct _rfc2184_param {
 static gint
 rfc2184_param_cmp (gconstpointer ap, gconstpointer bp)
 {
-	const struct _rfc2184_param *a = *(gpointer *)ap;
-	const struct _rfc2184_param *b = *(gpointer *)bp;
+	const struct _rfc2184_param *a = *(gpointer *) ap;
+	const struct _rfc2184_param *b = *(gpointer *) bp;
 	gint res;
 
 	res = strcmp (a->param.name, b->param.name);
@@ -4274,7 +4274,7 @@ camel_header_raw_append (struct _camel_header_raw **list, const gchar *name, con
 #ifdef CHECKS
 	check_header (n);
 #endif
-	l = (struct _camel_header_raw *)list;
+	l = (struct _camel_header_raw *) list;
 	while (l->next) {
 		l = l->next;
 	}
@@ -4351,7 +4351,7 @@ camel_header_raw_remove (struct _camel_header_raw **list, const gchar *name)
 	struct _camel_header_raw *l, *p;
 
 	/* the next pointer is at the head of the structure, so this is safe */
-	p = (struct _camel_header_raw *)list;
+	p = (struct _camel_header_raw *) list;
 	l = *list;
 	while (l) {
 		if (!g_ascii_strcasecmp (l->name, name)) {
@@ -4654,7 +4654,7 @@ void
 camel_header_address_list_append_list (struct _camel_header_address **l, struct _camel_header_address **h)
 {
 	if (l) {
-		struct _camel_header_address *n = (struct _camel_header_address *)l;
+		struct _camel_header_address *n = (struct _camel_header_address *) l;
 
 		while (n->next)
 			n = n->next;
@@ -4830,7 +4830,7 @@ camel_header_address_fold (const gchar *in, gsize headerlen)
 	g_string_free (out, FALSE);
 
 	if (needunfold)
-		g_free ((gchar *)in);
+		g_free ((gchar *) in);
 
 	return ret;
 }
@@ -4921,7 +4921,7 @@ camel_header_fold (const gchar *in, gsize headerlen)
 	g_string_free (out, FALSE);
 
 	if (needunfold)
-		g_free ((gchar *)in);
+		g_free ((gchar *) in);
 
 	return ret;
 }
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 769102a..b82debe 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -101,7 +101,7 @@ multipart_signed_skip_content (CamelMimeParser *cmp)
 		break;
 	case CAMEL_MIME_PARSER_STATE_MESSAGE:
 		/* message body part */
-		(void)camel_mime_parser_step (cmp, &buf, &len);
+		(void) camel_mime_parser_step (cmp, &buf, &len);
 		multipart_signed_skip_content (cmp);
 
 		/* clean up followon state if any, see camel-mime-message.c */
@@ -134,7 +134,7 @@ static gint
 multipart_signed_parse_content (CamelMultipartSigned *mps)
 {
 	CamelMimeParser *cmp;
-	CamelMultipart *mp = (CamelMultipart *)mps;
+	CamelMultipart *mp = (CamelMultipart *) mps;
 	CamelStream *stream;
 	const gchar *boundary;
 	gchar *buf;
@@ -144,7 +144,7 @@ multipart_signed_parse_content (CamelMultipartSigned *mps)
 	boundary = camel_multipart_get_boundary (mp);
 	g_return_val_if_fail (boundary != NULL, -1);
 
-	stream = ((CamelDataWrapper *)mps)->stream;
+	stream = ((CamelDataWrapper *) mps)->stream;
 	g_return_val_if_fail (stream != NULL, -1);
 
 	/* This is all seriously complex.
@@ -207,7 +207,7 @@ static void
 multipart_signed_set_stream (CamelMultipartSigned *mps,
                              CamelStream *stream)
 {
-	CamelDataWrapper *dw = (CamelDataWrapper *)mps;
+	CamelDataWrapper *dw = (CamelDataWrapper *) mps;
 
 	if (dw->stream)
 		g_object_unref (dw->stream);
@@ -273,7 +273,7 @@ multipart_signed_set_mime_type_field (CamelDataWrapper *data_wrapper,
                                       CamelContentType *mime_type)
 {
 	CamelDataWrapperClass *data_wrapper_class;
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) data_wrapper;
 
 	/* we snoop the mime type to get boundary and hash info */
 
@@ -300,8 +300,8 @@ multipart_signed_write_to_stream_sync (CamelDataWrapper *data_wrapper,
                                        GCancellable *cancellable,
                                        GError **error)
 {
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
-	CamelMultipart *mp = (CamelMultipart *)mps;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) data_wrapper;
+	CamelMultipart *mp = (CamelMultipart *) mps;
 	const gchar *boundary;
 	gssize total = 0;
 	gssize count;
@@ -406,7 +406,7 @@ multipart_signed_construct_from_stream_sync (CamelDataWrapper *data_wrapper,
                                              GCancellable *cancellable,
                                              GError **error)
 {
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)data_wrapper;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) data_wrapper;
 	CamelStream *mem = camel_stream_mem_new ();
 
 	if (camel_stream_write_to_stream (
@@ -453,8 +453,8 @@ static CamelMimePart *
 multipart_signed_get_part (CamelMultipart *multipart,
                            guint index)
 {
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
-	CamelDataWrapper *dw = (CamelDataWrapper *)multipart;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) multipart;
+	CamelDataWrapper *dw = (CamelDataWrapper *) multipart;
 	CamelStream *stream;
 
 	switch (index) {
@@ -465,7 +465,7 @@ multipart_signed_get_part (CamelMultipart *multipart,
 			stream = g_object_ref (mps->contentraw);
 		} else if (mps->start1 == -1
 			   && multipart_signed_parse_content (mps) == -1
-			   && ((CamelDataWrapper *)mps)->stream == NULL) {
+			   && ((CamelDataWrapper *) mps)->stream == NULL) {
 			g_warning("Trying to get content on an invalid multipart/signed");
 			return NULL;
 		} else if (dw->stream == NULL) {
@@ -511,8 +511,8 @@ multipart_signed_get_part (CamelMultipart *multipart,
 static guint
 multipart_signed_get_number (CamelMultipart *multipart)
 {
-	CamelDataWrapper *dw = (CamelDataWrapper *)multipart;
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
+	CamelDataWrapper *dw = (CamelDataWrapper *) multipart;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) multipart;
 
 	/* check what we have, so we return something reasonable */
 
@@ -535,7 +535,7 @@ multipart_signed_construct_from_parser (CamelMultipart *multipart,
 {
 	gint err;
 	CamelContentType *content_type;
-	CamelMultipartSigned *mps = (CamelMultipartSigned *)multipart;
+	CamelMultipartSigned *mps = (CamelMultipartSigned *) multipart;
 	gchar *buf;
 	gsize len;
 	CamelStream *stream;
@@ -678,7 +678,7 @@ camel_multipart_signed_get_content_stream (CamelMultipartSigned *mps,
 
 		/* Note: see rfc2015 or rfc3156, section 5 */
 		canon_filter = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
-		camel_stream_filter_add ((CamelStreamFilter *)constream, (CamelMimeFilter *)canon_filter);
+		camel_stream_filter_add ((CamelStreamFilter *) constream, (CamelMimeFilter *) canon_filter);
 		g_object_unref (canon_filter);
 	}
 
diff --git a/camel/camel-net-utils.c b/camel/camel-net-utils.c
index d9adfd4..ab8aaf8 100644
--- a/camel/camel-net-utils.c
+++ b/camel/camel-net-utils.c
@@ -527,7 +527,7 @@ cs_waitinfo (gpointer (worker)(gpointer),
 			g_thread_join (thread);
 			d(printf("child done\n"));
 
-			reply = (struct _addrinfo_msg *)camel_msgport_try_pop (reply_port);
+			reply = (struct _addrinfo_msg *) camel_msgport_try_pop (reply_port);
 			if (reply != msg)
 				g_warning ("%s: Received msg reply %p doesn't match msg %p", G_STRFUNC, reply, msg);
 		}
@@ -628,7 +628,7 @@ cs_getaddrinfo (gpointer data)
 		res->ai_family = AF_INET;
 		res->ai_addrlen = sizeof (*sin);
 		res->ai_addr = g_malloc (sizeof (*sin));
-		sin = (struct sockaddr_in *)res->ai_addr;
+		sin = (struct sockaddr_in *) res->ai_addr;
 		sin->sin_family = AF_INET;
 		sin->sin_port = port;
 		memcpy (&sin->sin_addr, h.h_addr_list[i], sizeof (sin->sin_addr));
@@ -641,7 +641,7 @@ cs_getaddrinfo (gpointer data)
 		}
 	}
 reply:
-	camel_msgport_reply ((CamelMsg *)msg);
+	camel_msgport_reply ((CamelMsg *) msg);
 cancel:
 	return NULL;
 }
@@ -663,7 +663,7 @@ cs_getaddrinfo (gpointer data)
 	}
 
 	if (!info->cancelled)
-		camel_msgport_reply ((CamelMsg *)info);
+		camel_msgport_reply ((CamelMsg *) info);
 
 	return NULL;
 }
@@ -763,7 +763,7 @@ cs_getnameinfo (gpointer data)
 	struct _addrinfo_msg *msg = data;
 	gint herr;
 	struct hostent h;
-	struct sockaddr_in *sin = (struct sockaddr_in *)msg->addr;
+	struct sockaddr_in *sin = (struct sockaddr_in *) msg->addr;
 
 	/* FIXME: error code */
 	if (msg->addr->sa_family != AF_INET) {
@@ -801,7 +801,7 @@ cs_getnameinfo (gpointer data)
 		sprintf(msg->serv, "%d", sin->sin_port);
 
 	if (!msg->cancelled)
-		camel_msgport_reply ((CamelMsg *)msg);
+		camel_msgport_reply ((CamelMsg *) msg);
 cancel:
 	return NULL;
 }
@@ -815,7 +815,7 @@ cs_getnameinfo (gpointer data)
 	msg->result = getnameinfo (msg->addr, msg->addrlen, msg->host, msg->hostlen, msg->serv, msg->servlen, msg->flags);
 
 	if (!msg->cancelled)
-		camel_msgport_reply ((CamelMsg *)msg);
+		camel_msgport_reply ((CamelMsg *) msg);
 
 	return NULL;
 }
diff --git a/camel/camel-nntp-address.c b/camel/camel-nntp-address.c
index 85bf1b9..9e34fbb 100644
--- a/camel/camel-nntp-address.c
+++ b/camel/camel-nntp-address.c
@@ -153,12 +153,12 @@ camel_nntp_address_add (CamelNNTPAddress *a, const gchar *name)
 
 	g_assert (CAMEL_IS_NNTP_ADDRESS (a));
 
-	index = ((CamelAddress *)a)->addresses->len;
+	index = ((CamelAddress *) a)->addresses->len;
 	for (i=0;i<index;i++)
-		if (!strcmp (g_ptr_array_index (((CamelAddress *)a)->addresses, i), name))
+		if (!strcmp (g_ptr_array_index (((CamelAddress *) a)->addresses, i), name))
 			return i;
 
-	g_ptr_array_add (((CamelAddress *)a)->addresses, g_strdup (name));
+	g_ptr_array_add (((CamelAddress *) a)->addresses, g_strdup (name));
 
 	return index;
 }
@@ -178,7 +178,7 @@ camel_nntp_address_get (CamelNNTPAddress *a, gint index, const gchar **namep)
 {
 	g_assert (CAMEL_IS_NNTP_ADDRESS (a));
 
-	if (index < 0 || index >= ((CamelAddress *)a)->addresses->len)
+	if (index < 0 || index >= ((CamelAddress *) a)->addresses->len)
 		return FALSE;
 
 	if (namep)
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index ce94165..fecbbe5 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -59,7 +59,7 @@ partition_table_finalize (GObject *object)
 	CamelBlock *bl;
 
 	if (table->blocks) {
-		while ((bl = (CamelBlock *)camel_dlist_remhead (&table->partition))) {
+		while ((bl = (CamelBlock *) camel_dlist_remhead (&table->partition))) {
 			camel_block_file_sync_block (table->blocks, bl);
 			camel_block_file_unref_block (table->blocks, bl);
 		}
@@ -134,7 +134,7 @@ static CamelBlock *find_partition (CamelPartitionTable *cpi, camel_hash_t id, gi
 	CamelPartitionMap *part;
 
 	/* first, find the block this key might be in, then binary search the block */
-	bl = (CamelBlock *)cpi->partition.head;
+	bl = (CamelBlock *) cpi->partition.head;
 	while (bl->next) {
 		ptb = (CamelPartitionMapBlock *)&bl->data;
 		part = ptb->partition;
@@ -220,7 +220,7 @@ camel_partition_table_new (CamelBlockFile *bs,
 
 		root = ptb->next;
 		camel_block_file_detach_block (bs, block);
-		camel_dlist_addtail (&cpi->partition, (CamelDListNode *)block);
+		camel_dlist_addtail (&cpi->partition, (CamelDListNode *) block);
 	} while (root);
 
 	return cpi;
@@ -242,7 +242,7 @@ camel_partition_table_sync (CamelPartitionTable *cpi)
 	CAMEL_PARTITION_TABLE_LOCK (cpi, lock);
 
 	if (cpi->blocks) {
-		bl = (CamelBlock *)cpi->partition.head;
+		bl = (CamelBlock *) cpi->partition.head;
 		bn = bl->next;
 		while (bn) {
 			ret = camel_block_file_sync_block (cpi->blocks, bl);
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index 67f45bf..8243c09 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -280,8 +280,8 @@ camel_provider_register (CamelProvider *provider)
 static gint
 provider_compare (gconstpointer a, gconstpointer b)
 {
-	const CamelProvider *cpa = (const CamelProvider *)a;
-	const CamelProvider *cpb = (const CamelProvider *)b;
+	const CamelProvider *cpa = (const CamelProvider *) a;
+	const CamelProvider *cpb = (const CamelProvider *) b;
 
 	return strcmp (cpa->name, cpb->name);
 }
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 9be82cf..9f1d1de 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -332,9 +332,9 @@ sasl_gssapi_challenge_sync (CamelSasl *sasl,
 			priv->state = GSSAPI_STATE_CONTINUE_NEEDED;
 			break;
 		default:
-			if (major == (OM_uint32)GSS_S_FAILURE &&
-			    (minor == (OM_uint32)KRB5KRB_AP_ERR_TKT_EXPIRED ||
-			     minor == (OM_uint32)KRB5KDC_ERR_NEVER_VALID) &&
+			if (major == (OM_uint32) GSS_S_FAILURE &&
+			    (minor == (OM_uint32) KRB5KRB_AP_ERR_TKT_EXPIRED ||
+			     minor == (OM_uint32) KRB5KDC_ERR_NEVER_VALID) &&
 			    send_dbus_message (url->user))
 					goto challenge;
 
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index b0fbd7b..3dea971 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -494,14 +494,14 @@ des (guint32 ks[16][2], guchar block[8])
 	guint32 left, right, work;
 
 	/* Read input block and place in left/right in big-endian order */
-	left = ((guint32)block[0] << 24)
-	 | ((guint32)block[1] << 16)
-	 | ((guint32)block[2] << 8)
-	 | (guint32)block[3];
-	right = ((guint32)block[4] << 24)
-	 | ((guint32)block[5] << 16)
-	 | ((guint32)block[6] << 8)
-	 | (guint32)block[7];
+	left = ((guint32) block[0] << 24)
+	 | ((guint32) block[1] << 16)
+	 | ((guint32) block[2] << 8)
+	 | (guint32) block[3];
+	right = ((guint32) block[4] << 24)
+	 | ((guint32) block[5] << 16)
+	 | ((guint32) block[6] << 8)
+	 | (guint32) block[7];
 
 	/* Hoey's clever initial permutation algorithm, from Outerbridge
 	 * (see Schneier p 478)
@@ -651,14 +651,14 @@ deskey (DES_KS k, guchar *key, gint decrypt)
 			}
 		}
 		/* Now convert to packed odd/even interleaved form */
-		k[i][0] = ((guint32)ks[0] << 24)
-		 | ((guint32)ks[2] << 16)
-		 | ((guint32)ks[4] << 8)
-		 | ((guint32)ks[6]);
-		k[i][1] = ((guint32)ks[1] << 24)
-		 | ((guint32)ks[3] << 16)
-		 | ((guint32)ks[5] << 8)
-		 | ((guint32)ks[7]);
+		k[i][0] = ((guint32) ks[0] << 24)
+		 | ((guint32) ks[2] << 16)
+		 | ((guint32) ks[4] << 8)
+		 | ((guint32) ks[6]);
+		k[i][1] = ((guint32) ks[1] << 24)
+		 | ((guint32) ks[3] << 16)
+		 | ((guint32) ks[5] << 8)
+		 | ((guint32) ks[7]);
 	}
 }
 
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
index 32941d3..36617ce 100644
--- a/camel/camel-search-private.c
+++ b/camel/camel-search-private.c
@@ -218,7 +218,7 @@ camel_ustrstrcase (const gchar *haystack, const gchar *needle)
 	if (!p)
 		return NULL;
 
-	p = (const guchar *)haystack;
+	p = (const guchar *) haystack;
 	while ((u = camel_utf8_getc (&p))) {
 		gunichar c;
 
@@ -262,8 +262,8 @@ static gint
 camel_ustrcasecmp (const gchar *ps1, const gchar *ps2)
 {
 	gunichar u1, u2 = 0;
-	const guchar *s1 = (const guchar *)ps1;
-	const guchar *s2 = (const guchar *)ps2;
+	const guchar *s1 = (const guchar *) ps1;
+	const guchar *s2 = (const guchar *) ps2;
 
 	CAMEL_SEARCH_COMPARE (s1, s2, NULL);
 
@@ -294,8 +294,8 @@ static gint
 camel_ustrncasecmp (const gchar *ps1, const gchar *ps2, gsize len)
 {
 	gunichar u1, u2 = 0;
-	const guchar *s1 = (const guchar *)ps1;
-	const guchar *s2 = (const guchar *)ps2;
+	const guchar *s1 = (const guchar *) ps1;
+	const guchar *s2 = (const guchar *) ps2;
 
 	CAMEL_SEARCH_COMPARE (s1, s2, NULL);
 
@@ -344,7 +344,7 @@ header_match (const gchar *value, const gchar *match, camel_search_match_t how)
 
 	/* from dan the man, if we have mixed case, perform a case-sensitive match,
 	   otherwise not */
-	p = (const guchar *)match;
+	p = (const guchar *) match;
 	while ((c = camel_utf8_getc (&p))) {
 		if (g_unichar_isupper (c)) {
 			switch (how) {
@@ -391,9 +391,9 @@ camel_search_header_match (const gchar *value, const gchar *match, camel_search_
 	gchar *v, *vdom, *mdom;
 	gunichar c;
 
-	ptr = (const guchar *)value;
+	ptr = (const guchar *) value;
 	while ((c = camel_utf8_getc (&ptr)) && g_unichar_isspace (c))
-		value = (const gchar *)ptr;
+		value = (const gchar *) ptr;
 
 	switch (type) {
 	case CAMEL_SEARCH_TYPE_ENCODED:
@@ -412,12 +412,12 @@ camel_search_header_match (const gchar *value, const gchar *match, camel_search_
 			v = g_alloca (vdom-value+1);
 			memcpy (v, value, vdom-value);
 			v[vdom-value] = 0;
-			value = (gchar *)v;
+			value = (gchar *) v;
 		} else if (mdom != NULL && vdom == NULL) {
 			v = g_alloca (mdom-match+1);
 			memcpy (v, match, mdom-match);
 			v[mdom-match] = 0;
-			match = (gchar *)v;
+			match = (gchar *) v;
 		}
 		/* Falls through */
 	case CAMEL_SEARCH_TYPE_ASIS:
@@ -432,9 +432,9 @@ camel_search_header_match (const gchar *value, const gchar *match, camel_search_
 		/* Now we decode any addresses, and try asis matches on name and address parts */
 		cia = camel_internet_address_new ();
 		if (type == CAMEL_SEARCH_TYPE_ADDRESS_ENCODED)
-			camel_address_decode ((CamelAddress *)cia, value);
+			camel_address_decode ((CamelAddress *) cia, value);
 		else
-			camel_address_unformat ((CamelAddress *)cia, value);
+			camel_address_unformat ((CamelAddress *) cia, value);
 
 		for (i=0; !truth && camel_internet_address_get (cia, i, &name, &addr);i++)
 			truth = (name && header_match (name, match, how)) || (addr && header_match (addr, match, how));
@@ -464,13 +464,13 @@ camel_search_message_body_contains (CamelDataWrapper *object, regex_t *pattern)
 	if (CAMEL_IS_MULTIPART (containee)) {
 		parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
 		for (i = 0; i < parts && truth == FALSE; i++) {
-			CamelDataWrapper *part = (CamelDataWrapper *)camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
+			CamelDataWrapper *part = (CamelDataWrapper *) camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
 			if (part)
 				truth = camel_search_message_body_contains (part, pattern);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
 		/* for messages we only look at its contents */
-		truth = camel_search_message_body_contains ((CamelDataWrapper *)containee, pattern);
+		truth = camel_search_message_body_contains ((CamelDataWrapper *) containee, pattern);
 	} else if (camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "text", "*")
 		|| camel_content_type_is(CAMEL_DATA_WRAPPER (containee)->mime_type, "x-evolution", "evolution-rss-feed")) {
 		/* for all other text parts, we look inside, otherwise we dont care */
@@ -565,7 +565,7 @@ camel_search_words_split (const guchar *in)
 
 	g_string_free (w, TRUE);
 	words->len = list->len;
-	words->words = (struct _camel_search_word **)list->pdata;
+	words->words = (struct _camel_search_word **) list->pdata;
 	words->type = all;
 	g_ptr_array_free (list, FALSE);
 
@@ -617,7 +617,7 @@ camel_search_words_simple (struct _camel_search_words *wordin)
 	}
 
 	words->len = list->len;
-	words->words = (struct _camel_search_word **)list->pdata;
+	words->words = (struct _camel_search_word **) list->pdata;
 	words->type = all;
 	g_ptr_array_free (list, FALSE);
 
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index ee267b2..b0bda48 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -93,14 +93,14 @@ smime_cert_data_clone (gpointer cert_data)
 static void
 sm_write_stream (gpointer arg, const gchar *buf, gulong len)
 {
-	camel_stream_write ((CamelStream *)arg, buf, len, NULL, NULL);
+	camel_stream_write ((CamelStream *) arg, buf, len, NULL, NULL);
 }
 
 static PK11SymKey *
 sm_decrypt_key (gpointer arg, SECAlgorithmID *algid)
 {
 	printf ("Decrypt key called\n");
-	return (PK11SymKey *)arg;
+	return (PK11SymKey *) arg;
 }
 
 static const gchar *
@@ -335,7 +335,7 @@ sm_signing_cmsmessage (CamelSMIMEContext *context,
 	g_return_val_if_fail (hash != NULL, NULL);
 
 	if ((cert = CERT_FindUserCertByUsage (p->certdb,
-					     (gchar *)nick,
+					     (gchar *) nick,
 					     certUsageEmailSigner,
 					     PR_TRUE,
 					     NULL)) == NULL) {
@@ -440,7 +440,7 @@ sm_signing_cmsmessage (CamelSMIMEContext *context,
 		} else {
 			/* encrypt key uses same nick */
 			if ((ekpcert = CERT_FindUserCertByUsage (
-				     p->certdb, (gchar *)nick,
+				     p->certdb, (gchar *) nick,
 				     certUsageEmailRecipient, PR_TRUE, NULL)) == NULL) {
 				g_set_error (
 					error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
@@ -529,7 +529,7 @@ sm_verify_cmsg (CamelCipherContext *context,
                 GCancellable *cancellable,
                 GError **error)
 {
-	CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
+	CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *) context)->priv;
 	NSSCMSSignedData *sigd = NULL;
 #if 0
 	NSSCMSEnvelopedData *envd;
@@ -561,7 +561,7 @@ sm_verify_cmsg (CamelCipherContext *context,
 
 		switch (typetag) {
 		case SEC_OID_PKCS7_SIGNED_DATA:
-			sigd = (NSSCMSSignedData *)NSS_CMSContentInfo_GetContent (cinfo);
+			sigd = (NSSCMSSignedData *) NSS_CMSContentInfo_GetContent (cinfo);
 			if (sigd == NULL) {
 				set_nss_error (error, _("No signed data in signature"));
 				goto fail;
@@ -804,8 +804,8 @@ smime_context_sign_sync (CamelCipherContext *context,
 	}
 
 	cmsg = sm_signing_cmsmessage (
-		(CamelSMIMEContext *)context, userid, &sechash,
-		((CamelSMIMEContext *)context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN, error);
+		(CamelSMIMEContext *) context, userid, &sechash,
+		((CamelSMIMEContext *) context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN, error);
 	if (cmsg == NULL)
 		return FALSE;
 
@@ -855,7 +855,7 @@ smime_context_sign_sync (CamelCipherContext *context,
 		dw, ostream, cancellable, NULL);
 	dw->encoding = CAMEL_TRANSFER_ENCODING_BINARY;
 
-	if (((CamelSMIMEContext *)context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN) {
+	if (((CamelSMIMEContext *) context)->priv->sign_mode == CAMEL_SMIME_SIGN_CLEARSIGN) {
 		CamelMultipartSigned *mps;
 		CamelMimePart *sigpart;
 
@@ -865,7 +865,7 @@ smime_context_sign_sync (CamelCipherContext *context,
 		camel_data_wrapper_set_mime_type_field (dw, ct);
 		camel_content_type_unref (ct);
 
-		camel_medium_set_content ((CamelMedium *)sigpart, dw);
+		camel_medium_set_content ((CamelMedium *) sigpart, dw);
 
 		camel_mime_part_set_filename (sigpart, "smime.p7s");
 		camel_mime_part_set_disposition (sigpart, "attachment");
@@ -875,16 +875,16 @@ smime_context_sign_sync (CamelCipherContext *context,
 		ct = camel_content_type_new ("multipart", "signed");
 		camel_content_type_set_param (ct, "micalg", camel_cipher_context_hash_to_id (context, get_hash_from_oid (sechash)));
 		camel_content_type_set_param (ct, "protocol", class->sign_protocol);
-		camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *)mps, ct);
+		camel_data_wrapper_set_mime_type_field ((CamelDataWrapper *) mps, ct);
 		camel_content_type_unref (ct);
-		camel_multipart_set_boundary ((CamelMultipart *)mps, NULL);
+		camel_multipart_set_boundary ((CamelMultipart *) mps, NULL);
 
 		mps->signature = sigpart;
 		mps->contentraw = istream;
 		camel_stream_reset (istream, NULL);
 		g_object_ref (istream);
 
-		camel_medium_set_content ((CamelMedium *)opart, (CamelDataWrapper *)mps);
+		camel_medium_set_content ((CamelMedium *) opart, (CamelDataWrapper *) mps);
 	} else {
 		ct = camel_content_type_new ("application", "x-pkcs7-mime");
 		camel_content_type_set_param (ct, "name", "smime.p7m");
@@ -892,7 +892,7 @@ smime_context_sign_sync (CamelCipherContext *context,
 		camel_data_wrapper_set_mime_type_field (dw, ct);
 		camel_content_type_unref (ct);
 
-		camel_medium_set_content ((CamelMedium *)opart, dw);
+		camel_medium_set_content ((CamelMedium *) opart, dw);
 
 		camel_mime_part_set_filename (opart, "smime.p7m");
 		camel_mime_part_set_description (opart, "S/MIME Signed Message");
@@ -928,7 +928,7 @@ smime_context_verify_sync (CamelCipherContext *context,
 
 	class = CAMEL_CIPHER_CONTEXT_GET_CLASS (context);
 
-	dw = camel_medium_get_content ((CamelMedium *)ipart);
+	dw = camel_medium_get_content ((CamelMedium *) ipart);
 	ct = dw->mime_type;
 
 	/* FIXME: we should stream this to the decoder */
@@ -936,7 +936,7 @@ smime_context_verify_sync (CamelCipherContext *context,
 	mem = camel_stream_mem_new_with_byte_array (buffer);
 
 	if (camel_content_type_is (ct, "multipart", "signed")) {
-		CamelMultipart *mps = (CamelMultipart *)dw;
+		CamelMultipart *mps = (CamelMultipart *) dw;
 
 		tmp = camel_content_type_param (ct, "protocol");
 		if (!CAMEL_IS_MULTIPART_SIGNED (mps)
@@ -951,7 +951,7 @@ smime_context_verify_sync (CamelCipherContext *context,
 		}
 
 		constream = camel_multipart_signed_get_content_stream (
-			(CamelMultipartSigned *)mps, error);
+			(CamelMultipartSigned *) mps, error);
 		if (constream == NULL)
 			goto fail;
 
@@ -981,7 +981,7 @@ smime_context_verify_sync (CamelCipherContext *context,
 	camel_data_wrapper_decode_to_stream_sync (
 		camel_medium_get_content (
 			CAMEL_MEDIUM (sigpart)), mem, cancellable, NULL);
-	(void)NSS_CMSDecoder_Update (dec, (gchar *) buffer->data, buffer->len);
+	(void) NSS_CMSDecoder_Update (dec, (gchar *) buffer->data, buffer->len);
 	cmsg = NSS_CMSDecoder_Finish (dec);
 	if (cmsg == NULL) {
 		set_nss_error (error, _("Decoder failed"));
@@ -1008,7 +1008,7 @@ smime_context_encrypt_sync (CamelCipherContext *context,
                             GCancellable *cancellable,
                             GError **error)
 {
-	CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *)context)->priv;
+	CamelSMIMEContextPrivate *p = ((CamelSMIMEContext *) context)->priv;
 	/*NSSCMSRecipientInfo **recipient_infos;*/
 	CERTCertificate **recipient_certs = NULL;
 	NSSCMSContentInfo *cinfo;
@@ -1034,7 +1034,7 @@ smime_context_encrypt_sync (CamelCipherContext *context,
 	}
 
 	/* Lookup all recipients certs, for later working */
-	recipient_certs = (CERTCertificate **)PORT_ArenaZAlloc (poolp, sizeof (*recipient_certs[0])*(recipients->len + 1));
+	recipient_certs = (CERTCertificate **) PORT_ArenaZAlloc (poolp, sizeof (*recipient_certs[0])*(recipients->len + 1));
 	if (recipient_certs == NULL) {
 		set_nss_error (error, g_strerror (ENOMEM));
 		goto fail;
@@ -1157,7 +1157,7 @@ smime_context_encrypt_sync (CamelCipherContext *context,
 	camel_data_wrapper_set_mime_type_field (dw, ct);
 	camel_content_type_unref (ct);
 
-	camel_medium_set_content ((CamelMedium *)opart, dw);
+	camel_medium_set_content ((CamelMedium *) opart, dw);
 	g_object_unref (dw);
 
 	camel_mime_part_set_disposition (opart, "attachment");
@@ -1359,7 +1359,7 @@ camel_smime_context_describe_part (CamelSMIMEContext *context, CamelMimePart *pa
 		istream = camel_stream_mem_new_with_byte_array (buffer);
 		/* FIXME Pass a GCancellable and GError here. */
 		camel_data_wrapper_decode_to_stream_sync (
-			camel_medium_get_content ((CamelMedium *)part),
+			camel_medium_get_content ((CamelMedium *) part),
 			istream, NULL, NULL);
 		camel_stream_reset (istream, NULL);
 
diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c
index ac4e56f..75708f6 100644
--- a/camel/camel-store-summary.c
+++ b/camel/camel-store-summary.c
@@ -234,7 +234,7 @@ store_summary_store_info_string (CamelStoreSummary *summary,
 			CamelURL *uri;
 
 			uri = camel_url_new_with_base (summary->uri_base, info->path);
-			((CamelStoreInfo *)info)->uri = camel_url_to_string (uri, 0);
+			((CamelStoreInfo *) info)->uri = camel_url_to_string (uri, 0);
 			camel_url_free (uri);
 		}
 		return info->uri;
@@ -258,18 +258,18 @@ store_summary_store_info_set_string (CamelStoreSummary *summary,
 	switch (type) {
 	case CAMEL_STORE_INFO_PATH:
 		camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
-		g_hash_table_remove (summary->folders_path, (gchar *)camel_store_info_path (summary, info));
+		g_hash_table_remove (summary->folders_path, (gchar *) camel_store_info_path (summary, info));
 		g_free (info->path);
 		g_free (info->uri);
 		info->uri = NULL;
 		info->path = g_strdup (str);
-		g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info);
+		g_hash_table_insert (summary->folders_path, (gchar *) camel_store_info_path (summary, info), info);
 		summary->flags |= CAMEL_STORE_SUMMARY_DIRTY;
 		camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
 		break;
 	case CAMEL_STORE_INFO_NAME:
 		camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
-		g_hash_table_remove (summary->folders_path, (gchar *)camel_store_info_path (summary, info));
+		g_hash_table_remove (summary->folders_path, (gchar *) camel_store_info_path (summary, info));
 		p = strrchr (info->path, '/');
 		if (p) {
 			len = p-info->path+1;
@@ -283,7 +283,7 @@ store_summary_store_info_set_string (CamelStoreSummary *summary,
 		info->path = v;
 		g_free (info->uri);
 		info->uri = NULL;
-		g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info);
+		g_hash_table_insert (summary->folders_path, (gchar *) camel_store_info_path (summary, info), info);
 		camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
 		break;
 	case CAMEL_STORE_INFO_URI:
@@ -753,7 +753,7 @@ camel_store_summary_add (CamelStoreSummary *summary,
 	camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
 
 	g_ptr_array_add (summary->folders, info);
-	g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info);
+	g_hash_table_insert (summary->folders_path, (gchar *) camel_store_info_path (summary, info), info);
 	summary->flags |= CAMEL_STORE_SUMMARY_DIRTY;
 
 	camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
@@ -786,7 +786,7 @@ camel_store_summary_add_from_path (CamelStoreSummary *summary,
 	} else {
 		info = camel_store_summary_info_new_from_path (summary, path);
 		g_ptr_array_add (summary->folders, info);
-		g_hash_table_insert (summary->folders_path, (gchar *)camel_store_info_path (summary, info), info);
+		g_hash_table_insert (summary->folders_path, (gchar *) camel_store_info_path (summary, info), info);
 		summary->flags |= CAMEL_STORE_SUMMARY_DIRTY;
 	}
 
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 95e4017..8a51d96 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -220,7 +220,7 @@ store_get_special (CamelStore *store,
 	folders = camel_object_bag_list (store->folders);
 	for (i=0;i<folders->len;i++) {
 		if (!CAMEL_IS_VTRASH_FOLDER (folders->pdata[i]))
-			camel_vee_folder_add_folder ((CamelVeeFolder *)folder, (CamelFolder *)folders->pdata[i]);
+			camel_vee_folder_add_folder ((CamelVeeFolder *) folder, (CamelFolder *) folders->pdata[i]);
 		g_object_unref (folders->pdata[i]);
 	}
 	g_ptr_array_free (folders, TRUE);
@@ -1762,8 +1762,8 @@ static gint
 folder_info_cmp (gconstpointer ap,
                  gconstpointer bp)
 {
-	const CamelFolderInfo *a = ((CamelFolderInfo **)ap)[0];
-	const CamelFolderInfo *b = ((CamelFolderInfo **)bp)[0];
+	const CamelFolderInfo *a = ((CamelFolderInfo **) ap)[0];
+	const CamelFolderInfo *b = ((CamelFolderInfo **) bp)[0];
 
 	return strcmp (a->full_name, b->full_name);
 }
diff --git a/camel/camel-stream-mem.c b/camel/camel-stream-mem.c
index 7d7203a..362237e 100644
--- a/camel/camel-stream-mem.c
+++ b/camel/camel-stream-mem.c
@@ -123,7 +123,7 @@ stream_mem_write (CamelStream *stream,
 
 	/* FIXME: we shouldn't use g_byte_arrays or g_malloc perhaps? */
 	if (priv->position == priv->buffer->len) {
-		g_byte_array_append (priv->buffer, (const guint8 *)buffer, nwrite);
+		g_byte_array_append (priv->buffer, (const guint8 *) buffer, nwrite);
 	} else {
 		g_byte_array_set_size (priv->buffer, nwrite + priv->buffer->len);
 		memcpy (priv->buffer->data + priv->position, buffer, nwrite);
@@ -289,7 +289,7 @@ camel_stream_mem_new_with_buffer (const gchar *buffer,
 	g_return_val_if_fail (buffer != NULL, NULL);
 
 	ba = g_byte_array_new ();
-	g_byte_array_append (ba, (const guint8 *)buffer, len);
+	g_byte_array_append (ba, (const guint8 *) buffer, len);
 
 	return camel_stream_mem_new_with_byte_array (ba);
 }
@@ -404,7 +404,7 @@ camel_stream_mem_set_buffer (CamelStreamMem *mem,
 	g_return_if_fail (buffer != NULL);
 
 	ba = g_byte_array_new ();
-	g_byte_array_append (ba, (const guint8 *)buffer, len);
+	g_byte_array_append (ba, (const guint8 *) buffer, len);
 	camel_stream_mem_set_byte_array (mem, ba);
 	mem->priv->owner = TRUE;
 }
diff --git a/camel/camel-stream-process.c b/camel/camel-stream-process.c
index 2f699da..8202552 100644
--- a/camel/camel-stream-process.c
+++ b/camel/camel-stream-process.c
@@ -241,7 +241,7 @@ camel_stream_process_connect (CamelStreamProcess *stream,
 
 	stream->childpid = fork ();
 	if (!stream->childpid) {
-		do_exec_command (sockfds[1], command, (gchar **)env);
+		do_exec_command (sockfds[1], command, (gchar **) env);
 	} else if (stream->childpid == -1) {
 		close (sockfds[0]);
 		close (sockfds[1]);
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 5241faa..1456bda 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -534,7 +534,7 @@ sockaddr_to_praddr (struct sockaddr *s, gint len, PRNetAddr *addr)
 	memset (addr, 0, sizeof (*addr));
 
 	if (s->sa_family == AF_INET) {
-		struct sockaddr_in *sin = (struct sockaddr_in *)s;
+		struct sockaddr_in *sin = (struct sockaddr_in *) s;
 
 		if (len < sizeof (*sin))
 			return -1;
@@ -547,7 +547,7 @@ sockaddr_to_praddr (struct sockaddr *s, gint len, PRNetAddr *addr)
 	}
 #ifdef ENABLE_IPv6
 	else if (s->sa_family == PR_AF_INET6) {
-		struct sockaddr_in6 *sin = (struct sockaddr_in6 *)s;
+		struct sockaddr_in6 *sin = (struct sockaddr_in6 *) s;
 
 		if (len < sizeof (*sin))
 			return -1;
@@ -1216,7 +1216,7 @@ sockaddr_from_praddr (PRNetAddr *addr, socklen_t *len)
 		memcpy (&sin->sin_addr, &addr->inet.ip, sizeof (sin->sin_addr));
 		*len = sizeof(*sin);
 
-		return (struct sockaddr *)sin;
+		return (struct sockaddr *) sin;
 	}
 #ifdef ENABLE_IPv6
 	else if (addr->raw.family == PR_AF_INET6) {
@@ -1229,7 +1229,7 @@ sockaddr_from_praddr (PRNetAddr *addr, socklen_t *len)
 		sin->sin6_scope_id = addr->ipv6.scope_id;
 		*len = sizeof(*sin);
 
-		return (struct sockaddr *)sin;
+		return (struct sockaddr *) sin;
 	}
 #endif
 
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index b486bfa..e21d5a8 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -191,7 +191,7 @@ ssl_auth_cert (gpointer data, PRFileDesc *sockfd, PRBool checksig, PRBool is_ser
 
 	cert = SSL_PeerCertificate (sockfd);
 	pinarg = SSL_RevealPinArg (sockfd);
-	status = CERT_VerifyCertNow ((CERTCertDBHandle *)data, cert,
+	status = CERT_VerifyCertNow ((CERTCertDBHandle *) data, cert,
 				     checksig, certUsageSSLClient, pinarg);
 
 	if (status != SECSuccess)
@@ -518,7 +518,7 @@ ssl_bad_cert (gpointer data, PRFileDesc *sockfd)
 				printf("adding cert '%s'\n", nick);
 
 				if (!cert->trust) {
-					cert->trust = (CERTCertTrust*)PORT_ArenaZAlloc (cert->arena, sizeof (CERTCertTrust));
+					cert->trust = (CERTCertTrust*) PORT_ArenaZAlloc (cert->arena, sizeof (CERTCertTrust));
 					CERT_DecodeTrustString(cert->trust, "P");
 				}
 
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index da225b6..911f3a5 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -52,9 +52,9 @@
 #define CAMEL_TEXT_INDEX_MAX_WORDLEN  (36)
 
 #define CAMEL_TEXT_INDEX_LOCK(kf, lock) \
-	(g_static_rec_mutex_lock (&((CamelTextIndex *)kf)->priv->lock))
+	(g_static_rec_mutex_lock (&((CamelTextIndex *) kf)->priv->lock))
 #define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) \
-	(g_static_rec_mutex_unlock (&((CamelTextIndex *)kf)->priv->lock))
+	(g_static_rec_mutex_unlock (&((CamelTextIndex *) kf)->priv->lock))
 
 static gint text_index_compress_nosync (CamelIndex *idx);
 
@@ -227,7 +227,7 @@ text_index_add_name_to_word (CamelIndex *idx,
 	CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
 	camel_key_t wordid;
 	camel_block_t data;
-	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 
 	w = g_hash_table_lookup (p->words, word);
 	if (w == NULL) {
@@ -264,9 +264,9 @@ text_index_add_name_to_word (CamelIndex *idx,
 
 		w->names[0] = nameid;
 		g_hash_table_insert (p->words, w->word, w);
-		camel_dlist_addhead (&p->word_cache, (CamelDListNode *)w);
+		camel_dlist_addhead (&p->word_cache, (CamelDListNode *) w);
 		p->word_cache_count++;
-		ww = (struct _CamelTextIndexWord *)p->word_cache.tailpred;
+		ww = (struct _CamelTextIndexWord *) p->word_cache.tailpred;
 		wp = ww->prev;
 		while (wp && p->word_cache_count > p->word_cache_limit) {
 			io (printf ("writing key file entry '%s' [%x]\n", ww->word, ww->data));
@@ -277,7 +277,7 @@ text_index_add_name_to_word (CamelIndex *idx,
 				/* if this call fails - we still point to the old data - not fatal */
 				camel_key_table_set_data (
 					p->word_index, ww->wordid, ww->data);
-				camel_dlist_remove ((CamelDListNode *)ww);
+				camel_dlist_remove ((CamelDListNode *) ww);
 				g_hash_table_remove (p->words, ww->word);
 				g_free (ww->word);
 				g_free (ww);
@@ -287,8 +287,8 @@ text_index_add_name_to_word (CamelIndex *idx,
 			wp = wp->prev;
 		}
 	} else {
-		camel_dlist_remove ((CamelDListNode *)w);
-		camel_dlist_addhead (&p->word_cache, (CamelDListNode *)w);
+		camel_dlist_remove ((CamelDListNode *) w);
+		camel_dlist_addhead (&p->word_cache, (CamelDListNode *) w);
 		w->names[w->used] = nameid;
 		w->used++;
 		if (w->used == G_N_ELEMENTS (w->names)) {
@@ -321,7 +321,7 @@ text_index_sync (CamelIndex *idx)
 	    || p->name_index == NULL || p->name_hash == NULL)
 		return 0;
 
-	rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 
 	/* sync/flush word cache */
 
@@ -332,7 +332,7 @@ text_index_sync (CamelIndex *idx)
 	/* this doesn't really need to be dropped, its only used in updates anyway */
 	p->word_cache_limit = 1024;
 
-	while ((ww = (struct _CamelTextIndexWord *)camel_dlist_remhead (&p->word_cache))) {
+	while ((ww = (struct _CamelTextIndexWord *) camel_dlist_remhead (&p->word_cache))) {
 		if (ww->used > 0) {
 			io (printf ("writing key file entry '%s' [%x]\n", ww->word, ww->data));
 			if (camel_key_file_write (p->links, &ww->data, ww->used, ww->names) != -1) {
@@ -447,7 +447,7 @@ text_index_compress_nosync (CamelIndex *idx)
 
 	CAMEL_TEXT_INDEX_LOCK (idx, lock);
 
-	rb = (struct _CamelTextIndexRoot *)newp->blocks->root;
+	rb = (struct _CamelTextIndexRoot *) newp->blocks->root;
 
 	rb->words = 0;
 	rb->names = 0;
@@ -504,7 +504,7 @@ text_index_compress_nosync (CamelIndex *idx)
 				goto fail;
 			}
 			for (i=0;i<count;i++) {
-				newkeyid = (camel_key_t)GPOINTER_TO_INT (g_hash_table_lookup (remap, GINT_TO_POINTER (records[i])));
+				newkeyid = (camel_key_t) GPOINTER_TO_INT (g_hash_table_lookup (remap, GINT_TO_POINTER (records[i])));
 				if (newkeyid) {
 					newrecords[newcount++] = newkeyid;
 					if (newcount == G_N_ELEMENTS (newrecords)) {
@@ -547,7 +547,7 @@ text_index_compress_nosync (CamelIndex *idx)
 		goto fail;
 
 	/* If this fails, we'll pick up something during restart? */
-	ret = camel_index_rename ((CamelIndex *)newidx, oldpath);
+	ret = camel_index_rename ((CamelIndex *) newidx, oldpath);
 
 #define myswap(a, b) { gpointer tmp = a; a = b; b = tmp; }
 	/* Poke the private data across to the new object */
@@ -559,14 +559,14 @@ text_index_compress_nosync (CamelIndex *idx)
 	myswap (newp->word_hash, oldp->word_hash);
 	myswap (newp->name_index, oldp->name_index);
 	myswap (newp->name_hash, oldp->name_hash);
-	myswap (((CamelIndex *)newidx)->path, ((CamelIndex *)idx)->path);
+	myswap (((CamelIndex *) newidx)->path, ((CamelIndex *) idx)->path);
 #undef myswap
 
 	ret = 0;
 fail:
 	CAMEL_TEXT_INDEX_UNLOCK (idx, lock);
 
-	camel_index_delete ((CamelIndex *)newidx);
+	camel_index_delete ((CamelIndex *) newidx);
 
 	g_object_unref (newidx);
 	g_free (name);
@@ -645,7 +645,7 @@ text_index_add_name (CamelIndex *idx, const gchar *name)
 	CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
 	camel_key_t keyid;
 	CamelIndexName *idn;
-	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 
 	CAMEL_TEXT_INDEX_LOCK (idx, lock);
 
@@ -678,7 +678,7 @@ text_index_add_name (CamelIndex *idx, const gchar *name)
 
 	CAMEL_TEXT_INDEX_UNLOCK (idx, lock);
 
-	idn = (CamelIndexName *)camel_text_index_name_new ((CamelTextIndex *)idx, name, keyid);
+	idn = (CamelIndexName *) camel_text_index_name_new ((CamelTextIndex *) idx, name, keyid);
 
 	return idn;
 }
@@ -687,7 +687,7 @@ text_index_add_name (CamelIndex *idx, const gchar *name)
 static void
 hash_write_word (gchar *word, gpointer data, CamelIndexName *idn)
 {
-	CamelTextIndexName *tin = (CamelTextIndexName *)idn;
+	CamelTextIndexName *tin = (CamelTextIndexName *) idn;
 
 	text_index_add_name_to_word (idn->index, word, tin->priv->nameid);
 }
@@ -699,10 +699,10 @@ text_index_write_name (CamelIndex *idx, CamelIndexName *idn)
 	camel_index_name_add_buffer (idn, NULL, 0);
 
 	/* see text_index_add_name for when this can be 0 */
-	if (((CamelTextIndexName *)idn)->priv->nameid != 0) {
+	if (((CamelTextIndexName *) idn)->priv->nameid != 0) {
 		CAMEL_TEXT_INDEX_LOCK (idx, lock);
 
-		g_hash_table_foreach (idn->words, (GHFunc)hash_write_word, idn);
+		g_hash_table_foreach (idn->words, (GHFunc) hash_write_word, idn);
 
 		CAMEL_TEXT_INDEX_UNLOCK (idx, lock);
 	}
@@ -722,7 +722,7 @@ text_index_delete_name (CamelIndex *idx, const gchar *name)
 {
 	CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
 	camel_key_t keyid;
-	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 
 	d (printf ("Delete name: %s\n", name));
 
@@ -762,7 +762,7 @@ text_index_find (CamelIndex *idx, const gchar *word)
 
 	CAMEL_TEXT_INDEX_UNLOCK (idx, lock);
 
-	idc = (CamelIndexCursor *)camel_text_index_cursor_new ((CamelTextIndex *)idx, data);
+	idc = (CamelIndexCursor *) camel_text_index_cursor_new ((CamelTextIndex *) idx, data);
 
 	return idc;
 }
@@ -772,7 +772,7 @@ text_index_words (CamelIndex *idx)
 {
 	CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
 
-	return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->word_index);
+	return (CamelIndexCursor *) camel_text_index_key_cursor_new ((CamelTextIndex *) idx, p->word_index);
 }
 
 static CamelIndexCursor *
@@ -780,7 +780,7 @@ text_index_names (CamelIndex *idx)
 {
 	CamelTextIndexPrivate *p = CAMEL_TEXT_INDEX (idx)->priv;
 
-	return (CamelIndexCursor *)camel_text_index_key_cursor_new ((CamelTextIndex *)idx, p->name_index);
+	return (CamelIndexCursor *) camel_text_index_key_cursor_new ((CamelTextIndex *) idx, p->name_index);
 }
 
 static void
@@ -849,8 +849,8 @@ camel_text_index_new (const gchar *path, gint flags)
 	gchar *link;
 	CamelBlock *bl;
 
-	camel_index_construct ((CamelIndex *)idx, path, flags);
-	camel_index_set_normalize ((CamelIndex *)idx, text_index_normalize, NULL);
+	camel_index_construct ((CamelIndex *) idx, path, flags);
+	camel_index_set_normalize ((CamelIndex *) idx, text_index_normalize, NULL);
 
 	p->blocks = camel_block_file_new (
 		idx->parent.path, flags, CAMEL_TEXT_INDEX_VERSION, CAMEL_BLOCK_SIZE);
@@ -864,7 +864,7 @@ camel_text_index_new (const gchar *path, gint flags)
 	if (p->links == NULL)
 		goto fail;
 
-	rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 
 	if (rb->word_index_root == 0) {
 		bl = camel_block_file_new_block (p->blocks);
@@ -1018,7 +1018,7 @@ void
 camel_text_index_info (CamelTextIndex *idx)
 {
 	CamelTextIndexPrivate *p = idx->priv;
-	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *)p->blocks->root;
+	struct _CamelTextIndexRoot *rb = (struct _CamelTextIndexRoot *) p->blocks->root;
 	gint frag;
 
 	printf ("Path: '%s'\n", idx->parent.path);
@@ -1149,12 +1149,12 @@ dump_raw (GHashTable *map, gchar *path)
 			printf (" - invalid -\n");
 			break;
 		case KEY_ROOT: {
-			CamelKeyRootBlock *r = (CamelKeyRootBlock *)buf;
+			CamelKeyRootBlock *r = (CamelKeyRootBlock *) buf;
 			printf ("Key root:\n");
 			printf ("First: %08x     Last: %08x     Free: %08x\n", r->first, r->last, r->free);
 		} break;
 		case KEY_DATA: {
-			CamelKeyBlock *k = (CamelKeyBlock *)buf;
+			CamelKeyBlock *k = (CamelKeyBlock *) buf;
 			printf ("Key data:\n");
 			printf ("Next: %08x      Used: %u\n", k->next, k->used);
 			for (i=0;i<k->used;i++) {
@@ -1169,7 +1169,7 @@ dump_raw (GHashTable *map, gchar *path)
 			}
 		} break;
 		case PARTITION_MAP: {
-			CamelPartitionMapBlock *m = (CamelPartitionMapBlock *)buf;
+			CamelPartitionMapBlock *m = (CamelPartitionMapBlock *) buf;
 			printf ("Partition map\n");
 			printf ("Next: %08x      Used: %u\n", m->next, m->used);
 			for (i=0;i<m->used;i++) {
@@ -1177,7 +1177,7 @@ dump_raw (GHashTable *map, gchar *path)
 			}
 		} break;
 		case PARTITION_DATA: {
-			CamelPartitionKeyBlock *k = (CamelPartitionKeyBlock *)buf;
+			CamelPartitionKeyBlock *k = (CamelPartitionKeyBlock *) buf;
 			printf ("Partition data\n");
 			printf ("Used: %u\n", k->used);
 		} break;
@@ -1245,7 +1245,7 @@ camel_text_index_dump (CamelTextIndex *idx)
 
 		printf ("Word: '%s':\n", word);
 
-		idc = camel_index_find ((CamelIndex *)idx, word);
+		idc = camel_index_find ((CamelIndex *) idx, word);
 		while ((name = camel_index_cursor_next (idc))) {
 			printf (" %s", name);
 		}
@@ -1353,7 +1353,7 @@ camel_text_index_validate (CamelTextIndex *idx)
 
 		used = g_hash_table_new (g_str_hash, g_str_equal);
 
-		idc = camel_index_find ((CamelIndex *)idx, word);
+		idc = camel_index_find ((CamelIndex *) idx, word);
 		while ((name = camel_index_cursor_next (idc))) {
 			if (g_hash_table_lookup (name_word, name) == NULL) {
 				printf ("word '%s' references non-existant name '%s'\n", word, name);
@@ -1361,12 +1361,12 @@ camel_text_index_validate (CamelTextIndex *idx)
 			if (g_hash_table_lookup (used, name) != NULL) {
 				printf ("word '%s' uses word '%s' more than once\n", word, name);
 			} else {
-				g_hash_table_insert (used, g_strdup (name), (gpointer)1);
+				g_hash_table_insert (used, g_strdup (name), (gpointer) 1);
 			}
 		}
 		g_object_unref (idc);
 
-		g_hash_table_foreach (used, (GHFunc)g_free, NULL);
+		g_hash_table_foreach (used, (GHFunc) g_free, NULL);
 		g_hash_table_destroy (used);
 
 		printf ("word '%s'\n", word);
@@ -1388,10 +1388,10 @@ camel_text_index_validate (CamelTextIndex *idx)
 	g_hash_table_destroy (words);
 	g_hash_table_destroy (keys);
 
-	g_hash_table_foreach (name_word, (GHFunc)g_free, NULL);
+	g_hash_table_foreach (name_word, (GHFunc) g_free, NULL);
 	g_hash_table_destroy (name_word);
 
-	g_hash_table_foreach (word_word, (GHFunc)g_free, NULL);
+	g_hash_table_foreach (word_word, (GHFunc) g_free, NULL);
 	g_hash_table_destroy (word_word);
 }
 
@@ -1420,7 +1420,7 @@ text_index_name_finalize (GObject *object)
 static void
 text_index_name_add_word (CamelIndexName *idn, const gchar *word)
 {
-	CamelTextIndexNamePrivate *p = ((CamelTextIndexName *)idn)->priv;
+	CamelTextIndexNamePrivate *p = ((CamelTextIndexName *) idn)->priv;
 
 	if (g_hash_table_lookup (idn->words, word) == NULL) {
 		gchar *w = camel_mempool_strdup (p->pool, word);
@@ -1876,7 +1876,7 @@ gint main (gint argc, gchar **argv)
 #if 0
 	bs = camel_block_file_new ("blocks", "TESTINDX", CAMEL_BLOCK_SIZE);
 
-	root = (struct _CamelIndexRoot *)bs->root;
+	root = (struct _CamelIndexRoot *) bs->root;
 	if (root->word_root == 0) {
 		keyroot = camel_block_file_new_block (bs);
 		root->word_root = keyroot->id;
diff --git a/camel/camel-url-scanner.c b/camel/camel-url-scanner.c
index 627d15f..4f97cae 100644
--- a/camel/camel-url-scanner.c
+++ b/camel/camel-url-scanner.c
@@ -87,7 +87,7 @@ camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, gsize inlen,
 		return FALSE;
 
 	do {
-		if (!(pos = camel_trie_search (scanner->trie, (const gchar *)inptr, inlen, &pattern)))
+		if (!(pos = camel_trie_search (scanner->trie, (const gchar *) inptr, inlen, &pattern)))
 			return FALSE;
 
 		pat = g_ptr_array_index (scanner->patterns, pattern);
@@ -95,7 +95,7 @@ camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, gsize inlen,
 		match->pattern = pat->pattern;
 		match->prefix = pat->prefix;
 
-		if (pat->start (in, pos, (const gchar *)inend, match) && pat->end (in, pos, (const gchar *)inend, match))
+		if (pat->start (in, pos, (const gchar *) inend, match) && pat->end (in, pos, (const gchar *) inend, match))
 			return TRUE;
 
 		inptr = (const guchar *) pos;
diff --git a/camel/camel-url.c b/camel/camel-url.c
index 7c565ee..27be37b 100644
--- a/camel/camel-url.c
+++ b/camel/camel-url.c
@@ -411,7 +411,7 @@ output_param (GQuark key_id, gpointer data, gpointer user_data)
 
 	g_string_append_c (str, ';');
 	append_url_encoded (str, g_quark_to_string (key_id), "?=");
-	if (*(gchar *)data) {
+	if (*(gchar *) data) {
 		g_string_append_c (str, '=');
 		append_url_encoded (str, data, "?");
 	}
@@ -657,7 +657,7 @@ static const gchar url_encoded_char[] = {
 static void
 append_url_encoded (GString *str, const gchar *in, const gchar *extra_enc_chars)
 {
-	const guchar *s = (const guchar *)in;
+	const guchar *s = (const guchar *) in;
 
 	while (*s) {
 		if (url_encoded_char[*s] ||
@@ -712,7 +712,7 @@ camel_url_decode (gchar *part)
 
 #define XDIGIT(c) ((c) <= '9' ? (c) - '0' : ((c) & 0x4F) - 'A' + 10)
 
-	s = d = (guchar *)part;
+	s = d = (guchar *) part;
 	do {
 		if (*s == '%' && isxdigit (s[1]) && isxdigit (s[2])) {
 			*d++ = (XDIGIT (s[1]) << 4) + XDIGIT (s[2]);
@@ -796,7 +796,7 @@ camel_url_copy (CamelURL *in)
 	out->path = g_strdup (in->path);
 	out->params = NULL;
 	if (in->params)
-		g_datalist_foreach (&((CamelURL *)in)->params, copy_param, &out->params);
+		g_datalist_foreach (&((CamelURL *) in)->params, copy_param, &out->params);
 	out->query = g_strdup (in->query);
 	out->fragment = g_strdup (in->fragment);
 
diff --git a/camel/camel-utf8.c b/camel/camel-utf8.c
index d80ec83..582cbc1 100644
--- a/camel/camel-utf8.c
+++ b/camel/camel-utf8.c
@@ -215,7 +215,7 @@ static const guchar utf7_rank[256] = {
 gchar *
 camel_utf7_utf8 (const gchar *ptr)
 {
-	const guchar *p = (guchar *)ptr;
+	const guchar *p = (guchar *) ptr;
 	guint c;
 	guint32 v=0, x;
 	GString *out;
@@ -296,7 +296,7 @@ static void utf7_closeb64 (GString *out, guint32 v, guint32 i)
 gchar *
 camel_utf8_utf7 (const gchar *ptr)
 {
-	const guchar *p = (guchar *)ptr;
+	const guchar *p = (guchar *) ptr;
 	guint c;
 	guint32 x, v = 0;
 	gint state = 0;
@@ -385,7 +385,7 @@ camel_utf8_ucs2 (const gchar *pptr)
  **/
 gchar *camel_ucs2_utf8 (const gchar *ptr)
 {
-	guint16 *ucs = (guint16 *)ptr;
+	guint16 *ucs = (guint16 *) ptr;
 	guint32 c;
 	GString *work = g_string_new("");
 	gchar *out;
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index b82a4f3..91c17b0 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -92,7 +92,7 @@ vee_folder_add_uid (CamelVeeFolder *vf,
 {
 	CamelVeeMessageInfo *mi = NULL;
 
-	mi = camel_vee_summary_add ((CamelVeeSummary *)((CamelFolder *)vf)->summary, f->summary, (gchar *)inuid, hash);
+	mi = camel_vee_summary_add ((CamelVeeSummary *)((CamelFolder *) vf)->summary, f->summary, (gchar *) inuid, hash);
 	return mi;
 }
 
@@ -165,7 +165,7 @@ folder_changed_add_uid (CamelFolder *sub, const gchar *uid, const gchar hash[8],
 		} else {
 			g_hash_table_insert (unmatched_uids, g_strdup (vuid), GINT_TO_POINTER (1));
 		}
-		vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info ((CamelFolder *)folder_unmatched, vuid);
+		vinfo = (CamelVeeMessageInfo *) camel_folder_get_message_info ((CamelFolder *) folder_unmatched, vuid);
 		if (vinfo) {
 			camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (folder_unmatched)->summary, vinfo->old_flags, TRUE);
 			full_name = camel_folder_get_full_name (
@@ -188,7 +188,7 @@ folder_changed_add_uid (CamelFolder *sub, const gchar *uid, const gchar hash[8],
 static void
 folder_changed_remove_uid (CamelFolder *sub, const gchar *uid, const gchar hash[8], gint keep, CamelVeeFolder *vf, gboolean use_db)
 {
-	CamelFolder *folder = (CamelFolder *)vf;
+	CamelFolder *folder = (CamelFolder *) vf;
 	CamelStore *parent_store;
 	const gchar *full_name;
 	gchar *vuid, *oldkey;
@@ -240,7 +240,7 @@ folder_changed_remove_uid (CamelFolder *sub, const gchar *uid, const gchar hash[
 				g_free (oldkey);
 			}
 
-			vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info ((CamelFolder *)folder_unmatched, vuid);
+			vinfo = (CamelVeeMessageInfo *) camel_folder_get_message_info ((CamelFolder *) folder_unmatched, vuid);
 			if (vinfo) {
 				camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (folder_unmatched)->summary, vinfo->old_flags, TRUE);
 				full_name = camel_folder_get_full_name (
@@ -266,7 +266,7 @@ update_old_flags (CamelFolderSummary *summary, CamelVeeMessageInfo *vinfo)
 	g_return_if_fail (vinfo != NULL);
 
 	camel_folder_summary_update_counts_by_flags (summary, vinfo->old_flags, TRUE);
-	vinfo->old_flags = camel_message_info_flags ((CamelMessageInfo *)vinfo);
+	vinfo->old_flags = camel_message_info_flags ((CamelMessageInfo *) vinfo);
 	camel_folder_summary_update_counts_by_flags (summary, vinfo->old_flags, FALSE);
 }
 
@@ -276,39 +276,39 @@ folder_changed_change_uid (CamelFolder *sub, const gchar *uid, const gchar hash[
 	gchar *vuid;
 	CamelVeeMessageInfo *vinfo, *uinfo = NULL;
 	CamelMessageInfo *info;
-	CamelFolder *folder = (CamelFolder *)vf;
+	CamelFolder *folder = (CamelFolder *) vf;
 	CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
 
 	vuid = alloca (strlen (uid)+9);
 	memcpy (vuid, hash, 8);
 	strcpy (vuid+8, uid);
 
-	vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid (folder->summary, vuid);
+	vinfo = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, vuid);
 	if (folder_unmatched != NULL)
-		uinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid (((CamelFolder *)folder_unmatched)->summary, vuid);
+		uinfo = (CamelVeeMessageInfo *) camel_folder_summary_uid (((CamelFolder *) folder_unmatched)->summary, vuid);
 	if (vinfo || uinfo) {
 		info = camel_folder_get_message_info (sub, uid);
 		if (info) {
 			if (vinfo) {
 				camel_folder_change_info_change_uid (vf->changes, vuid);
 				update_old_flags (folder->summary, vinfo);
-				camel_message_info_free ((CamelMessageInfo *)vinfo);
+				camel_message_info_free ((CamelMessageInfo *) vinfo);
 			}
 
 			if (uinfo) {
 				camel_folder_change_info_change_uid (folder_unmatched->changes, vuid);
 				update_old_flags (CAMEL_FOLDER (folder_unmatched)->summary, uinfo);
-				camel_message_info_free ((CamelMessageInfo *)uinfo);
+				camel_message_info_free ((CamelMessageInfo *) uinfo);
 			}
 
 			camel_folder_free_message_info (sub, info);
 		} else {
 			if (vinfo) {
 				folder_changed_remove_uid (sub, uid, hash, FALSE, vf, use_db);
-				camel_message_info_free ((CamelMessageInfo *)vinfo);
+				camel_message_info_free ((CamelMessageInfo *) vinfo);
 			}
 			if (uinfo)
-				camel_message_info_free ((CamelMessageInfo *)uinfo);
+				camel_message_info_free ((CamelMessageInfo *) uinfo);
 		}
 	}
 }
@@ -379,12 +379,12 @@ folder_changed_change (CamelSession *session,
 				}
 				memcpy (vuid, hash, 8);
 				strcpy (vuid+8, uid);
-				vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid (folder->summary, vuid);
+				vinfo = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, vuid);
 				if (vinfo == NULL) {
-					g_ptr_array_add (newchanged, (gchar *)uid);
+					g_ptr_array_add (newchanged, (gchar *) uid);
 				} else {
-					g_ptr_array_add (always_changed, (gchar *)uid);
-					camel_message_info_free ((CamelMessageInfo *)vinfo);
+					g_ptr_array_add (always_changed, (gchar *) uid);
+					camel_message_info_free ((CamelMessageInfo *) vinfo);
 				}
 			}
 			changed = newchanged;
@@ -434,12 +434,12 @@ folder_changed_change (CamelSession *session,
 
 				if (!CAMEL_IS_VEE_FOLDER (sub) && folder_unmatched != NULL && g_hash_table_lookup (unmatched_uids, vuid) == NULL) {
 					dd (printf ("  adding uid '%s' to Unmatched [newly unmatched]\n", (gchar *)uid));
-					vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info ((CamelFolder *)folder_unmatched, vuid);
+					vinfo = (CamelVeeMessageInfo *) camel_folder_get_message_info ((CamelFolder *) folder_unmatched, vuid);
 					if (vinfo == NULL) {
 						if (vee_folder_add_uid_test (folder_unmatched, sub, uid, hash))
 							camel_folder_change_info_add_uid (folder_unmatched->changes, vuid);
 					} else {
-						camel_folder_free_message_info ((CamelFolder *)folder_unmatched, (CamelMessageInfo *)vinfo);
+						camel_folder_free_message_info ((CamelFolder *) folder_unmatched, (CamelMessageInfo *) vinfo);
 					}
 				}
 			}
@@ -496,7 +496,7 @@ folder_changed_change (CamelSession *session,
 			}
 			memcpy (vuid, hash, 8);
 			strcpy (vuid+8, uid);
-			vinfo = (CamelVeeMessageInfo *)camel_folder_summary_uid (folder->summary, vuid);
+			vinfo = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, vuid);
 			if (vinfo == NULL) {
 				if (g_hash_table_lookup (matches_hash, uid)) {
 					/* A uid we dont have, but now it matches, add it */
@@ -517,7 +517,7 @@ folder_changed_change (CamelSession *session,
 					dd (printf ("  removing uid '%s' [did match]\n", uid));
 					folder_changed_remove_uid (sub, uid, hash, TRUE, vf, !correlating);
 				}
-				camel_message_info_free ((CamelMessageInfo *)vinfo);
+				camel_message_info_free ((CamelMessageInfo *) vinfo);
 			}
 		}
 		g_hash_table_destroy (matches_hash);
@@ -605,24 +605,24 @@ subfolder_renamed_update (CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8])
 
 	camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK);
 
-	camel_folder_summary_prepare_fetch_all (((CamelFolder *)vf)->summary, NULL);
+	camel_folder_summary_prepare_fetch_all (((CamelFolder *) vf)->summary, NULL);
 
-	count = camel_folder_summary_count (((CamelFolder *)vf)->summary);
+	count = camel_folder_summary_count (((CamelFolder *) vf)->summary);
 	for (i=0;i<count;i++) {
-		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (((CamelFolder *)vf)->summary, i);
+		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_index (((CamelFolder *) vf)->summary, i);
 		CamelVeeMessageInfo *vinfo;
 
 		if (mi == NULL)
 			continue;
 
 		if (mi->summary == ssummary) {
-			gchar *uid = (gchar *)camel_message_info_uid (mi);
+			gchar *uid = (gchar *) camel_message_info_uid (mi);
 			gchar *oldkey;
 			gpointer oldval;
 
 			camel_folder_change_info_remove_uid (vf->changes, uid);
 			camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (vf)->summary, mi->old_flags, TRUE);
-			camel_folder_summary_remove (((CamelFolder *)vf)->summary, (CamelMessageInfo *)mi);
+			camel_folder_summary_remove (((CamelFolder *) vf)->summary, (CamelMessageInfo *) mi);
 
 			/* works since we always append on the end */
 			i--;
@@ -644,7 +644,7 @@ subfolder_renamed_update (CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8])
 			}
 		}
 
-		camel_message_info_free ((CamelMessageInfo *)mi);
+		camel_message_info_free ((CamelMessageInfo *) mi);
 	}
 
 	if (camel_folder_change_info_changed (vf->changes)) {
@@ -679,7 +679,7 @@ unmatched_check_uid (gchar *uidin, gpointer value, struct _update_data *u)
 		if (vee_folder_add_uid_test (u->folder_unmatched, u->source, uidin, u->hash))
 			camel_folder_change_info_add_uid (u->folder_unmatched->changes, uid);
 	} else {
-		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_uid (((CamelFolder *)u->folder_unmatched)->summary, uid);
+		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_uid (((CamelFolder *) u->folder_unmatched)->summary, uid);
 		if (mi) {
 			CamelStore *parent_store;
 			const gchar *full_name;
@@ -693,10 +693,10 @@ unmatched_check_uid (gchar *uidin, gpointer value, struct _update_data *u)
 			camel_db_delete_uid_from_vfolder_transaction (
 				parent_store->cdb_w, full_name, uid, NULL);
 			camel_folder_summary_remove_uid_fast (
-				((CamelFolder *)u->folder_unmatched)->summary, uid);
+				((CamelFolder *) u->folder_unmatched)->summary, uid);
 			camel_folder_change_info_remove_uid (
 				u->folder_unmatched->changes, uid);
-			camel_message_info_free ((CamelMessageInfo *)mi);
+			camel_message_info_free ((CamelMessageInfo *) mi);
 		}
 	}
 }
@@ -745,7 +745,7 @@ count_result (CamelFolderSummary *summary,
               GError **error)
 {
 	CamelFolder *folder = summary->folder;
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	guint32 count=0;
 	gchar *expr = g_strdup_printf ("(and %s %s)", vf->expression ? vf->expression : "", query);
 	GList *node;
@@ -789,11 +789,11 @@ summary_header_to_db (CamelFolderSummary *s,
 		record->deleted_count = s->deleted_count;
 		record->unread_count = s->unread_count;
 
-		if (((CamelVeeSummary *)s)->fake_visible_count)
-			record->visible_count = ((CamelVeeSummary *)s)->fake_visible_count;
+		if (((CamelVeeSummary *) s)->fake_visible_count)
+			record->visible_count = ((CamelVeeSummary *) s)->fake_visible_count;
 		else
 			record->visible_count = s->visible_count;
-		((CamelVeeSummary *)s)->fake_visible_count = 0;
+		((CamelVeeSummary *) s)->fake_visible_count = 0;
 
 		record->jnd_count = s->junk_not_deleted_count;
 	} else {
@@ -872,7 +872,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
 
 	/* undo the freeze state that we have imposed on this source folder */
 	camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
-	for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++)
+	for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) vf); i++)
 		camel_folder_thaw (sub);
 	camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
 
@@ -890,7 +890,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
 
 				/* undo the freeze state that Unmatched has imposed on this source folder */
 				camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
-				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++)
+				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) folder_unmatched); i++)
 					camel_folder_thaw (sub);
 				camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
 			}
@@ -901,7 +901,7 @@ vee_folder_stop_folder (CamelVeeFolder *vf,
 
 				/* undo the freeze state that Unmatched has imposed on this source folder */
 				camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
-				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++)
+				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) folder_unmatched); i++)
 					camel_folder_thaw (sub);
 				camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
 			}
@@ -953,12 +953,12 @@ vee_folder_dispose (GObject *object)
 				g_object_unref (node->data);
 		} else {
 			/* FIXME[disk-summary] See if it is really reqd */
-			camel_folder_freeze ((CamelFolder *)vf);
+			camel_folder_freeze ((CamelFolder *) vf);
 			while (vf->priv->folders) {
 				CamelFolder *f = vf->priv->folders->data;
 				vee_folder_stop_folder (vf, f, NULL);
 			}
-			camel_folder_thaw ((CamelFolder *)vf);
+			camel_folder_thaw ((CamelFolder *) vf);
 		}
 	}
 
@@ -998,7 +998,7 @@ vee_folder_search_by_expression (CamelFolder *folder,
 	GList *node;
 	GPtrArray *matches, *result = g_ptr_array_new ();
 	gchar *expr;
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vf->priv;
 	GHashTable *searched = g_hash_table_new (NULL, NULL);
 	CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -1060,7 +1060,7 @@ vee_folder_search_by_uids (CamelFolder *folder,
 	GPtrArray *matches, *result = g_ptr_array_new ();
 	GPtrArray *folder_uids = g_ptr_array_new ();
 	gchar *expr;
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vf->priv;
 	GHashTable *searched = g_hash_table_new (NULL, NULL);
 
@@ -1122,7 +1122,7 @@ vee_folder_count_by_expression (CamelFolder *folder,
 	GList *node;
 	gchar *expr;
 	guint32 count = 0;
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vf->priv;
 	GHashTable *searched = g_hash_table_new (NULL, NULL);
 	CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
@@ -1164,20 +1164,20 @@ vee_folder_delete (CamelFolder *folder)
 		g_object_ref (f);
 		camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
 
-		camel_vee_folder_remove_folder ((CamelVeeFolder *)folder, f);
+		camel_vee_folder_remove_folder ((CamelVeeFolder *) folder, f);
 		g_object_unref (f);
 		camel_vee_folder_lock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
 	}
 	camel_vee_folder_unlock (CAMEL_VEE_FOLDER (folder), CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
 
-	((CamelFolderClass *)camel_vee_folder_parent_class)->delete (folder);
-	((CamelVeeFolder *)folder)->deleted = TRUE;
+	((CamelFolderClass *) camel_vee_folder_parent_class)->delete (folder);
+	((CamelVeeFolder *) folder)->deleted = TRUE;
 }
 
 static void
 vee_folder_freeze (CamelFolder *folder)
 {
-	CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vfolder = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vfolder->priv;
 	GList *node;
 
@@ -1200,7 +1200,7 @@ vee_folder_freeze (CamelFolder *folder)
 static void
 vee_folder_thaw (CamelFolder *folder)
 {
-	CamelVeeFolder *vfolder = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vfolder = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vfolder->priv;
 	GList *node;
 
@@ -1256,12 +1256,12 @@ vee_folder_get_message_sync (CamelFolder *folder,
 	CamelVeeMessageInfo *mi;
 	CamelMimeMessage *msg = NULL;
 
-	mi = (CamelVeeMessageInfo *)camel_folder_summary_uid (folder->summary, uid);
+	mi = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, uid);
 	if (mi) {
 		msg = camel_folder_get_message_sync (
 			mi->summary->folder, camel_message_info_uid (mi)+8,
 			cancellable, error);
-		camel_message_info_free ((CamelMessageInfo *)mi);
+		camel_message_info_free ((CamelMessageInfo *) mi);
 	} else {
 		g_set_error (
 			error, CAMEL_FOLDER_ERROR,
@@ -1278,7 +1278,7 @@ vee_folder_refresh_info_sync (CamelFolder *folder,
                               GCancellable *cancellable,
                               GError **error)
 {
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vf->priv;
 	GList *node, *list;
 	gboolean success = TRUE;
@@ -1311,13 +1311,13 @@ vee_folder_synchronize_sync (CamelFolder *folder,
                              GCancellable *cancellable,
                              GError **error)
 {
-	CamelVeeFolder *vf = (CamelVeeFolder *)folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) folder;
 	CamelVeeFolderPrivate *p = vf->priv;
 	GList *node;
 
-	if (((CamelVeeSummary *)folder->summary)->fake_visible_count)
-		folder->summary->visible_count = ((CamelVeeSummary *)folder->summary)->fake_visible_count;
-	((CamelVeeSummary *)folder->summary)->fake_visible_count = 0;
+	if (((CamelVeeSummary *) folder->summary)->fake_visible_count)
+		folder->summary->visible_count = ((CamelVeeSummary *) folder->summary)->fake_visible_count;
+	((CamelVeeSummary *) folder->summary)->fake_visible_count = 0;
 
 	camel_vee_folder_lock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
 
@@ -1357,9 +1357,9 @@ vee_folder_synchronize_sync (CamelFolder *folder,
 		camel_folder_summary_prepare_fetch_all (folder->summary, NULL);
 		count = camel_folder_summary_count (folder->summary);
 		for (i=0; i < count; i++) {
-			CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
+			CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_index (folder->summary, i);
 			if (mi->old_flags & CAMEL_MESSAGE_DELETED) {
-				del = g_slist_prepend (del, (gpointer) camel_pstring_strdup (((CamelMessageInfo *)mi)->uid));
+				del = g_slist_prepend (del, (gpointer) camel_pstring_strdup (((CamelMessageInfo *) mi)->uid));
 				camel_folder_summary_update_counts_by_flags (folder->summary, mi->old_flags, TRUE);
 				camel_folder_summary_remove_index_fast (folder->summary, i);
 				count--;
@@ -1464,7 +1464,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
 {
 	gint i, count, n, still = FALSE, start, last;
 	gchar *oldkey;
-	CamelFolder *folder = (CamelFolder *)vf;
+	CamelFolder *folder = (CamelFolder *) vf;
 	gchar hash[8];
 	CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
 	gpointer oldval;
@@ -1496,10 +1496,10 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
 		if (killun) {
 			start = -1;
 			last = -1;
-			camel_folder_summary_prepare_fetch_all (((CamelFolder *)folder_unmatched)->summary, NULL);
-			count = camel_folder_summary_count (((CamelFolder *)folder_unmatched)->summary);
+			camel_folder_summary_prepare_fetch_all (((CamelFolder *) folder_unmatched)->summary, NULL);
+			count = camel_folder_summary_count (((CamelFolder *) folder_unmatched)->summary);
 			for (i=0;i<count;i++) {
-				CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (((CamelFolder *)folder_unmatched)->summary, i);
+				CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_index (((CamelFolder *) folder_unmatched)->summary, i);
 
 				if (mi) {
 					if (mi->summary == ssummary) {
@@ -1510,16 +1510,16 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
 						} else if (last+1 == i) {
 							last = i;
 						} else {
-							camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
+							camel_folder_summary_remove_range (((CamelFolder *) folder_unmatched)->summary, start, last);
 							i -= (last-start)+1;
 							start = last = i;
 						}
 					}
-					camel_message_info_free ((CamelMessageInfo *)mi);
+					camel_message_info_free ((CamelMessageInfo *) mi);
 				}
 			}
 			if (last != -1)
-				camel_folder_summary_remove_range (((CamelFolder *)folder_unmatched)->summary, start, last);
+				camel_folder_summary_remove_range (((CamelFolder *) folder_unmatched)->summary, start, last);
 		}
 	}
 
@@ -1529,7 +1529,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
 	camel_folder_summary_prepare_fetch_all (folder->summary, NULL);
 	count = camel_folder_summary_count (folder->summary);
 	for (i=0;i<count;i++) {
-		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
+		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_index (folder->summary, i);
 		if (mi) {
 			if (mi->summary == ssummary) {
 				const gchar *uid = camel_message_info_uid (mi);
@@ -1568,7 +1568,7 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
 					}
 				}
 			}
-			camel_message_info_free ((CamelMessageInfo *)mi);
+			camel_message_info_free ((CamelMessageInfo *) mi);
 		}
 	}
 
@@ -1635,7 +1635,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 	GPtrArray *match = NULL, *all;
 	GHashTable *allhash, *matchhash, *fullhash;
 	GSList *del_list = NULL;
-	CamelFolder *folder = (CamelFolder *)vee_folder;
+	CamelFolder *folder = (CamelFolder *) vee_folder;
 	gint i, n, count, start, last;
 	struct _update_data u;
 	CamelFolderChangeInfo *vee_folder_changes = NULL, *unmatched_changes = NULL;
@@ -1668,7 +1668,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 	} else {
 		if (!correlating) {
 			/* Load the folder results from the DB. */
-			match = camel_vee_summary_get_ids ((CamelVeeSummary *)folder->summary, u.hash);
+			match = camel_vee_summary_get_ids ((CamelVeeSummary *) folder->summary, u.hash);
 		}
 		if (correlating ||
 			/* We take this to mean the results have not been cached.
@@ -1730,11 +1730,11 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 	camel_folder_summary_prepare_fetch_all (folder->summary, NULL);
 	count = camel_folder_summary_count (folder->summary);
 	for (i=0;i<count;i++) {
-		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
+		CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_index (folder->summary, i);
 
 		if (mi) {
 			if (mi->summary == ssummary) {
-				gchar *uid = (gchar *)camel_message_info_uid (mi), *oldkey;
+				gchar *uid = (gchar *) camel_message_info_uid (mi), *oldkey;
 				gpointer oldval;
 
 				if (g_hash_table_lookup (matchhash, uid+8) == NULL) {
@@ -1765,7 +1765,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 					g_hash_table_remove (matchhash, uid+8);
 				}
 			}
-			camel_message_info_free ((CamelMessageInfo *)mi);
+			camel_message_info_free ((CamelMessageInfo *) mi);
 		}
 	}
 	if (last != -1)
@@ -1779,7 +1779,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 		camel_db_begin_transaction (parent_store->cdb_w, NULL);
 	}
 
-	g_hash_table_foreach (matchhash, (GHFunc)folder_added_uid, &u);
+	g_hash_table_foreach (matchhash, (GHFunc) folder_added_uid, &u);
 
 	if (rebuilded && !correlating) {
 		CamelStore *parent_store;
@@ -1790,9 +1790,9 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 
 	if (folder_unmatched != NULL) {
 		/* scan unmatched, remove any that have vanished, etc */
-		count = camel_folder_summary_count (((CamelFolder *)folder_unmatched)->summary);
+		count = camel_folder_summary_count (((CamelFolder *) folder_unmatched)->summary);
 		for (i=0;i<count;i++) {
-			gchar *uid = camel_folder_summary_uid_from_index (((CamelFolder *)folder_unmatched)->summary, i);
+			gchar *uid = camel_folder_summary_uid_from_index (((CamelFolder *) folder_unmatched)->summary, i);
 
 			if (uid) {
 				if (strncmp (uid, u.hash, 8) == 0) {
@@ -1803,7 +1803,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 							camel_message_info_free (vinfo);
 						}
 						/* no longer exists at all, just remove it entirely */
-						camel_folder_summary_remove_index_fast (((CamelFolder *)folder_unmatched)->summary, i);
+						camel_folder_summary_remove_index_fast (((CamelFolder *) folder_unmatched)->summary, i);
 						camel_folder_change_info_remove_uid (folder_unmatched->changes, uid);
 						i--;
 						count--;
@@ -1817,7 +1817,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 
 		/* now allhash contains all potentially new uid's for the unmatched folder, process */
 		if (!CAMEL_IS_VEE_FOLDER (source))
-			g_hash_table_foreach (allhash, (GHFunc)unmatched_check_uid, &u);
+			g_hash_table_foreach (allhash, (GHFunc) unmatched_check_uid, &u);
 
 		/* copy any changes so we can raise them outside the lock */
 		if (camel_folder_change_info_changed (folder_unmatched->changes)) {
@@ -1847,7 +1847,7 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
 				parent_store->cdb_w,
 				full_name, shash, del_list, NULL);
 		}
-		((CamelVeeSummary *)folder->summary)->force_counts = TRUE;
+		((CamelVeeSummary *) folder->summary)->force_counts = TRUE;
 		g_slist_foreach (del_list, (GFunc) camel_pstring_free, NULL);
 		g_slist_free (del_list);
 	};
@@ -1997,7 +1997,7 @@ camel_vee_folder_init (CamelVeeFolder *vee_folder)
 void
 camel_vee_folder_construct (CamelVeeFolder *vf, guint32 flags)
 {
-	CamelFolder *folder = (CamelFolder *)vf;
+	CamelFolder *folder = (CamelFolder *) vf;
 	CamelStore *parent_store;
 
 	vf->flags = flags;
@@ -2030,7 +2030,7 @@ camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags
 	g_return_val_if_fail (full != NULL, NULL);
 
 	if (CAMEL_IS_VEE_STORE (parent_store) && strcmp (full, CAMEL_UNMATCHED_NAME) == 0) {
-		vf = ((CamelVeeStore *)parent_store)->folder_unmatched;
+		vf = ((CamelVeeStore *) parent_store)->folder_unmatched;
 		g_object_ref (vf);
 	} else {
 		const gchar *name = strrchr (full, '/');
@@ -2060,7 +2060,7 @@ camel_vee_folder_new (CamelStore *parent_store, const gchar *full, guint32 flags
 			/* setup defaults: we have none currently */
 		}
 	}
-	return (CamelFolder *)vf;
+	return (CamelFolder *) vf;
 }
 
 void
@@ -2083,7 +2083,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
 	gint i;
 	CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
 
-	if (vf == (CamelVeeFolder *)sub) {
+	if (vf == (CamelVeeFolder *) sub) {
 		g_warning ("Adding a virtual folder to itself as source, ignored");
 		return;
 	}
@@ -2098,7 +2098,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
 		camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
 
 		/* update the freeze state of 'sub' to match our freeze state */
-		for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++)
+		for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) vf); i++)
 			camel_folder_freeze (sub);
 
 		camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
@@ -2111,7 +2111,7 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
 		camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
 
 		/* update the freeze state of 'sub' to match Unmatched's freeze state */
-		for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++)
+		for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) folder_unmatched); i++)
 			camel_folder_freeze (sub);
 
 		camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
@@ -2168,7 +2168,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf,
 
 	/* undo the freeze state that we have imposed on this source folder */
 	camel_folder_lock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
-	for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)vf); i++)
+	for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) vf); i++)
 		camel_folder_thaw (sub);
 	camel_folder_unlock (CAMEL_FOLDER (vf), CAMEL_FOLDER_CHANGE_LOCK);
 
@@ -2186,7 +2186,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf,
 
 				/* undo the freeze state that Unmatched has imposed on this source folder */
 				camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
-				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++)
+				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) folder_unmatched); i++)
 					camel_folder_thaw (sub);
 				camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
 			}
@@ -2197,7 +2197,7 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf,
 
 				/* undo the freeze state that Unmatched has imposed on this source folder */
 				camel_folder_lock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
-				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *)folder_unmatched); i++)
+				for (i = 0; i < camel_folder_get_frozen_count ((CamelFolder *) folder_unmatched); i++)
 					camel_folder_thaw (sub);
 				camel_folder_unlock (CAMEL_FOLDER (folder_unmatched), CAMEL_FOLDER_CHANGE_LOCK);
 			}
@@ -2276,7 +2276,7 @@ camel_vee_folder_set_folders (CamelVeeFolder *vf, GList *folders)
 	}
 
 	/* then remove any we still have */
-	g_hash_table_foreach (remove, (GHFunc)remove_folders, vf);
+	g_hash_table_foreach (remove, (GHFunc) remove_folders, vf);
 	g_hash_table_destroy (remove);
 }
 
@@ -2349,9 +2349,9 @@ camel_vee_folder_get_location (CamelVeeFolder *vf, const CamelVeeMessageInfo *vi
 		CamelFolder *res;
 		const CamelVeeMessageInfo *vfinfo;
 
-		vfinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info (folder, camel_message_info_uid (vinfo)+8);
-		res = camel_vee_folder_get_location ((CamelVeeFolder *)folder, vfinfo, realuid);
-		camel_folder_free_message_info (folder, (CamelMessageInfo *)vfinfo);
+		vfinfo = (CamelVeeMessageInfo *) camel_folder_get_message_info (folder, camel_message_info_uid (vinfo)+8);
+		res = camel_vee_folder_get_location ((CamelVeeFolder *) folder, vfinfo, realuid);
+		camel_folder_free_message_info (folder, (CamelMessageInfo *) vfinfo);
 		return res;
 	} else {
 		if (realuid)
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 8da872c..460c319 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -150,7 +150,7 @@ vee_store_get_folder_sync (CamelStore *store,
 	CamelFolder *folder;
 	gchar *name, *p;
 
-	vf = (CamelVeeFolder *)camel_vee_folder_new (store, folder_name, flags);
+	vf = (CamelVeeFolder *) camel_vee_folder_new (store, folder_name, flags);
 	if (vf && ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0)) {
 		const gchar *full_name;
 
@@ -176,10 +176,10 @@ vee_store_get_folder_sync (CamelStore *store,
 			*p++='/';
 		}
 
-		change_folder (store, full_name, CHANGE_ADD, camel_folder_get_message_count ((CamelFolder *)vf));
+		change_folder (store, full_name, CHANGE_ADD, camel_folder_get_message_count ((CamelFolder *) vf));
 	}
 
-	return (CamelFolder *)vf;
+	return (CamelFolder *) vf;
 }
 
 static CamelFolderInfo *
@@ -233,7 +233,7 @@ vee_store_get_folder_info_sync (CamelStore *store,
 			/* ensures unread is correct */
 			if ((flags & CAMEL_STORE_FOLDER_INFO_FAST) == 0)
 				camel_folder_refresh_info_sync (
-					(CamelFolder *)folder,
+					(CamelFolder *) folder,
 					cancellable, NULL);
 
 			unread = camel_folder_get_unread_message_count (
@@ -359,7 +359,7 @@ vee_store_delete_folder_sync (CamelStore *store,
 			camel_object_set_state_filename (object, NULL);
 		}
 
-		if ((((CamelVeeFolder *)folder)->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
+		if ((((CamelVeeFolder *) folder)->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
 			/* what about now-empty parents?  ignore? */
 			change_folder (store, folder_name, CHANGE_DELETE, -1);
 		}
@@ -417,7 +417,7 @@ vee_store_rename_folder_sync (CamelStore *store,
 		folder = camel_object_bag_reserve (store->folders, name);
 		if (folder == NULL) {
 			/* create a dummy vFolder for this, makes get_folder_info simpler */
-			folder = camel_vee_folder_new (store, name, ((CamelVeeFolder *)oldfolder)->flags);
+			folder = camel_vee_folder_new (store, name, ((CamelVeeFolder *) oldfolder)->flags);
 			camel_object_bag_add (store->folders, name, folder);
 			change_folder (store, name, CHANGE_ADD|CHANGE_NOSELECT, 0);
 			/* FIXME: this sort of leaks folder, nobody owns a ref to it but us */
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index c34eddf..2b0bf69 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -47,7 +47,7 @@ G_DEFINE_TYPE (CamelVeeSummary, camel_vee_summary, CAMEL_TYPE_FOLDER_SUMMARY)
 static void
 vee_message_info_free (CamelFolderSummary *s, CamelMessageInfo *info)
 {
-	CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)info;
+	CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) info;
 
 	camel_pstring_free (info->uid);
 	g_object_unref (mi->summary);
@@ -57,15 +57,15 @@ static CamelMessageInfo *
 vee_message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 {
 	CamelVeeMessageInfo *to;
-	const CamelVeeMessageInfo *from = (const CamelVeeMessageInfo *)mi;
+	const CamelVeeMessageInfo *from = (const CamelVeeMessageInfo *) mi;
 
-	to = (CamelVeeMessageInfo *)camel_message_info_new (s);
+	to = (CamelVeeMessageInfo *) camel_message_info_new (s);
 
 	to->summary = g_object_ref (from->summary);
 	to->info.summary = s;
 	to->info.uid = camel_pstring_strdup (from->info.uid);
 
-	return (CamelMessageInfo *)to;
+	return (CamelMessageInfo *) to;
 }
 
 #define HANDLE_NULL_INFO(value) if (!rmi) { d(g_warning (G_STRLOC ": real info is NULL for %s, safeguarding\n", mi->uid)); return value; }
@@ -88,7 +88,7 @@ vee_info_ptr (const CamelMessageInfo *mi, gint id)
 static guint32
 vee_info_uint32 (const CamelMessageInfo *mi, gint id)
 {
-	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 	guint32 ret;
 
 	HANDLE_NULL_INFO (0);
@@ -102,7 +102,7 @@ vee_info_uint32 (const CamelMessageInfo *mi, gint id)
 static time_t
 vee_info_time (const CamelMessageInfo *mi, gint id)
 {
-	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 	time_t ret;
 
 	HANDLE_NULL_INFO (0);
@@ -115,7 +115,7 @@ vee_info_time (const CamelMessageInfo *mi, gint id)
 static gboolean
 vee_info_user_flag (const CamelMessageInfo *mi, const gchar *id)
 {
-	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 	gboolean ret;
 
 	HANDLE_NULL_INFO (FALSE);
@@ -128,7 +128,7 @@ vee_info_user_flag (const CamelMessageInfo *mi, const gchar *id)
 static const gchar *
 vee_info_user_tag (const CamelMessageInfo *mi, const gchar *id)
 {
-	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+	CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 	const gchar *ret;
 
 	HANDLE_NULL_INFO("");
@@ -143,7 +143,7 @@ vee_info_set_user_flag (CamelMessageInfo *mi, const gchar *name, gboolean value)
 {
 	gint res = FALSE;
 	gboolean hacked_unread_folder = FALSE;
-	CamelVeeFolder *vf = (CamelVeeFolder *)mi->summary->folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) mi->summary->folder;
 
 	if (camel_debug("vfolderexp"))
 		printf (
@@ -158,16 +158,16 @@ vee_info_set_user_flag (CamelMessageInfo *mi, const gchar *name, gboolean value)
 		hacked_unread_folder = TRUE;
 
 	if (mi->uid) {
-		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 		HANDLE_NULL_INFO (FALSE);
 
 		if (hacked_unread_folder)
-			camel_vee_folder_mask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
+			camel_vee_folder_mask_event_folder_changed ((CamelVeeFolder *) mi->summary->folder, rmi->summary->folder);
 
 		res = camel_message_info_set_user_flag (rmi, name, value);
 
 		if (hacked_unread_folder)
-			camel_vee_folder_unmask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
+			camel_vee_folder_unmask_event_folder_changed ((CamelVeeFolder *) mi->summary->folder, rmi->summary->folder);
 
 		camel_message_info_free (rmi);
 	}
@@ -181,7 +181,7 @@ vee_info_set_user_tag (CamelMessageInfo *mi, const gchar *name, const gchar *val
 	gint res = FALSE;
 
 	if (mi->uid) {
-		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
+		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
 		HANDLE_NULL_INFO (FALSE);
 		res = camel_message_info_set_user_tag (rmi, name, value);
 		camel_message_info_free (rmi);
@@ -205,7 +205,7 @@ camel_vee_summary_load_check_unread_vfolder (CamelVeeSummary *vs)
 
 	g_return_if_fail (vs != NULL);
 
-	vf = (CamelVeeFolder *) ((CamelFolderSummary *)vs)->folder;
+	vf = (CamelVeeFolder *) ((CamelFolderSummary *) vs)->folder;
 
 	/* HACK: Ugliest of all hacks. Its virtually not possible now
 	 * to maintain counts and the non matching uids of unread vfolder here.
@@ -233,7 +233,7 @@ vee_info_set_flags (CamelMessageInfo *mi,
                     guint32 set)
 {
 	gint res = FALSE;
-	CamelVeeFolder *vf = (CamelVeeFolder *)mi->summary->folder;
+	CamelVeeFolder *vf = (CamelVeeFolder *) mi->summary->folder;
 	gboolean hacked_unread_folder = FALSE;
 
 	if (camel_debug("vfolderexp"))
@@ -250,8 +250,8 @@ vee_info_set_flags (CamelMessageInfo *mi,
 
 	if (mi->uid) {
 		guint32 old_visible, visible, old_unread;
-		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *)mi)->summary, mi->uid+8);
-		CamelVeeSummary *vsummary = (CamelVeeSummary *)mi->summary;
+		CamelMessageInfo *rmi = camel_folder_summary_uid (((CamelVeeMessageInfo *) mi)->summary, mi->uid+8);
+		CamelVeeSummary *vsummary = (CamelVeeSummary *) mi->summary;
 
 		HANDLE_NULL_INFO (FALSE);
 
@@ -260,7 +260,7 @@ vee_info_set_flags (CamelMessageInfo *mi,
 		camel_folder_summary_update_counts_by_flags (mi->summary, camel_message_info_flags (rmi), TRUE);
 
 		if (hacked_unread_folder)
-			camel_vee_folder_mask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
+			camel_vee_folder_mask_event_folder_changed ((CamelVeeFolder *) mi->summary->folder, rmi->summary->folder);
 
 		camel_folder_freeze (rmi->summary->folder);
 		res = camel_message_info_set_flags (rmi, flags, set);
@@ -268,7 +268,7 @@ vee_info_set_flags (CamelMessageInfo *mi,
 		camel_folder_thaw (rmi->summary->folder);
 
 		if (hacked_unread_folder)
-			camel_vee_folder_unmask_event_folder_changed ((CamelVeeFolder *)mi->summary->folder, rmi->summary->folder);
+			camel_vee_folder_unmask_event_folder_changed ((CamelVeeFolder *) mi->summary->folder, rmi->summary->folder);
 
 		visible = rmi->summary->visible_count;
 
@@ -291,7 +291,7 @@ vee_info_set_flags (CamelMessageInfo *mi,
 			camel_folder_change_info_change_uid (changes, mi->uid);
 
 			array = g_ptr_array_new ();
-			g_ptr_array_add (array, (gpointer)rmi->uid);
+			g_ptr_array_add (array, (gpointer) rmi->uid);
 
 			match = camel_folder_search_by_uids (rmi->summary->folder, vf->expression, array, NULL);
 			if ((match && !match->len) || !match) {
@@ -424,7 +424,7 @@ GPtrArray *
 camel_vee_summary_get_ids (CamelVeeSummary *summary, gchar hash[8])
 {
 	gchar *shash = g_strdup_printf("%c%c%c%c%c%c%c%c", hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7]);
-	CamelFolderSummary *cfs = (CamelFolderSummary *)summary;
+	CamelFolderSummary *cfs = (CamelFolderSummary *) summary;
 	CamelStore *parent_store;
 	GPtrArray *array;
 	const gchar *full_name;
@@ -464,7 +464,7 @@ camel_vee_summary_add (CamelVeeSummary *s, CamelFolderSummary *summary, const gc
 		return mi;
 	}
 
-	mi = (CamelVeeMessageInfo *)camel_message_info_new (&s->summary);
+	mi = (CamelVeeMessageInfo *) camel_message_info_new (&s->summary);
 	mi->summary = g_object_ref (summary);
 	mi->info.uid = (gchar *) camel_pstring_strdup (vuid);
 	g_free (vuid);
@@ -477,7 +477,7 @@ camel_vee_summary_add (CamelVeeSummary *s, CamelFolderSummary *summary, const gc
 		camel_message_info_free (rmi);
 	}
 
-	camel_folder_summary_insert (&s->summary, (CamelMessageInfo *)mi, FALSE);
+	camel_folder_summary_insert (&s->summary, (CamelMessageInfo *) mi, FALSE);
 	camel_folder_summary_update_counts_by_flags (&s->summary, camel_message_info_flags (mi), FALSE);
 
 	return mi;
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
index 5ff3fa0..95f604d 100644
--- a/camel/camel-vtrash-folder.c
+++ b/camel/camel-vtrash-folder.c
@@ -93,7 +93,7 @@ vtrash_folder_append_message_sync (CamelFolder *folder,
 {
 	g_set_error (
 		error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, "%s",
-		_(vdata[((CamelVTrashFolder *)folder)->type].error_copy));
+		_(vdata[((CamelVTrashFolder *) folder)->type].error_copy));
 
 	return FALSE;
 }
@@ -112,7 +112,7 @@ vtrash_folder_transfer_messages_to_sync (CamelFolder *source,
 	GHashTable *batch = NULL;
 	const gchar *tuid;
 	struct _transfer_data *md;
-	guint32 sbit = ((CamelVTrashFolder *)source)->bit;
+	guint32 sbit = ((CamelVTrashFolder *) source)->bit;
 
 	/* This is a special case of transfer_messages_to: Either the
 	 * source or the destination is a vtrash folder (but not both
@@ -127,7 +127,7 @@ vtrash_folder_transfer_messages_to_sync (CamelFolder *source,
 		if (!delete_originals) {
 			g_set_error (
 				error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, "%s",
-				_(vdata[((CamelVTrashFolder *)dest)->type].error_copy));
+				_(vdata[((CamelVTrashFolder *) dest)->type].error_copy));
 			return FALSE;
 		}
 
@@ -135,7 +135,7 @@ vtrash_folder_transfer_messages_to_sync (CamelFolder *source,
 		for (i = 0; i < uids->len; i++)
 			camel_folder_set_message_flags (
 				source, uids->pdata[i],
-				((CamelVTrashFolder *)dest)->bit, ~0);
+				((CamelVTrashFolder *) dest)->bit, ~0);
 		return TRUE;
 	}
 
@@ -146,7 +146,7 @@ vtrash_folder_transfer_messages_to_sync (CamelFolder *source,
 	 */
 
 	for (i = 0; i < uids->len; i++) {
-		mi = (CamelVeeMessageInfo *)camel_folder_get_message_info (source, uids->pdata[i]);
+		mi = (CamelVeeMessageInfo *) camel_folder_get_message_info (source, uids->pdata[i]);
 		if (mi == NULL) {
 			g_warning ("Cannot find uid %s in source folder during transfer", (gchar *) uids->pdata[i]);
 			continue;
@@ -176,11 +176,11 @@ vtrash_folder_transfer_messages_to_sync (CamelFolder *source,
 				tuid += 8;
 			g_ptr_array_add (md->uids, g_strdup (tuid));
 		}
-		camel_folder_free_message_info (source, (CamelMessageInfo *)mi);
+		camel_folder_free_message_info (source, (CamelMessageInfo *) mi);
 	}
 
 	if (batch) {
-		g_hash_table_foreach (batch, (GHFunc)transfer_messages, error);
+		g_hash_table_foreach (batch, (GHFunc) transfer_messages, error);
 		g_hash_table_destroy (batch);
 	}
 
@@ -232,10 +232,10 @@ camel_vtrash_folder_new (CamelStore *parent_store, camel_vtrash_folder_t type)
 		CAMEL_STORE_VEE_FOLDER_AUTO |
 		CAMEL_STORE_VEE_FOLDER_SPECIAL);
 
-	((CamelFolder *)vtrash)->folder_flags |= vdata[type].flags;
-	camel_vee_folder_set_expression ((CamelVeeFolder *)vtrash, vdata[type].expr);
+	((CamelFolder *) vtrash)->folder_flags |= vdata[type].flags;
+	camel_vee_folder_set_expression ((CamelVeeFolder *) vtrash, vdata[type].expr);
 	vtrash->bit = vdata[type].bit;
 	vtrash->type = type;
 
-	return (CamelFolder *)vtrash;
+	return (CamelFolder *) vtrash;
 }
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 0aea814..d39049b 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -631,7 +631,7 @@ imap_rename (CamelFolder *folder, const gchar *new)
 {
 	CamelService *service;
 	CamelStore *parent_store;
-	CamelImapFolder *imap_folder = (CamelImapFolder *)folder;
+	CamelImapFolder *imap_folder = (CamelImapFolder *) folder;
 	const gchar *user_data_dir;
 	gchar *folder_dir, *summary_path, *state_file;
 	gchar *folders;
@@ -818,7 +818,7 @@ imap_refresh_info_sync (CamelFolder *folder,
 		camel_imap_response_free (imap_store, response);
 	}
 
-	si = camel_store_summary_path ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary, full_name);
+	si = camel_store_summary_path ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary, full_name);
 	if (si) {
 		guint32 unread, total;
 
@@ -829,10 +829,10 @@ imap_refresh_info_sync (CamelFolder *folder,
 		    || si->unread != unread) {
 			si->total = total;
 			si->unread = unread;
-			camel_store_summary_touch ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary);
+			camel_store_summary_touch ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary);
 			check_rescan = 0;
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary, si);
 	}
 
 	if (check_rescan && !camel_application_is_exiting && local_error == NULL) {
@@ -862,7 +862,7 @@ done:
 	camel_service_unlock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
 
 	camel_folder_summary_save_to_db (folder->summary, NULL);
-	camel_store_summary_save ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary);
+	camel_store_summary_save ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary);
 
 	if (local_error != NULL) {
 		g_propagate_error (error, local_error);
@@ -881,7 +881,7 @@ fillup_custom_flags (CamelMessageInfo *mi, gchar *custom_flags)
 	array_str = g_strsplit (custom_flags, " ", -1);
 
 	while (array_str[index] != NULL) {
-		camel_flag_set (&((CamelMessageInfoBase *)mi)->user_flags, array_str[index], TRUE);
+		camel_flag_set (&((CamelMessageInfoBase *) mi)->user_flags, array_str[index], TRUE);
 		++ index;
 	}
 
@@ -918,7 +918,7 @@ merge_custom_flags (CamelMessageInfo *mi, const gchar *custom_flags)
 	}
 
 	for (flag = camel_message_info_user_flags (mi); flag; flag = flag->next) {
-		gchar *name = (gchar *)flag->name;
+		gchar *name = (gchar *) flag->name;
 
 		if (name && *name)
 			list = g_slist_prepend (list, name);
@@ -937,7 +937,7 @@ merge_custom_flags (CamelMessageInfo *mi, const gchar *custom_flags)
 			mi->dirty = TRUE;
 			if (mi->summary)
 				camel_folder_summary_touch (mi->summary);
-			camel_flag_set (&((CamelMessageInfoBase *)mi)->user_flags, p->data, g_hash_table_lookup (server, p->data) != NULL);
+			camel_flag_set (&((CamelMessageInfoBase *) mi)->user_flags, p->data, g_hash_table_lookup (server, p->data) != NULL);
 			((CamelMessageInfoBase *) mi)->flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
 		}
 	}
@@ -1095,7 +1095,7 @@ imap_rescan (CamelFolder *folder,
 				continue;
 		}
 
-		iinfo = (CamelImapMessageInfo *)info;
+		iinfo = (CamelImapMessageInfo *) info;
 
 		if (strcmp (uid, new[j].uid) != 0) {
 			g_free (uid);
@@ -1349,8 +1349,8 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
 		/* if the resulting flag list is empty, then "concat" other message
 		   only when server_flags are same, because there will be a flag removal
 		   command for this type of situation */
-		if ((info->info.flags & mask) != flags || (flags == 0 && info->server_flags != ((CamelImapMessageInfo *)master_info)->server_flags)) {
-			camel_message_info_free ((CamelMessageInfo *)info);
+		if ((info->info.flags & mask) != flags || (flags == 0 && info->server_flags != ((CamelImapMessageInfo *) master_info)->server_flags)) {
+			camel_message_info_free ((CamelMessageInfo *) info);
 			close_range ();
 			continue;
 		}
@@ -1364,7 +1364,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
 		}
 
 		/* only check user flags when we see other message than our 'master' */
-		if (strcmp (master_info->uid, ((CamelMessageInfo *)info)->uid)) {
+		if (strcmp (master_info->uid, ((CamelMessageInfo *) info)->uid)) {
 			const CamelFlag *flag;
 			GSList *list2 = NULL, *l1, *l2;
 			gint count2 = 0, cmp = 0;
@@ -1373,7 +1373,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
 				for (flag = camel_message_info_user_flags (master_info); flag; flag = flag->next) {
 					if (flag->name && *flag->name) {
 						count1++;
-						list1 = g_slist_prepend (list1, (gchar *)flag->name);
+						list1 = g_slist_prepend (list1, (gchar *) flag->name);
 					}
 				}
 
@@ -1383,7 +1383,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, CamelMessageInfo
 			for (flag = camel_message_info_user_flags (info); flag; flag = flag->next) {
 				if (flag->name && *flag->name) {
 					count2++;
-					list2 = g_slist_prepend (list2, (gchar *)flag->name);
+					list2 = g_slist_prepend (list2, (gchar *) flag->name);
 				}
 			}
 
@@ -1465,20 +1465,20 @@ imap_sync_offline (CamelFolder *folder,
 
 		/* ... and store's summary when folder's summary is dirty */
 		full_name = camel_folder_get_full_name (folder);
-		si = camel_store_summary_path ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary, full_name);
+		si = camel_store_summary_path ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary, full_name);
 		if (si) {
 			if (si->total != folder->summary->saved_count || si->unread != folder->summary->unread_count) {
 				si->total = folder->summary->saved_count;
 				si->unread = folder->summary->unread_count;
-				camel_store_summary_touch ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary);
+				camel_store_summary_touch ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary);
 			}
 
-			camel_store_summary_info_free ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary, si);
 		}
 	}
 
 	camel_folder_summary_save_to_db (folder->summary, NULL);
-	camel_store_summary_save ((CamelStoreSummary *)((CamelImapStore *)parent_store)->summary);
+	camel_store_summary_save ((CamelStoreSummary *)((CamelImapStore *) parent_store)->summary);
 
 	return TRUE;
 }
@@ -1640,7 +1640,7 @@ imap_synchronize_sync (CamelFolder *folder,
 		}
 
 		if (!(info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
-			camel_message_info_free ((CamelMessageInfo *)info);
+			camel_message_info_free ((CamelMessageInfo *) info);
 			continue;
 		}
 
@@ -1650,7 +1650,7 @@ imap_synchronize_sync (CamelFolder *folder,
 		   they will be scooped up later by our parent loop (I
 		   think?). -- Jeff */
 		matches = get_matching (folder, info->info.flags & (folder->permanent_flags | CAMEL_MESSAGE_FOLDER_FLAGGED),
-					folder->permanent_flags | CAMEL_MESSAGE_FOLDER_FLAGGED, (CamelMessageInfo *)info, &set, summary,
+					folder->permanent_flags | CAMEL_MESSAGE_FOLDER_FLAGGED, (CamelMessageInfo *) info, &set, summary,
 					deleted_uids, junked_uids);
 		if (matches == NULL) {
 			camel_message_info_free (info);
@@ -1669,7 +1669,7 @@ imap_synchronize_sync (CamelFolder *folder,
 			info->info.flags &= ~CAMEL_MESSAGE_DELETED;
 		}
 
-		flaglist = imap_create_flag_list (info->info.flags & folder->permanent_flags, (CamelMessageInfo *)info, folder->permanent_flags);
+		flaglist = imap_create_flag_list (info->info.flags & folder->permanent_flags, (CamelMessageInfo *) info, folder->permanent_flags);
 
 		if (strcmp (flaglist, "()") == 0) {
 			/* Note: Cyrus is broken and will not accept an
@@ -1680,7 +1680,7 @@ imap_synchronize_sync (CamelFolder *folder,
 			g_free (flaglist);
 
 			/* unset all known server flags, because there left none in the actual flags */
-			flaglist =  imap_create_flag_list (info->server_flags & folder->permanent_flags, (CamelMessageInfo *)info, folder->permanent_flags);
+			flaglist =  imap_create_flag_list (info->server_flags & folder->permanent_flags, (CamelMessageInfo *) info, folder->permanent_flags);
 
 			if (strcmp (flaglist, "()") == 0) {
 				/* this should not happen, really */
@@ -1803,7 +1803,7 @@ imap_synchronize_sync (CamelFolder *folder,
 static gint
 uid_compar (gconstpointer va, gconstpointer vb)
 {
-	const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
+	const gchar **sa = (const gchar **) va, **sb = (const gchar **) vb;
 	gulong a, b;
 
 	a = strtoul (*sa, NULL, 10);
@@ -2328,7 +2328,7 @@ retry:
 
 	flags &= folder->permanent_flags;
 	if (flags)
-		flagstr = imap_create_flag_list (flags, (CamelMessageInfo *)info, folder->permanent_flags);
+		flagstr = imap_create_flag_list (flags, (CamelMessageInfo *) info, folder->permanent_flags);
 	else
 		flagstr = NULL;
 
@@ -2910,7 +2910,7 @@ camel_imap_transfer_resyncing (CamelFolder *source,
 				if (!uid)
 					break;
 			}
-			g_ptr_array_add (realuids, (gchar *)uid);
+			g_ptr_array_add (realuids, (gchar *) uid);
 		}
 
 		/* If we saw any real UIDs, do a COPY */
@@ -3234,7 +3234,7 @@ get_content (CamelImapFolder *imap_folder,
 			}
 
 			if (camel_debug("imap:folder")) {
-				gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *)part));
+				gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *) part));
 				gchar *ct2 = camel_content_type_format (ci->type);
 
 				printf("Setting part content type to '%s' contentinfo type is '%s'\n", ct, ct2);
@@ -3334,7 +3334,7 @@ get_message (CamelImapFolder *imap_folder,
 	}
 
 	if (camel_debug("imap:folder")) {
-		gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *)msg));
+		gchar *ct = camel_content_type_format (camel_mime_part_get_content_type ((CamelMimePart *) msg));
 		gchar *ct2 = camel_content_type_format (ci->type);
 
 		printf("Setting message content type to '%s' contentinfo type is '%s'\n", ct, ct2);
@@ -3342,7 +3342,7 @@ get_message (CamelImapFolder *imap_folder,
 		g_free (ct2);
 	}
 
-	camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type ((CamelMimePart *)msg));
+	camel_data_wrapper_set_mime_type_field (content, camel_mime_part_get_content_type ((CamelMimePart *) msg));
 	camel_medium_set_content (CAMEL_MEDIUM (msg), content);
 	g_object_unref (CAMEL_OBJECT (content));
 
@@ -3403,7 +3403,7 @@ static CamelImapMessageInfo *
 imap_folder_summary_uid_or_error (CamelFolderSummary *summary, const gchar * uid, GError **error)
 {
 	CamelImapMessageInfo *mi;
-	mi = (CamelImapMessageInfo *)camel_folder_summary_uid (summary, uid);
+	mi = (CamelImapMessageInfo *) camel_folder_summary_uid (summary, uid);
 	if (mi == NULL) {
 		g_set_error (
 			error, CAMEL_FOLDER_ERROR,
@@ -3461,8 +3461,8 @@ imap_get_message_sync (CamelFolder *folder,
 			CamelMessageInfoBase *info = (CamelMessageInfoBase *) camel_folder_summary_uid (folder->summary, uid);
 			msg = get_message_simple (imap_folder, uid, NULL, cancellable, &local_error);
 			if (info && !info->preview && msg && camel_folder_summary_get_need_preview (folder->summary)) {
-				if (camel_mime_message_build_preview ((CamelMimePart *)msg, (CamelMessageInfo *)info) && info->preview)
-					camel_folder_summary_add_preview (folder->summary, (CamelMessageInfo *)info);
+				if (camel_mime_message_build_preview ((CamelMimePart *) msg, (CamelMessageInfo *) info) && info->preview)
+					camel_folder_summary_add_preview (folder->summary, (CamelMessageInfo *) info);
 			}
 
 			camel_message_info_free (info);
@@ -3523,7 +3523,7 @@ imap_get_message_sync (CamelFolder *folder,
 
 			if (camel_debug_start("imap:folder")) {
 				printf("Folder get message '%s' folder info ->\n", uid);
-				camel_message_info_dump ((CamelMessageInfo *)mi);
+				camel_message_info_dump ((CamelMessageInfo *) mi);
 				camel_debug_end ();
 			}
 
@@ -3540,8 +3540,8 @@ imap_get_message_sync (CamelFolder *folder,
 			if (msg && camel_folder_summary_get_need_preview (folder->summary)) {
 				CamelMessageInfoBase *info = (CamelMessageInfoBase *) camel_folder_summary_uid (folder->summary, uid);
 				if (info && !info->preview) {
-					if (camel_mime_message_build_preview ((CamelMimePart *)msg, (CamelMessageInfo *)info) && info->preview)
-						camel_folder_summary_add_preview (folder->summary, (CamelMessageInfo *)info);
+					if (camel_mime_message_build_preview ((CamelMimePart *) msg, (CamelMessageInfo *) info) && info->preview)
+						camel_folder_summary_add_preview (folder->summary, (CamelMessageInfo *) info);
 				}
 				camel_message_info_free (info);
 			}
@@ -4137,7 +4137,7 @@ imap_update_summary (CamelFolder *folder,
 				continue;
 			}
 
-			mi = (CamelImapMessageInfo *)camel_message_info_clone (pmi);
+			mi = (CamelImapMessageInfo *) camel_message_info_clone (pmi);
 		}
 
 		uid = g_datalist_get_data (&data, "UID");
@@ -4147,7 +4147,7 @@ imap_update_summary (CamelFolder *folder,
 		if (flags) {
 			gchar *custom_flags = NULL;
 
-			((CamelImapMessageInfo *)mi)->server_flags = flags;
+			((CamelImapMessageInfo *) mi)->server_flags = flags;
 			/* "or" them in with the existing flags that may
 			 * have been set by summary_info_new_from_message.
 			 */
@@ -4155,7 +4155,7 @@ imap_update_summary (CamelFolder *folder,
 
 			custom_flags = g_datalist_get_data (&data, "CUSTOM.FLAGS");
 			if (custom_flags)
-				fillup_custom_flags ((CamelMessageInfo *)mi, custom_flags);
+				fillup_custom_flags ((CamelMessageInfo *) mi, custom_flags);
 		}
 		size = GPOINTER_TO_INT (g_datalist_get_data (&data, "RFC822.SIZE"));
 		if (size)
@@ -4164,7 +4164,7 @@ imap_update_summary (CamelFolder *folder,
 		/* Just do this to build the junk required headers to be built*/
 		jdata.data = data;
 		jdata.mi = (CamelMessageInfoBase *) mi;
-		g_hash_table_foreach ((GHashTable *)camel_session_get_junk_headers (camel_service_get_session (service)), (GHFunc) construct_junk_headers, &jdata);
+		g_hash_table_foreach ((GHashTable *) camel_session_get_junk_headers (camel_service_get_session (service)), (GHFunc) construct_junk_headers, &jdata);
 		g_datalist_clear (&data);
 	}
 	g_ptr_array_free (fetch_data, TRUE);
@@ -4187,7 +4187,7 @@ imap_update_summary (CamelFolder *folder,
 				i + first);
 			break;
 		}
-		uid = (gchar *)camel_message_info_uid (mi);
+		uid = (gchar *) camel_message_info_uid (mi);
 		if (uid[0] == 0) {
 			g_warning("Server provided no uid: message %d", i + first);
 			g_set_error (
@@ -4207,11 +4207,11 @@ imap_update_summary (CamelFolder *folder,
 /*					break; */
 /*			} */
 
-		((CamelMessageInfoBase *)mi)->dirty = TRUE;
-		if (((CamelMessageInfoBase *)mi)->summary)
-			camel_folder_summary_touch (((CamelMessageInfoBase *)mi)->summary);
-		camel_folder_summary_add (folder->summary, (CamelMessageInfo *)mi);
-		update_summary (folder->summary, (CamelMessageInfoBase *)mi);
+		((CamelMessageInfoBase *) mi)->dirty = TRUE;
+		if (((CamelMessageInfoBase *) mi)->summary)
+			camel_folder_summary_touch (((CamelMessageInfoBase *) mi)->summary);
+		camel_folder_summary_add (folder->summary, (CamelMessageInfo *) mi);
+		update_summary (folder->summary, (CamelMessageInfoBase *) mi);
 		camel_folder_change_info_add_uid (changes, camel_message_info_uid (mi));
 
 		/* Report all new messages as recent, even without that flag, thus new
diff --git a/camel/providers/imap/camel-imap-journal.c b/camel/providers/imap/camel-imap-journal.c
index d94b522..bbb58a2 100644
--- a/camel/providers/imap/camel-imap-journal.c
+++ b/camel/providers/imap/camel-imap-journal.c
@@ -348,7 +348,7 @@ imap_entry_play (CamelOfflineJournal *journal,
 		camel_folder_free_message_info (journal->folder, info);
 
 		if (ret_uid) {
-			camel_imap_journal_uidmap_add ((CamelIMAPJournal *)journal, imap_entry->append_uid, ret_uid);
+			camel_imap_journal_uidmap_add ((CamelIMAPJournal *) journal, imap_entry->append_uid, ret_uid);
 			g_free (ret_uid);
 		}
 
@@ -377,7 +377,7 @@ imap_entry_play (CamelOfflineJournal *journal,
 			for (i = 0; i < imap_entry->uids->len; i++) {
 				if (!ret_uids->pdata[i])
 					continue;
-				camel_imap_journal_uidmap_add ((CamelIMAPJournal *)journal, imap_entry->uids->pdata[i], ret_uids->pdata[i]);
+				camel_imap_journal_uidmap_add ((CamelIMAPJournal *) journal, imap_entry->uids->pdata[i], ret_uids->pdata[i]);
 				g_free (ret_uids->pdata[i]);
 			}
 			g_ptr_array_free (ret_uids, TRUE);
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index 6aa09fc..cc28672 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -681,7 +681,7 @@ camel_imap_message_cache_filter_cached (CamelImapMessageCache *cache, GPtrArray
 			 */
 			part_find.found = 0;
 			part_find.disk_part_name = g_strdup_printf("%s" BASE_PART_SUFFIX,
-								   (gchar *)uids->pdata[i]);
+								   (gchar *) uids->pdata[i]);
 			g_ptr_array_foreach (parts_list, _match_part, &part_find);
 			g_free (part_find.disk_part_name);
 			if (part_find.found)
@@ -693,7 +693,7 @@ camel_imap_message_cache_filter_cached (CamelImapMessageCache *cache, GPtrArray
 		/* No message parts, or message part "" not found: include the
 		 * uid in the result.
 		 */
-		g_ptr_array_add (result, (gchar *)camel_pstring_strdup (uids->pdata[i]));
+		g_ptr_array_add (result, (gchar *) camel_pstring_strdup (uids->pdata[i]));
 	}
 	return result;
 }
diff --git a/camel/providers/imap/camel-imap-private.h b/camel/providers/imap/camel-imap-private.h
index b33bbad..542a8ac 100644
--- a/camel/providers/imap/camel-imap-private.h
+++ b/camel/providers/imap/camel-imap-private.h
@@ -21,13 +21,13 @@ struct _CamelImapFolderPrivate {
 
 #ifdef ENABLE_THREADS
 #define CAMEL_IMAP_FOLDER_LOCK(f, l) \
-	(g_static_mutex_lock (&((CamelImapFolder *)f)->priv->l))
+	(g_static_mutex_lock (&((CamelImapFolder *) f)->priv->l))
 #define CAMEL_IMAP_FOLDER_UNLOCK(f, l) \
-	(g_static_mutex_unlock (&((CamelImapFolder *)f)->priv->l))
+	(g_static_mutex_unlock (&((CamelImapFolder *) f)->priv->l))
 #define CAMEL_IMAP_FOLDER_REC_LOCK(f, l) \
-	(g_static_rec_mutex_lock (&((CamelImapFolder *)f)->priv->l))
+	(g_static_rec_mutex_lock (&((CamelImapFolder *) f)->priv->l))
 #define CAMEL_IMAP_FOLDER_REC_UNLOCK(f, l) \
-	(g_static_rec_mutex_unlock (&((CamelImapFolder *)f)->priv->l))
+	(g_static_rec_mutex_unlock (&((CamelImapFolder *) f)->priv->l))
 #else
 #define CAMEL_IMAP_FOLDER_LOCK(obj)
 #define CAMEL_IMAP_FOLDER_UNLOCK(obj)
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index 3404ec1..7d261fa 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -135,7 +135,7 @@ add_hash (guint *hash, gchar *s)
 static guint
 imap_url_hash (gconstpointer key)
 {
-	const CamelURL *u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *) key;
 	guint hash = 0;
 
 	add_hash (&hash, u->user);
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 9207381..3e90ddd 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -129,7 +129,7 @@ imap_search_finalize (GObject *object)
 
 	search = CAMEL_IMAP_SEARCH (object);
 
-	while ((mr = (struct _match_record *)camel_dlist_remtail (&search->matches)))
+	while ((mr = (struct _match_record *) camel_dlist_remtail (&search->matches)))
 		free_match (search, mr);
 
 	g_hash_table_destroy (search->matches_hash);
@@ -170,7 +170,7 @@ CamelFolderSearch *
 camel_imap_search_new (const gchar *cachedir)
 {
 	CamelFolderSearch *new = g_object_new (CAMEL_TYPE_IMAP_SEARCH, NULL);
-	CamelImapSearch *is = (CamelImapSearch *)new;
+	CamelImapSearch *is = (CamelImapSearch *) new;
 
 	camel_folder_search_construct (new);
 
@@ -318,7 +318,7 @@ sync_match (CamelImapSearch *is, struct _match_record *mr)
 	gchar *p, *result, *lasts = NULL;
 	CamelImapResponse *response = NULL;
 	guint32 uid;
-	CamelFolder *folder = ((CamelFolderSearch *)is)->folder;
+	CamelFolder *folder = ((CamelFolderSearch *) is)->folder;
 	CamelStore *parent_store;
 	CamelImapStore *store;
 	struct _camel_search_words *words;
@@ -396,7 +396,7 @@ get_match (CamelImapSearch *is, gint argc, struct _ESExpResult **argv)
 	mr = g_hash_table_lookup (is->matches_hash, hash);
 	if (mr == NULL) {
 		while (is->matches_count >= MATCH_CACHE_SIZE) {
-			mr = (struct _match_record *)camel_dlist_remtail (&is->matches);
+			mr = (struct _match_record *) camel_dlist_remtail (&is->matches);
 			if (mr) {
 				printf("expiring match '%s' (%s)\n", mr->hash, mr->terms[0]);
 				g_hash_table_remove (is->matches_hash, mr->hash);
@@ -410,10 +410,10 @@ get_match (CamelImapSearch *is, gint argc, struct _ESExpResult **argv)
 		g_hash_table_insert (is->matches_hash, mr->hash, mr);
 		is->matches_count++;
 	} else {
-		camel_dlist_remove ((CamelDListNode *)mr);
+		camel_dlist_remove ((CamelDListNode *) mr);
 	}
 
-	camel_dlist_addhead (&is->matches, (CamelDListNode *)mr);
+	camel_dlist_addhead (&is->matches, (CamelDListNode *) mr);
 
 	/* what about offline mode? */
 	/* We could cache those results too, or should we cache them elsewhere? */
@@ -427,7 +427,7 @@ imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Cam
 {
 	CamelStore *parent_store;
 	CamelImapStore *store;
-	CamelImapSearch *is = (CamelImapSearch *)s;
+	CamelImapSearch *is = (CamelImapSearch *) s;
 	gchar *uid;
 	ESExpResult *r;
 	GHashTable *uid_hash = NULL;
@@ -456,7 +456,7 @@ imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Cam
 			r = e_sexp_result_new (f, ESEXP_RES_ARRAY_PTR);
 			r->value.ptrarray = g_ptr_array_new ();
 			for (i = 0; i < s->summary->len; i++) {
-				g_ptr_array_add (r->value.ptrarray, (gchar *)g_ptr_array_index (s->summary, i));
+				g_ptr_array_add (r->value.ptrarray, (gchar *) g_ptr_array_index (s->summary, i));
 			}
 		}
 	} else if (argc == 0 || s->summary->len == 0) {
@@ -472,14 +472,14 @@ imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Cam
 		gint truth = FALSE;
 
 		/* setup lastuid/validity for synchronising */
-		is->lastuid = strtoul ((gchar *)g_ptr_array_index (s->summary, s->summary->len-1), NULL, 10);
+		is->lastuid = strtoul ((gchar *) g_ptr_array_index (s->summary, s->summary->len-1), NULL, 10);
 		is->validity = ((CamelImapSummary *)(s->folder->summary))->validity;
 
 		mr = get_match (is, argc, argv);
 
 		if (s->current) {
 			uidn = strtoul (camel_message_info_uid (s->current), NULL, 10);
-			uidp = (guint32 *)mr->matches->data;
+			uidp = (guint32 *) mr->matches->data;
 			j = mr->matches->len;
 			for (i=0;i<j && !truth;i++)
 				truth = *uidp++ == uidn;
@@ -493,12 +493,12 @@ imap_body_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, Cam
 			/* We use the summary's strings so we dont need to alloc more */
 			uid_hash = g_hash_table_new (NULL, NULL);
 			for (i = 0; i < s->summary->len; i++) {
-				uid = (gchar *)s->summary->pdata[i];
+				uid = (gchar *) s->summary->pdata[i];
 				uidn = strtoul (uid, NULL, 10);
 				g_hash_table_insert (uid_hash, GUINT_TO_POINTER (uidn), uid);
 			}
 
-			uidp = (guint32 *)mr->matches->data;
+			uidp = (guint32 *) mr->matches->data;
 			j = mr->matches->len;
 			for (i=0;i<j && !truth;i++) {
 				uid = g_hash_table_lookup (uid_hash, GUINT_TO_POINTER (*uidp++));
diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c
index 9be65ab..f669158 100644
--- a/camel/providers/imap/camel-imap-store-summary.c
+++ b/camel/providers/imap/camel-imap-store-summary.c
@@ -110,13 +110,13 @@ camel_imap_store_summary_full_name (CamelImapStoreSummary *s, const gchar *full_
 	gint count, i;
 	CamelImapStoreInfo *info;
 
-	count = camel_store_summary_count ((CamelStoreSummary *)s);
+	count = camel_store_summary_count ((CamelStoreSummary *) s);
 	for (i=0;i<count;i++) {
-		info = (CamelImapStoreInfo *)camel_store_summary_index ((CamelStoreSummary *)s, i);
+		info = (CamelImapStoreInfo *) camel_store_summary_index ((CamelStoreSummary *) s, i);
 		if (info) {
 			if (strcmp (info->full_name, full_name) == 0)
 				return info;
-			camel_store_summary_info_free ((CamelStoreSummary *)s, (CamelStoreInfo *)info);
+			camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
 		}
 	}
 
@@ -143,7 +143,7 @@ camel_imap_store_summary_full_to_path (CamelImapStoreSummary *s, const gchar *fu
 		}
 		*p = 0;
 	} else
-		path = (gchar *)full_name;
+		path = (gchar *) full_name;
 
 	return g_strdup (path);
 }
@@ -173,7 +173,7 @@ camel_imap_store_summary_path_to_full (CamelImapStoreSummary *s, const gchar *pa
 	subpath = alloca (strlen (path)+1);
 	strcpy (subpath, path);
 	do {
-		si = camel_store_summary_path ((CamelStoreSummary *)s, subpath);
+		si = camel_store_summary_path ((CamelStoreSummary *) s, subpath);
 		if (si == NULL) {
 			last = strrchr (subpath, '/');
 			if (last)
@@ -184,7 +184,7 @@ camel_imap_store_summary_path_to_full (CamelImapStoreSummary *s, const gchar *pa
 	/* path is already present, use the raw version we have */
 	if (si && strlen (subpath) == strlen (path)) {
 		f = g_strdup (camel_imap_store_info_full_name (s, si));
-		camel_store_summary_info_free ((CamelStoreSummary *)s, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, si);
 		return f;
 	}
 
@@ -227,7 +227,7 @@ camel_imap_store_summary_path_to_full (CamelImapStoreSummary *s, const gchar *pa
 	if (si) {
 		full = g_strdup_printf("%s%s", camel_imap_store_info_full_name(s, si), f);
 		g_free (f);
-		camel_store_summary_info_free ((CamelStoreSummary *)s, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, si);
 		f = full;
 	} else if (ns) {
 		full = g_strdup_printf("%s%s", ns->full_name, f);
@@ -257,7 +257,7 @@ camel_imap_store_summary_add_from_full (CamelImapStoreSummary *s, const gchar *f
 
 	info = camel_imap_store_summary_full_name (s, full_name);
 	if (info) {
-		camel_store_summary_info_free ((CamelStoreSummary *)s, (CamelStoreInfo *)info);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
 		d(printf("  already there\n"));
 		return info;
 	}
@@ -286,10 +286,10 @@ camel_imap_store_summary_add_from_full (CamelImapStoreSummary *s, const gchar *f
 		pathu8 = camel_imap_store_summary_full_to_path (s, full_name, dir_sep);
 	}
 
-	info = (CamelImapStoreInfo *)camel_store_summary_add_from_path ((CamelStoreSummary *)s, pathu8);
+	info = (CamelImapStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
 	if (info) {
 		d(printf("  '%s' -> '%s'\n", pathu8, full_name));
-		camel_store_info_set_string ((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAP_STORE_INFO_FULL_NAME, full_name);
+		camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_IMAP_STORE_INFO_FULL_NAME, full_name);
 
 		if (!g_ascii_strcasecmp(full_name, "inbox"))
 			info->info.flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_TYPE_INBOX;
@@ -407,7 +407,7 @@ camel_imap_store_summary_namespace_set_main (CamelImapStoreSummary *s, const gch
 		}
 	}
 
-	camel_store_summary_touch ((CamelStoreSummary *)s);
+	camel_store_summary_touch ((CamelStoreSummary *) s);
 }
 
 void
@@ -532,7 +532,7 @@ namespaces_save (CamelImapStoreSummary *s, FILE *in, CamelImapStoreNamespace *ns
 	while (ns) {
 		if (camel_file_util_encode_string (in, ns->path) == -1
 		    || camel_file_util_encode_string (in, ns->full_name) == -1
-		    || camel_file_util_encode_uint32 (in, (guint32)ns->sep) == -1)
+		    || camel_file_util_encode_uint32 (in, (guint32) ns->sep) == -1)
 			return FALSE;
 
 		ns = ns->next;
@@ -544,12 +544,12 @@ namespaces_save (CamelImapStoreSummary *s, FILE *in, CamelImapStoreNamespace *ns
 static gint
 summary_header_load (CamelStoreSummary *s, FILE *in)
 {
-	CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
+	CamelImapStoreSummary *is = (CamelImapStoreSummary *) s;
 	gint32 version, capabilities, count;
 
 	namespace_clear (is);
 
-	if (CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->summary_header_load ((CamelStoreSummary *)s, in) == -1
+	if (CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->summary_header_load ((CamelStoreSummary *) s, in) == -1
 	    || camel_file_util_decode_fixed_int32 (in, &version) == -1)
 		return -1;
 
@@ -576,7 +576,7 @@ summary_header_load (CamelStoreSummary *s, FILE *in)
 static gint
 summary_header_save (CamelStoreSummary *s, FILE *out)
 {
-	CamelImapStoreSummary *is = (CamelImapStoreSummary *)s;
+	CamelImapStoreSummary *is = (CamelImapStoreSummary *) s;
 	guint32 count = 0;
 	CamelImapStoreNamespace *ns;
 
@@ -585,7 +585,7 @@ summary_header_save (CamelStoreSummary *s, FILE *out)
 	}
 
 	/* always write as latest version */
-	if (CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->summary_header_save ((CamelStoreSummary *)s, out) == -1
+	if (CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->summary_header_save ((CamelStoreSummary *) s, out) == -1
 	    || camel_file_util_encode_fixed_int32 (out, CAMEL_IMAP_STORE_SUMMARY_VERSION) == -1
 	    || camel_file_util_encode_fixed_int32 (out, is->capabilities) == -1
 	    || camel_file_util_encode_fixed_int32 (out, count) == -1)
@@ -605,7 +605,7 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 	mi = (CamelImapStoreInfo *) CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->store_info_load (s, in);
 	if (mi) {
 		if (camel_file_util_decode_string (in, &mi->full_name) == -1) {
-			camel_store_summary_info_free (s, (CamelStoreInfo *)mi);
+			camel_store_summary_info_free (s, (CamelStoreInfo *) mi);
 			mi = NULL;
 		} else {
 			/* NB: this is done again for compatability */
@@ -614,13 +614,13 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 		}
 	}
 
-	return (CamelStoreInfo *)mi;
+	return (CamelStoreInfo *) mi;
 }
 
 static gint
 store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 {
-	CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
+	CamelImapStoreInfo *isi = (CamelImapStoreInfo *) mi;
 
 	if (CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->store_info_save (s, out, mi) == -1
 	    || camel_file_util_encode_string (out, isi->full_name) == -1)
@@ -632,7 +632,7 @@ store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 static void
 store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 {
-	CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
+	CamelImapStoreInfo *isi = (CamelImapStoreInfo *) mi;
 
 	g_free (isi->full_name);
 	CAMEL_STORE_SUMMARY_CLASS (camel_imap_store_summary_parent_class)->store_info_free (s, mi);
@@ -641,7 +641,7 @@ store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 static const gchar *
 store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 {
-	CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
+	CamelImapStoreInfo *isi = (CamelImapStoreInfo *) mi;
 
 	/* FIXME: Locks? */
 
@@ -658,7 +658,7 @@ store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 static void
 store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
 {
-	CamelImapStoreInfo *isi = (CamelImapStoreInfo *)mi;
+	CamelImapStoreInfo *isi = (CamelImapStoreInfo *) mi;
 
 	g_assert (mi != NULL);
 
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 8fdf0b7..fb9f5aa 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -206,8 +206,8 @@ imap_get_capability (CamelService *service,
 
 	if (store->summary->capabilities != store->capabilities) {
 		store->summary->capabilities = store->capabilities;
-		camel_store_summary_touch ((CamelStoreSummary *)store->summary);
-		camel_store_summary_save ((CamelStoreSummary *)store->summary);
+		camel_store_summary_touch ((CamelStoreSummary *) store->summary);
+		camel_store_summary_save ((CamelStoreSummary *) store->summary);
 	}
 
 	return TRUE;
@@ -288,12 +288,12 @@ connect_to_server (CamelService *service,
 	/* Disable Nagle - we send a lot of small requests which nagle slows down */
 	sockopt.option = CAMEL_SOCKOPT_NODELAY;
 	sockopt.value.no_delay = TRUE;
-	camel_tcp_stream_setsockopt ((CamelTcpStream *)tcp_stream, &sockopt);
+	camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
 
 	/* Set keepalive - needed for some hosts/router configurations, we're idle a lot */
 	sockopt.option = CAMEL_SOCKOPT_KEEPALIVE;
 	sockopt.value.keep_alive = TRUE;
-	camel_tcp_stream_setsockopt ((CamelTcpStream *)tcp_stream, &sockopt);
+	camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
 
 	/* Read the greeting, if any, and deal with PREAUTH */
 	if (camel_imap_store_readline (store, &buf, cancellable, error) < 0) {
@@ -550,7 +550,7 @@ connect_to_server_process (CamelService *service,
 	cmd_stream = camel_stream_process_new ();
 
 	ret = camel_stream_process_connect (CAMEL_STREAM_PROCESS (cmd_stream),
-					    full_cmd, (const gchar **)child_env);
+					    full_cmd, (const gchar **) child_env);
 
 	while (i)
 		g_free (child_env[--i]);
@@ -1088,7 +1088,7 @@ imap_store_connect_sync (CamelService *service,
 	camel_imap_store_summary_namespace_set_main (store->summary, store->users_namespace, store->dir_sep);
 
 	if ((store->parameters & IMAP_PARAM_SUBSCRIPTIONS)
-	    && camel_store_summary_count ((CamelStoreSummary *)store->summary) == 0) {
+	    && camel_store_summary_count ((CamelStoreSummary *) store->summary) == 0) {
 		CamelStoreInfo *si;
 
 		/* look in all namespaces */
@@ -1103,7 +1103,7 @@ imap_store_connect_sync (CamelService *service,
 				camel_imap_response_free (store, response);
 			}
 			if (si)
-				camel_store_summary_info_free ((CamelStoreSummary *)store->summary, si);
+				camel_store_summary_info_free ((CamelStoreSummary *) store->summary, si);
 			if (local_error != NULL)
 				goto done;
 			get_folders_sync(store, "INBOX", cancellable, &local_error);
@@ -1114,7 +1114,7 @@ imap_store_connect_sync (CamelService *service,
 
 done:
 	/* save any changes we had */
-	camel_store_summary_save ((CamelStoreSummary *)store->summary);
+	camel_store_summary_save ((CamelStoreSummary *) store->summary);
 
 	camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
 
@@ -1299,17 +1299,17 @@ imap_store_initable_init (GInitable *initable,
 	tmp = alloca (strlen (user_data_dir) + 32);
 	sprintf(tmp, "%s/.ev-store-summary", user_data_dir);
 	imap_store->summary = camel_imap_store_summary_new ();
-	camel_store_summary_set_filename ((CamelStoreSummary *)imap_store->summary, tmp);
+	camel_store_summary_set_filename ((CamelStoreSummary *) imap_store->summary, tmp);
 	summary_url = camel_url_new (imap_store->base_url, NULL);
-	camel_store_summary_set_uri_base ((CamelStoreSummary *)imap_store->summary, summary_url);
+	camel_store_summary_set_uri_base ((CamelStoreSummary *) imap_store->summary, summary_url);
 	camel_url_free (summary_url);
-	if (camel_store_summary_load ((CamelStoreSummary *)imap_store->summary) == 0) {
+	if (camel_store_summary_load ((CamelStoreSummary *) imap_store->summary) == 0) {
 		CamelImapStoreSummary *is = imap_store->summary;
 
 		if (is->namespace) {
 			/* if namespace has changed, clear folder list */
 			if (imap_store->users_namespace && strcmp (imap_store->users_namespace, is->namespace->full_name) != 0) {
-				camel_store_summary_clear ((CamelStoreSummary *)is);
+				camel_store_summary_clear ((CamelStoreSummary *) is);
 			}
 		}
 
@@ -1374,7 +1374,7 @@ camel_imap_store_init (CamelImapStore *imap_store)
 	imap_store->current_folder = NULL;
 	imap_store->connected = FALSE;
 	imap_store->preauthed = FALSE;
-	((CamelStore *)imap_store)->flags |= CAMEL_STORE_SUBSCRIPTIONS;
+	((CamelStore *) imap_store)->flags |= CAMEL_STORE_SUBSCRIPTIONS;
 
 	imap_store->tag_prefix = imap_tag_prefix++;
 	if (imap_tag_prefix > 'Z')
@@ -1435,14 +1435,14 @@ imap_folder_effectively_unsubscribed (CamelImapStore *imap_store,
 	CamelFolderInfo *fi;
 	CamelStoreInfo *si;
 
-	si = camel_store_summary_path ((CamelStoreSummary *)imap_store->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) imap_store->summary, folder_name);
 	if (si) {
 		if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
 			si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-			camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
-			camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) imap_store->summary);
+			camel_store_summary_save ((CamelStoreSummary *) imap_store->summary);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 
 	if (imap_store->renaming) {
@@ -1497,7 +1497,7 @@ imap_forget_folder (CamelImapStore *imap_store, const gchar *folder_name, GError
 	g_unlink (state_file);
 	g_free (state_file);
 
-	camel_db_delete_folder (((CamelStore *)imap_store)->cdb_w, folder_name, NULL);
+	camel_db_delete_folder (((CamelStore *) imap_store)->cdb_w, folder_name, NULL);
 	camel_imap_message_cache_delete (folder_dir, NULL);
 
 	state_file = g_strdup_printf("%s/subfolders", folder_dir);
@@ -1509,8 +1509,8 @@ imap_forget_folder (CamelImapStore *imap_store, const gchar *folder_name, GError
 
  event:
 
-	camel_store_summary_remove_path ((CamelStoreSummary *)imap_store->summary, folder_name);
-	camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
+	camel_store_summary_remove_path ((CamelStoreSummary *) imap_store->summary, folder_name);
+	camel_store_summary_save ((CamelStoreSummary *) imap_store->summary);
 
 	fi = imap_build_folder_info (imap_store, folder_name);
 	camel_store_folder_deleted (CAMEL_STORE (imap_store), fi);
@@ -1548,7 +1548,7 @@ imap_summary_is_dirty (CamelFolderSummary *summary)
 
 	max = camel_folder_summary_count (summary);
 	for (i = 0; i < max && !found; i++) {
-		info = (CamelImapMessageInfo *)camel_folder_summary_index (summary, i);
+		info = (CamelImapMessageInfo *) camel_folder_summary_index (summary, i);
 		if (info) {
 			found = info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED;
 			camel_message_info_free (info);
@@ -2055,7 +2055,7 @@ get_folder_offline (CamelStore *store, const gchar *folder_name,
 	service = CAMEL_SERVICE (store);
 	user_data_dir = camel_service_get_user_data_dir (service);
 
-	si = camel_store_summary_path ((CamelStoreSummary *)imap_store->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) imap_store->summary, folder_name);
 	if (si) {
 		gchar *folder_dir, *storage_path;
 
@@ -2075,7 +2075,7 @@ get_folder_offline (CamelStore *store, const gchar *folder_name,
 		new_folder = camel_imap_folder_new (store, folder_name, folder_dir, error);
 		g_free (folder_dir);
 
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	} else {
 		g_set_error (
 			error, CAMEL_STORE_ERROR,
@@ -2141,9 +2141,9 @@ manage_subscriptions (CamelStore *store,
 	const gchar *path;
 	gint i, count;
 
-	count = camel_store_summary_count ((CamelStoreSummary *)imap_store->summary);
+	count = camel_store_summary_count ((CamelStoreSummary *) imap_store->summary);
 	for (i=0;i<count;i++) {
-		si = camel_store_summary_index ((CamelStoreSummary *)imap_store->summary, i);
+		si = camel_store_summary_index ((CamelStoreSummary *) imap_store->summary, i);
 		if (si) {
 			path = camel_store_info_path (imap_store->summary, si);
 			if (strncmp (path, old_name, olen) == 0) {
@@ -2154,7 +2154,7 @@ manage_subscriptions (CamelStore *store,
 					imap_store_unsubscribe_folder_sync (
 						store, path, cancellable, NULL);
 			}
-			camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 		}
 	}
 }
@@ -2168,9 +2168,9 @@ rename_folder_info (CamelImapStore *imap_store, const gchar *old_name, const gch
 	const gchar *path;
 	gchar *npath, *nfull;
 
-	count = camel_store_summary_count ((CamelStoreSummary *)imap_store->summary);
+	count = camel_store_summary_count ((CamelStoreSummary *) imap_store->summary);
 	for (i=0;i<count;i++) {
-		si = camel_store_summary_index ((CamelStoreSummary *)imap_store->summary, i);
+		si = camel_store_summary_index ((CamelStoreSummary *) imap_store->summary, i);
 		if (si == NULL)
 			continue;
 		path = camel_store_info_path (imap_store->summary, si);
@@ -2191,14 +2191,14 @@ rename_folder_info (CamelImapStore *imap_store, const gchar *old_name, const gch
 					camel_imap_response_free (imap_store, response);
 			}
 
-			camel_store_info_set_string ((CamelStoreSummary *)imap_store->summary, si, CAMEL_STORE_INFO_PATH, npath);
-			camel_store_info_set_string ((CamelStoreSummary *)imap_store->summary, si, CAMEL_IMAP_STORE_INFO_FULL_NAME, nfull);
+			camel_store_info_set_string ((CamelStoreSummary *) imap_store->summary, si, CAMEL_STORE_INFO_PATH, npath);
+			camel_store_info_set_string ((CamelStoreSummary *) imap_store->summary, si, CAMEL_IMAP_STORE_INFO_FULL_NAME, nfull);
 
-			camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) imap_store->summary);
 			g_free (nfull);
 			g_free (npath);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 }
 
@@ -2440,7 +2440,7 @@ imap_store_create_folder_sync (CamelStore *store,
 		camel_imap_response_free (imap_store, response);
 
 		si = camel_imap_store_summary_add_from_full (imap_store->summary, full_name, imap_store->dir_sep);
-		camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
+		camel_store_summary_save ((CamelStoreSummary *) imap_store->summary);
 		fi = imap_build_folder_info (imap_store, camel_store_info_path (imap_store->summary, si));
 		fi->flags |= CAMEL_FOLDER_NOCHILDREN;
 		if (root) {
@@ -2486,7 +2486,7 @@ parse_list_response_as_folder_info (CamelImapStore *imap_store,
 	newflags = (si->info.flags & (CAMEL_STORE_INFO_FOLDER_SUBSCRIBED | CAMEL_STORE_INFO_FOLDER_CHECK_FOR_NEW)) | (flags & ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED);
 	if (si->info.flags != newflags) {
 		si->info.flags = newflags;
-		camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
+		camel_store_summary_touch ((CamelStoreSummary *) imap_store->summary);
 	}
 
 	flags = (flags & ~CAMEL_FOLDER_SUBSCRIBED) | (si->info.flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED);
@@ -2657,18 +2657,18 @@ get_folders_sync (CamelImapStore *imap_store,
 	/* Sync summary to match */
 
 	/* FIXME: we need to emit folder_create/subscribed/etc events for any new folders */
-	count = camel_store_summary_count ((CamelStoreSummary *)imap_store->summary);
+	count = camel_store_summary_count ((CamelStoreSummary *) imap_store->summary);
 
 	for (i=0;i<count;i++) {
 		const gchar *full_name;
 
-		si = camel_store_summary_index ((CamelStoreSummary *)imap_store->summary, i);
+		si = camel_store_summary_index ((CamelStoreSummary *) imap_store->summary, i);
 		if (si == NULL)
 			continue;
 
 		full_name = camel_imap_store_info_full_name (imap_store->summary, si);
 		if (!full_name || !*full_name) {
-			camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 			continue;
 		}
 
@@ -2676,7 +2676,7 @@ get_folders_sync (CamelImapStore *imap_store,
 			if ((fi = g_hash_table_lookup (present, camel_store_info_path (imap_store->summary, si))) != NULL) {
 				if (((fi->flags ^ si->flags) & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)) {
 					si->flags = (si->flags & ~CAMEL_FOLDER_SUBSCRIBED) | (fi->flags & CAMEL_FOLDER_SUBSCRIBED);
-					camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
+					camel_store_summary_touch ((CamelStoreSummary *) imap_store->summary);
 
 					camel_store_folder_created (CAMEL_STORE (imap_store), fi);
 					camel_store_folder_subscribed (CAMEL_STORE (imap_store), fi);
@@ -2690,14 +2690,14 @@ get_folders_sync (CamelImapStore *imap_store,
 
 					g_free (dup_folder_name);
 				} else {
-					camel_store_summary_remove ((CamelStoreSummary *)imap_store->summary, si);
+					camel_store_summary_remove ((CamelStoreSummary *) imap_store->summary, si);
 				}
 
 				count--;
 				i--;
 			}
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 fail:
 	g_hash_table_foreach (present, get_folders_free, NULL);
@@ -2745,8 +2745,8 @@ fill_fi (CamelStore *store, CamelFolderInfo *fi, guint32 flags)
 		else
 			ims = (CamelImapSummary *) camel_imap_summary_new (folder, NULL);
 
-		fi->unread = ((CamelFolderSummary *)ims)->unread_count;
-		fi->total = ((CamelFolderSummary *)ims)->saved_count;
+		fi->unread = ((CamelFolderSummary *) ims)->unread_count;
+		fi->total = ((CamelFolderSummary *) ims)->saved_count;
 
 		if (!folder->summary)
 			g_object_unref (ims);
@@ -2815,7 +2815,7 @@ imap_store_get_folder_info_sync (CamelStore *store,
 	}
 
 	if ((flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED)
-	    && camel_store_summary_count ((CamelStoreSummary *)imap_store->summary) > 0) {
+	    && camel_store_summary_count ((CamelStoreSummary *) imap_store->summary) > 0) {
 		time_t now;
 		gint ref;
 
@@ -2844,7 +2844,7 @@ imap_store_get_folder_info_sync (CamelStore *store,
 
 		camel_service_lock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
 
-		if (!camel_imap_store_connected ((CamelImapStore *)store, error))
+		if (!camel_imap_store_connected ((CamelImapStore *) store, error))
 			goto fail;
 
 		if (top[0] == 0) {
@@ -2874,7 +2874,7 @@ imap_store_get_folder_info_sync (CamelStore *store,
 			pattern[i+2] = 0;
 			get_folders_sync (imap_store, pattern, cancellable, NULL);
 		}
-		camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
+		camel_store_summary_save ((CamelStoreSummary *) imap_store->summary);
 		camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
 	}
 
@@ -2927,8 +2927,8 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 	 * the moment. So let it do the right thing by bailing out if it's
 	 * not a folder we're explicitly interested in. */
 
-	for (i=0;i<camel_store_summary_count ((CamelStoreSummary *)imap_store->summary);i++) {
-		CamelStoreInfo *si = camel_store_summary_index ((CamelStoreSummary *)imap_store->summary, i);
+	for (i=0;i<camel_store_summary_count ((CamelStoreSummary *) imap_store->summary);i++) {
+		CamelStoreInfo *si = camel_store_summary_index ((CamelStoreSummary *) imap_store->summary, i);
 		const gchar *full_name;
 
 		if (si == NULL)
@@ -2936,7 +2936,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 
 		full_name = camel_imap_store_info_full_name (imap_store->summary, si);
 		if (!full_name || !*full_name) {
-			camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 			continue;
 		}
 
@@ -2951,7 +2951,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 			|| (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)
 			|| (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST) != 0)) {
 
-			fi = imap_build_folder_info (imap_store, camel_store_info_path ((CamelStoreSummary *)imap_store->summary, si));
+			fi = imap_build_folder_info (imap_store, camel_store_info_path ((CamelStoreSummary *) imap_store->summary, si));
 			fi->unread = si->unread;
 			fi->total = si->total;
 			fi->flags = si->flags;
@@ -2978,13 +2978,13 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 			}
 
 			if (!(si->flags & CAMEL_FOLDER_NOSELECT))
-				fill_fi ((CamelStore *)imap_store, fi, 0);
+				fill_fi ((CamelStore *) imap_store, fi, 0);
 
 			if (!fi->child)
 				fi->flags |= CAMEL_FOLDER_NOCHILDREN;
 			g_ptr_array_add (folders, fi);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 	g_free (pattern);
 
@@ -3003,10 +3003,10 @@ folder_is_subscribed (CamelStore *store,
 	CamelStoreInfo *si;
 	gint truth = FALSE;
 
-	si = camel_store_summary_path ((CamelStoreSummary *)imap_store->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) imap_store->summary, folder_name);
 	if (si) {
 		truth = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 
 	return truth;
@@ -3041,14 +3041,14 @@ imap_store_subscribe_folder_sync (CamelStore *store,
 
 	camel_imap_response_free (imap_store, response);
 
-	si = camel_store_summary_path ((CamelStoreSummary *)imap_store->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) imap_store->summary, folder_name);
 	if (si) {
 		if ((si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
 			si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-			camel_store_summary_touch ((CamelStoreSummary *)imap_store->summary);
-			camel_store_summary_save ((CamelStoreSummary *)imap_store->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) imap_store->summary);
+			camel_store_summary_save ((CamelStoreSummary *) imap_store->summary);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imap_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imap_store->summary, si);
 	}
 
 	if (imap_store->renaming) {
@@ -3137,7 +3137,7 @@ camel_imap_store_connected (CamelImapStore *store, GError **error)
 
 	if (store->istream != NULL
 	    || (((camel_offline_store_get_online (CAMEL_OFFLINE_STORE (store)))
-		&& camel_service_connect_sync ((CamelService *)store, NULL)
+		&& camel_service_connect_sync ((CamelService *) store, NULL)
 		&& store->istream != NULL)))
 		return TRUE;
 
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index 1160002..6839934 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -56,7 +56,7 @@ static CamelMessageInfo *
 imap_message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 {
 	CamelImapMessageInfo *to;
-	const CamelImapMessageInfo *from = (const CamelImapMessageInfo *)mi;
+	const CamelImapMessageInfo *from = (const CamelImapMessageInfo *) mi;
 
 	to = (CamelImapMessageInfo *) CAMEL_FOLDER_SUMMARY_CLASS (camel_imap_summary_parent_class)->message_info_clone (s, mi);
 	to->server_flags = from->server_flags;
@@ -64,7 +64,7 @@ imap_message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 	/* FIXME: parent clone should do this */
 	to->info.content = camel_folder_summary_content_info_new (s);
 
-	return (CamelMessageInfo *)to;
+	return (CamelMessageInfo *) to;
 }
 
 static void
@@ -121,7 +121,7 @@ sort_uid_cmp (gpointer enc, gint len1, gpointer  data1, gint len2, gpointer data
 static gint
 uid_compare (gconstpointer va, gconstpointer vb)
 {
-	const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
+	const gchar **sa = (const gchar **) va, **sb = (const gchar **) vb;
 	gulong a, b;
 
 	a = strtoul (*sa, NULL, 10);
@@ -274,7 +274,7 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 	if (info) {
 		gchar *part = mir->bdata;
 
-		iinfo = (CamelImapMessageInfo *)info;
+		iinfo = (CamelImapMessageInfo *) info;
 		iinfo->server_flags = bdata_extract_digit (&part);
 	}
 
@@ -289,7 +289,7 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 
 	info = CAMEL_FOLDER_SUMMARY_CLASS (camel_imap_summary_parent_class)->message_info_migrate (s, in);
 	if (info) {
-		iinfo = (CamelImapMessageInfo *)info;
+		iinfo = (CamelImapMessageInfo *) info;
 
 		if (camel_file_util_decode_uint32 (in, &iinfo->server_flags) == -1)
 			goto error;
@@ -304,7 +304,7 @@ error:
 static CamelMIRecord *
 message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 {
-	CamelImapMessageInfo *iinfo = (CamelImapMessageInfo *)info;
+	CamelImapMessageInfo *iinfo = (CamelImapMessageInfo *) info;
 	struct _CamelMIRecord *mir;
 
 	mir = CAMEL_FOLDER_SUMMARY_CLASS (camel_imap_summary_parent_class)->message_info_to_db (s, info);
@@ -323,7 +323,7 @@ info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state)
 
 	/* there was a change, so do not forget to store it to server */
 	if (res)
-		((CamelImapMessageInfo *)info)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+		((CamelImapMessageInfo *) info)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
 
 	return res;
 }
@@ -394,19 +394,19 @@ camel_imap_summary_add_offline (CamelFolderSummary *summary,
 
 	flag = camel_message_info_user_flags (info);
 	while (flag) {
-		camel_message_info_set_user_flag ((CamelMessageInfo *)mi, flag->name, TRUE);
+		camel_message_info_set_user_flag ((CamelMessageInfo *) mi, flag->name, TRUE);
 		flag = flag->next;
 	}
 	tag = camel_message_info_user_tags (info);
 	while (tag) {
-		camel_message_info_set_user_tag ((CamelMessageInfo *)mi, tag->name, tag->value);
+		camel_message_info_set_user_tag ((CamelMessageInfo *) mi, tag->name, tag->value);
 		tag = tag->next;
 	}
 
 	mi->info.size = camel_message_info_size (info);
 	mi->info.uid = camel_pstring_strdup (uid);
 
-	camel_folder_summary_add (summary, (CamelMessageInfo *)mi);
+	camel_folder_summary_add (summary, (CamelMessageInfo *) mi);
 }
 
 void
@@ -419,5 +419,5 @@ camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary,
 	mi = camel_message_info_clone (info);
 	mi->info.uid = camel_pstring_strdup (uid);
 
-	camel_folder_summary_add (summary, (CamelMessageInfo *)mi);
+	camel_folder_summary_add (summary, (CamelMessageInfo *) mi);
 }
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index 0f85c81..06a2cd0 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -1280,7 +1280,7 @@ imap_uid_set_to_array (CamelFolderSummary *summary, const gchar *uids)
 	arr = g_ptr_array_new ();
 	scount = camel_folder_summary_count (summary);
 
-	p = (gchar *)uids;
+	p = (gchar *) uids;
 	si = 0;
 	do {
 		uid = strtoul (p, &q, 10);
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c
index fe8db14..aaf30bb 100644
--- a/camel/providers/imap/camel-imap-wrapper.c
+++ b/camel/providers/imap/camel-imap-wrapper.c
@@ -171,8 +171,8 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder,
 
 	imap_wrapper = g_object_new (CAMEL_TYPE_IMAP_WRAPPER, NULL);
 	camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
-	((CamelDataWrapper *)imap_wrapper)->offline = !sync_offline;
-	((CamelDataWrapper *)imap_wrapper)->encoding = encoding;
+	((CamelDataWrapper *) imap_wrapper)->offline = !sync_offline;
+	((CamelDataWrapper *) imap_wrapper)->encoding = encoding;
 
 	imap_wrapper->folder = g_object_ref (imap_folder);
 	imap_wrapper->uid = g_strdup (uid);
@@ -190,5 +190,5 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder,
 		g_object_unref (stream);
 	}
 
-	return (CamelDataWrapper *)imap_wrapper;
+	return (CamelDataWrapper *) imap_wrapper;
 }
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 65e9e22..f666498 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -64,7 +64,7 @@ camel_imapx_folder_new (CamelStore *store, const gchar *folder_dir, const gchar
 		"parent-store", store, NULL);
 	ifolder = (CamelIMAPXFolder *) folder;
 
-	((CamelIMAPXFolder *)folder)->raw_name = g_strdup (folder_name);
+	((CamelIMAPXFolder *) folder)->raw_name = g_strdup (folder_name);
 
 	summary_file = g_strdup_printf ("%s/summary", folder_dir);
 	folder->summary = camel_imapx_summary_new (folder, summary_file);
@@ -400,7 +400,7 @@ imapx_get_message_sync (CamelFolder *folder,
 
 		g_mutex_lock (ifolder->stream_lock);
 		if (!camel_data_wrapper_construct_from_stream_sync (
-			(CamelDataWrapper *)msg, stream, cancellable, error)) {
+			(CamelDataWrapper *) msg, stream, cancellable, error)) {
 			g_object_unref (msg);
 			msg = NULL;
 		}
@@ -432,7 +432,7 @@ imapx_refresh_info_sync (CamelFolder *folder,
 		return FALSE;
 	}
 
-	if (!camel_service_connect_sync ((CamelService *)istore, error))
+	if (!camel_service_connect_sync ((CamelService *) istore, error))
 		return FALSE;
 
 	server = camel_imapx_store_get_server (istore, camel_folder_get_full_name (folder), cancellable, error);
diff --git a/camel/providers/imapx/camel-imapx-provider.c b/camel/providers/imapx/camel-imapx-provider.c
index 09124ca..c47c430 100644
--- a/camel/providers/imapx/camel-imapx-provider.c
+++ b/camel/providers/imapx/camel-imapx-provider.c
@@ -155,7 +155,7 @@ imapx_add_hash (guint *hash, gchar *s)
 static guint
 imapx_url_hash (gconstpointer key)
 {
-	const CamelURL *u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *) key;
 	guint hash = 0;
 
 	imapx_add_hash (&hash, u->user);
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 1d22f28..79157e7 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -458,13 +458,13 @@ imapx_command_add_part (CamelIMAPXCommand *ic, camel_imapx_command_part_t type,
 		CamelObject *ob = o;
 
 		/* TODO: seekable streams we could just seek to the end and back */
-		null = (CamelStreamNull *)camel_stream_null_new ();
+		null = (CamelStreamNull *) camel_stream_null_new ();
 		if ( (type & CAMEL_IMAPX_COMMAND_MASK) == CAMEL_IMAPX_COMMAND_DATAWRAPPER) {
-			camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *)ob, (CamelStream *)null, NULL, NULL);
+			camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *) ob, (CamelStream *) null, NULL, NULL);
 		} else {
-			camel_stream_reset ((CamelStream *)ob, NULL);
-			camel_stream_write_to_stream ((CamelStream *)ob, (CamelStream *)null, NULL, NULL);
-			camel_stream_reset ((CamelStream *)ob, NULL);
+			camel_stream_reset ((CamelStream *) ob, NULL);
+			camel_stream_write_to_stream ((CamelStream *) ob, (CamelStream *) null, NULL, NULL);
+			camel_stream_reset ((CamelStream *) ob, NULL);
 		}
 		type |= CAMEL_IMAPX_COMMAND_LITERAL_PLUS;
 		g_object_ref (ob);
@@ -478,7 +478,7 @@ imapx_command_add_part (CamelIMAPXCommand *ic, camel_imapx_command_part_t type,
 		/* we presume we'll need to get additional data only if we're not authenticated yet */
 		g_object_ref (ob);
 		camel_stream_printf((CamelStream *)ic->mem, "%s", camel_sasl_get_mechanism (CAMEL_SASL (ob)));
-		if (!camel_sasl_get_authenticated ((CamelSasl *)ob))
+		if (!camel_sasl_get_authenticated ((CamelSasl *) ob))
 			type |= CAMEL_IMAPX_COMMAND_CONTINUATION;
 		break;
 	}
@@ -525,11 +525,11 @@ imapx_command_add_part (CamelIMAPXCommand *ic, camel_imapx_command_part_t type,
 	memcpy (cp->data, byte_array->data, cp->data_size);
 	cp->data[cp->data_size] = 0;
 
-	camel_stream_reset ((CamelStream *)ic->mem, NULL);
+	camel_stream_reset ((CamelStream *) ic->mem, NULL);
 	/* FIXME: hackish? */
 	g_byte_array_set_size (byte_array, 0);
 
-	camel_dlist_addtail (&ic->parts, (CamelDListNode *)cp);
+	camel_dlist_addtail (&ic->parts, (CamelDListNode *) cp);
 }
 
 static void
@@ -563,11 +563,11 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 		switch (c) {
 		case '%':
 			if (*p == '%') {
-				camel_stream_write ((CamelStream *)ic->mem, ps, p-ps, ic->cancellable, NULL);
+				camel_stream_write ((CamelStream *) ic->mem, ps, p-ps, ic->cancellable, NULL);
 				p++;
 				ps = p;
 			} else {
-				camel_stream_write ((CamelStream *)ic->mem, ps, p-ps-1, ic->cancellable, NULL);
+				camel_stream_write ((CamelStream *) ic->mem, ps, p-ps-1, ic->cancellable, NULL);
 				start = p-1;
 				width = 0;
 				llong = 0;
@@ -617,7 +617,7 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 					break;
 				case 't': /* token */
 					s = va_arg (ap, gchar *);
-					camel_stream_write ((CamelStream *)ic->mem, s, strlen (s), ic->cancellable, NULL);
+					camel_stream_write ((CamelStream *) ic->mem, s, strlen (s), ic->cancellable, NULL);
 					break;
 				case 's': /* simple string */
 					s = va_arg (ap, gchar *);
@@ -627,7 +627,7 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 						guchar mask = imapx_is_mask (s);
 
 						if (mask & IMAPX_TYPE_ATOM_CHAR)
-							camel_stream_write ((CamelStream *)ic->mem, s, strlen (s), ic->cancellable, NULL);
+							camel_stream_write ((CamelStream *) ic->mem, s, strlen (s), ic->cancellable, NULL);
 						else if (mask & IMAPX_TYPE_TEXT_CHAR) {
 							camel_stream_write((CamelStream *)ic->mem, "\"", 1, ic->cancellable, NULL);
 							while (*s) {
@@ -635,10 +635,10 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 
 								while (*s && imapx_is_quoted_char (*s))
 									s++;
-								camel_stream_write ((CamelStream *)ic->mem, start, s-start, ic->cancellable, NULL);
+								camel_stream_write ((CamelStream *) ic->mem, start, s-start, ic->cancellable, NULL);
 								if (*s) {
 									camel_stream_write((CamelStream *)ic->mem, "\\", 1, ic->cancellable, NULL);
-									camel_stream_write ((CamelStream *)ic->mem, s, 1, ic->cancellable, NULL);
+									camel_stream_write ((CamelStream *) ic->mem, s, 1, ic->cancellable, NULL);
 									s++;
 								}
 							}
@@ -676,12 +676,12 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 				case 'F': /* IMAP flags set */
 					f = va_arg (ap, guint32);
 					F = va_arg (ap, CamelFlag *);
-					imapx_write_flags ((CamelStream *)ic->mem, f, F, ic->cancellable, NULL);
+					imapx_write_flags ((CamelStream *) ic->mem, f, F, ic->cancellable, NULL);
 					break;
 				case 'c':
 					d = va_arg (ap, gint);
 					ch = d;
-					camel_stream_write ((CamelStream *)ic->mem, &ch, 1, ic->cancellable, NULL);
+					camel_stream_write ((CamelStream *) ic->mem, &ch, 1, ic->cancellable, NULL);
 					break;
 				case 'd': /* int/unsigned */
 				case 'u':
@@ -690,19 +690,19 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 						c(ic->is->tagprefix, "got glong '%d'\n", (gint)l);
 						memcpy (buffer, start, p-start);
 						buffer[p-start] = 0;
-						camel_stream_printf ((CamelStream *)ic->mem, buffer, l);
+						camel_stream_printf ((CamelStream *) ic->mem, buffer, l);
 					} else if (llong == 2) {
 						guint64 i64 = va_arg (ap, guint64);
 						c(ic->is->tagprefix, "got guint64 '%d'\n", (gint)i64);
 						memcpy (buffer, start, p-start);
 						buffer[p-start] = 0;
-						camel_stream_printf ((CamelStream *)ic->mem, buffer, i64);
+						camel_stream_printf ((CamelStream *) ic->mem, buffer, i64);
 					} else {
 						d = va_arg (ap, gint);
 						c(ic->is->tagprefix, "got gint '%d'\n", d);
 						memcpy (buffer, start, p-start);
 						buffer[p-start] = 0;
-						camel_stream_printf ((CamelStream *)ic->mem, buffer, d);
+						camel_stream_printf ((CamelStream *) ic->mem, buffer, d);
 					}
 					break;
 				}
@@ -714,14 +714,14 @@ imapx_command_addv (CamelIMAPXCommand *ic, const gchar *fmt, va_list ap)
 			c = *p;
 			if (c) {
 				g_assert (c == '\\');
-				camel_stream_write ((CamelStream *)ic->mem, ps, p-ps, ic->cancellable, NULL);
+				camel_stream_write ((CamelStream *) ic->mem, ps, p-ps, ic->cancellable, NULL);
 				p++;
 				ps = p;
 			}
 		}
 	}
 
-	camel_stream_write ((CamelStream *)ic->mem, ps, p-ps-1, ic->cancellable, NULL);
+	camel_stream_write ((CamelStream *) ic->mem, ps, p-ps-1, ic->cancellable, NULL);
 }
 
 CamelIMAPXCommand *
@@ -741,7 +741,7 @@ camel_imapx_command_new (CamelIMAPXServer *is,
 	ic = g_malloc0 (sizeof (*ic));
 	ic->tag = tag++;
 	ic->name = name;
-	ic->mem = (CamelStreamMem *)camel_stream_mem_new ();
+	ic->mem = (CamelStreamMem *) camel_stream_mem_new ();
 	ic->select = select;
 	ic->cancellable = cancellable;
 	ic->is = is;
@@ -782,7 +782,7 @@ camel_imapx_command_free (CamelIMAPXCommand *ic)
 		g_object_unref (ic->mem);
 	imapx_free_status (ic->status);
 
-	while ((cp = ((CamelIMAPXCommandPart *)camel_dlist_remhead (&ic->parts)))) {
+	while ((cp = ((CamelIMAPXCommandPart *) camel_dlist_remhead (&ic->parts)))) {
 		g_free (cp->data);
 		if (cp->ob) {
 			switch (cp->type & CAMEL_IMAPX_COMMAND_MASK) {
@@ -831,7 +831,7 @@ imapx_command_start (CamelIMAPXServer *imap, CamelIMAPXCommand *ic)
 	CamelIMAPXCommandPart *cp;
 
 	camel_imapx_command_close (ic);
-	cp = (CamelIMAPXCommandPart *)ic->parts.head;
+	cp = (CamelIMAPXCommandPart *) ic->parts.head;
 	g_assert (cp->next);
 	ic->current = cp;
 
@@ -841,7 +841,7 @@ imapx_command_start (CamelIMAPXServer *imap, CamelIMAPXCommand *ic)
 	if (cp->type & (CAMEL_IMAPX_COMMAND_CONTINUATION|CAMEL_IMAPX_COMMAND_LITERAL_PLUS))
 		imap->literal = ic;
 
-	camel_dlist_addtail (&imap->active, (CamelDListNode *)ic);
+	camel_dlist_addtail (&imap->active, (CamelDListNode *) ic);
 
 	g_static_rec_mutex_lock (&imap->ostream_lock);
 
@@ -853,7 +853,7 @@ imapx_command_start (CamelIMAPXServer *imap, CamelIMAPXCommand *ic)
 	err:
 		g_static_rec_mutex_unlock (&imap->ostream_lock);
 
-		camel_dlist_remove ((CamelDListNode *)ic);
+		camel_dlist_remove ((CamelDListNode *) ic);
 		if (ic && ic->complete)
 			ic->complete (imap, ic);
 		return FALSE;
@@ -920,14 +920,14 @@ imapx_command_start_next (CamelIMAPXServer *is,
 
 	if (is->select_pending) {
 		c(is->tagprefix, "-- Checking job queue for non-folder jobs\n");
-		ic = (CamelIMAPXCommand *)is->queue.head;
+		ic = (CamelIMAPXCommand *) is->queue.head;
 		nc = ic->next;
 		while (nc && is->literal == NULL && count < MAX_COMMANDS && ic->pri >= pri) {
 			c(is->tagprefix, "-- %3d '%s'?\n", (gint)ic->pri, ic->name);
 			if (!ic->select) {
 				c(is->tagprefix, "--> starting '%s'\n", ic->name);
 				pri = ic->pri;
-				camel_dlist_remove ((CamelDListNode *)ic);
+				camel_dlist_remove ((CamelDListNode *) ic);
 				imapx_command_start (is, ic);
 				count++;
 			}
@@ -962,7 +962,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 		}
 	}
 
-	ic = (CamelIMAPXCommand *)is->queue.head;
+	ic = (CamelIMAPXCommand *) is->queue.head;
 	nc = ic->next;
 	if (nc == NULL) {
 		c(is->tagprefix, "* no, no jobs\n");
@@ -973,7 +973,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 	if (is->select_folder) {
 		c(is->tagprefix, "- we're selected on '%s', current jobs?\n",
 		  camel_folder_get_full_name (is->select_folder));
-		for (ic = (CamelIMAPXCommand *)is->active.head;ic->next;ic=ic->next) {
+		for (ic = (CamelIMAPXCommand *) is->active.head;ic->next;ic=ic->next) {
 			c(is->tagprefix, "-  %3d '%s'\n", (gint)ic->pri, ic->name);
 			if (ic->pri > pri)
 				pri = ic->pri;
@@ -986,7 +986,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 
 		c(is->tagprefix, "-- Checking job queue\n");
 		count = 0;
-		ic = (CamelIMAPXCommand *)is->queue.head;
+		ic = (CamelIMAPXCommand *) is->queue.head;
 		nc = ic->next;
 		while (nc && is->literal == NULL && count < MAX_COMMANDS && ic->pri >= pri) {
 			c(is->tagprefix, "-- %3d '%s'?\n", (gint)ic->pri, ic->name);
@@ -994,7 +994,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 					    !duplicate_fetch_or_refresh (is, ic))) {
 				c(is->tagprefix, "--> starting '%s'\n", ic->name);
 				pri = ic->pri;
-				camel_dlist_remove ((CamelDListNode *)ic);
+				camel_dlist_remove ((CamelDListNode *) ic);
 				imapx_command_start (is, ic);
 				count++;
 			} else {
@@ -1010,7 +1010,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 		if (count)
 			return;
 
-		ic = (CamelIMAPXCommand *)is->queue.head;
+		ic = (CamelIMAPXCommand *) is->queue.head;
 	}
 
 	/* If we need to select a folder for the first command, do it now, once
@@ -1028,7 +1028,7 @@ imapx_command_start_next (CamelIMAPXServer *is,
 					    !duplicate_fetch_or_refresh (is, ic))) {
 				c(is->tagprefix, "* queueing job %3d '%s'\n", (gint)ic->pri, ic->name);
 				pri = ic->pri;
-				camel_dlist_remove ((CamelDListNode *)ic);
+				camel_dlist_remove ((CamelDListNode *) ic);
 				imapx_command_start (is, ic);
 				count++;
 			}
@@ -1075,9 +1075,9 @@ imapx_command_queue (CamelIMAPXServer *is,
 		return;
 	}
 
-	scan = (CamelIMAPXCommand *)is->queue.head;
+	scan = (CamelIMAPXCommand *) is->queue.head;
 	if (scan->next == NULL)
-		camel_dlist_addtail (&is->queue, (CamelDListNode *)ic);
+		camel_dlist_addtail (&is->queue, (CamelDListNode *) ic);
 	else {
 		while (scan->next) {
 			if (ic->pri >= scan->pri)
@@ -1110,7 +1110,7 @@ imapx_find_command_tag (CamelIMAPXServer *imap, guint tag)
 	if (ic && ic->tag == tag)
 		goto found;
 
-	for (ic = (CamelIMAPXCommand *)imap->active.head;ic->next;ic=ic->next)
+	for (ic = (CamelIMAPXCommand *) imap->active.head;ic->next;ic=ic->next)
 		if (ic->tag == tag)
 			goto found;
 
@@ -1155,7 +1155,7 @@ imapx_match_active_job (CamelIMAPXServer *is, guint32 type, const gchar *uid)
 
 	QUEUE_LOCK (is);
 
-	for (ic = (CamelIMAPXCommand *)is->active.head;ic->next;ic=ic->next) {
+	for (ic = (CamelIMAPXCommand *) is->active.head;ic->next;ic=ic->next) {
 		job = ic->job;
 		if (!job || !(job->type & type))
 			continue;
@@ -1202,7 +1202,7 @@ static void
 imapx_expunge_uid_from_summary (CamelIMAPXServer *imap, gchar *uid, gboolean unsolicited)
 {
 	CamelMessageInfo *mi;
-	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)imap->select_folder;
+	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) imap->select_folder;
 
 	if (unsolicited && ifolder->exists_on_server)
 		ifolder->exists_on_server--;
@@ -1543,12 +1543,12 @@ imapx_untagged (CamelIMAPXServer *imap,
 					   command completion, but update UNREAD count now according to the
 					   message SEEN flag */
 					if (!(server_flags & CAMEL_MESSAGE_SEEN)) {
-						CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)job->folder;
+						CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->folder;
 						unsigned long long uidl = strtoull (mi->uid, NULL, 10);
 
 						if (uidl >= ifolder->uidnext_on_server) {
 							c(imap->tagprefix, "Updating unread count for new message %s\n", mi->uid);
-							((CamelIMAPXFolder *)job->folder)->unread_on_server++;
+							((CamelIMAPXFolder *) job->folder)->unread_on_server++;
 						} else {
 							c(imap->tagprefix, "Not updating unread count for new message %s\n", mi->uid);
 						}
@@ -1558,7 +1558,7 @@ imapx_untagged (CamelIMAPXServer *imap,
 					binfo->size = finfo->size;
 
 					if (!camel_folder_summary_check_uid (job->folder->summary, mi->uid)) {
-						CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)job->folder;
+						CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->folder;
 						gint cnt;
 
 						camel_folder_summary_add (job->folder->summary, mi);
@@ -1621,7 +1621,7 @@ imapx_untagged (CamelIMAPXServer *imap,
 	case IMAPX_STATUS: {
 		struct _state_info *sinfo = imapx_parse_status_info (imap->stream, cancellable, error);
 		if (sinfo) {
-			CamelIMAPXStoreSummary *s = ((CamelIMAPXStore *)imap->store)->summary;
+			CamelIMAPXStoreSummary *s = ((CamelIMAPXStore *) imap->store)->summary;
 			CamelIMAPXStoreNamespace *ns;
 			CamelIMAPXFolder *ifolder = NULL;;
 
@@ -1632,7 +1632,7 @@ imapx_untagged (CamelIMAPXServer *imap,
 				path_name = camel_imapx_store_summary_full_to_path (s, sinfo->name, ns->sep);
 				c(imap->tagprefix, "Got folder path '%s' for full '%s'\n", path_name, sinfo->name);
 				if (path_name) {
-					ifolder = (gpointer)camel_store_get_folder_sync (imap->store, path_name, 0, cancellable, error);
+					ifolder = (gpointer) camel_store_get_folder_sync (imap->store, path_name, 0, cancellable, error);
 					g_free (path_name);
 				}
 			}
@@ -1796,11 +1796,11 @@ imapx_continuation (CamelIMAPXServer *imap,
 	switch (cp->type & CAMEL_IMAPX_COMMAND_MASK) {
 	case CAMEL_IMAPX_COMMAND_DATAWRAPPER:
 		c(imap->tagprefix, "writing data wrapper to literal\n");
-		camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *)cp->ob, (CamelStream *)imap->stream, cancellable, NULL);
+		camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *) cp->ob, (CamelStream *) imap->stream, cancellable, NULL);
 		break;
 	case CAMEL_IMAPX_COMMAND_STREAM:
 		c(imap->tagprefix, "writing stream to literal\n");
-		camel_stream_write_to_stream ((CamelStream *)cp->ob, (CamelStream *)imap->stream, cancellable, NULL);
+		camel_stream_write_to_stream ((CamelStream *) cp->ob, (CamelStream *) imap->stream, cancellable, NULL);
 		break;
 	case CAMEL_IMAPX_COMMAND_AUTH: {
 		gchar *resp;
@@ -1817,7 +1817,7 @@ imapx_continuation (CamelIMAPXServer *imap,
 			return -1;
 		c(imap->tagprefix, "got auth continuation, feeding token '%s' back to auth mech\n", resp);
 
-		camel_stream_write ((CamelStream *)imap->stream, resp, strlen (resp), cancellable, NULL);
+		camel_stream_write ((CamelStream *) imap->stream, resp, strlen (resp), cancellable, NULL);
 		g_free (resp);
 		/* we want to keep getting called until we get a status reponse from the server
 		   ignore what sasl tells us */
@@ -1832,14 +1832,14 @@ imapx_continuation (CamelIMAPXServer *imap,
 
 		// FIXME: errors
 		if (cp->ob && (file = camel_stream_fs_new_with_name (cp->ob, O_RDONLY, 0, NULL))) {
-			camel_stream_write_to_stream (file, (CamelStream *)imap->stream, cancellable, NULL);
+			camel_stream_write_to_stream (file, (CamelStream *) imap->stream, cancellable, NULL);
 			g_object_unref (file);
 		} else if (cp->ob_size > 0) {
 			// Server is expecting data ... ummm, send it zeros?  abort?
 		}
 		break; }
 	case CAMEL_IMAPX_COMMAND_STRING:
-		camel_stream_write ((CamelStream *)imap->stream, cp->ob, cp->ob_size, cancellable, NULL);
+		camel_stream_write ((CamelStream *) imap->stream, cp->ob, cp->ob_size, cancellable, NULL);
 		break;
 	default:
 		/* should we just ignore? */
@@ -1897,7 +1897,7 @@ imapx_completion (CamelIMAPXServer *imap,
 		return -1;
 	}
 
-	tag = strtoul ( (const gchar *)token+1, NULL, 10);
+	tag = strtoul ( (const gchar *) token+1, NULL, 10);
 
 	if ((ic = imapx_find_command_tag (imap, tag)) == NULL) {
 		g_set_error (
@@ -1932,8 +1932,8 @@ imapx_completion (CamelIMAPXServer *imap,
 
 	QUEUE_LOCK (imap);
 
-	camel_dlist_remove ((CamelDListNode *)ic);
-	camel_dlist_addtail (&imap->done, (CamelDListNode *)ic);
+	camel_dlist_remove ((CamelDListNode *) ic);
+	camel_dlist_addtail (&imap->done, (CamelDListNode *) ic);
 	if (imap->literal == ic)
 		imap->literal = NULL;
 
@@ -2006,7 +2006,7 @@ imapx_command_run (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 		is->literal = NULL;
 
 	QUEUE_LOCK (is);
-	camel_dlist_remove ((CamelDListNode *)ic);
+	camel_dlist_remove ((CamelDListNode *) ic);
 	QUEUE_UNLOCK (is);
 
 	return (ic->error == NULL);
@@ -2055,7 +2055,7 @@ static void
 imapx_job_done (CamelIMAPXServer *is, CamelIMAPXJob *job)
 {
 	QUEUE_LOCK (is);
-	camel_dlist_remove ((CamelDListNode *)job);
+	camel_dlist_remove ((CamelDListNode *) job);
 	QUEUE_UNLOCK (is);
 
 	if (job->noreply) {
@@ -2072,7 +2072,7 @@ imapx_register_job (CamelIMAPXServer *is,
 {
 	if (is->state >= IMAPX_INITIALISED) {
 		QUEUE_LOCK (is);
-		camel_dlist_addhead (&is->jobs, (CamelDListNode *)job);
+		camel_dlist_addhead (&is->jobs, (CamelDListNode *) job);
 		QUEUE_UNLOCK (is);
 
 	} else {
@@ -2108,7 +2108,7 @@ imapx_run_job (CamelIMAPXServer *is,
 		completed = camel_msgport_pop (reply);
 		camel_msgport_destroy (reply);
 
-		g_assert (completed == (CamelMsg *)job);
+		g_assert (completed == (CamelMsg *) job);
 	}
 
 	if (job->error != NULL) {
@@ -2193,7 +2193,7 @@ imapx_job_idle_start (CamelIMAPXServer *is,
 	ic->complete = imapx_command_idle_done;
 
 	camel_imapx_command_close (ic);
-	cp = (CamelIMAPXCommandPart *)ic->parts.head;
+	cp = (CamelIMAPXCommandPart *) ic->parts.head;
 	cp->type |= CAMEL_IMAPX_COMMAND_CONTINUATION;
 
 	QUEUE_LOCK (is);
@@ -2283,7 +2283,7 @@ imapx_idle_thread (gpointer data)
 			}
 			IDLE_UNLOCK (is->idle);
 
-			camel_imapx_server_idle (is, (gpointer)ifolder, is->cancellable, &local_error);
+			camel_imapx_server_idle (is, (gpointer) ifolder, is->cancellable, &local_error);
 
 			if (local_error == NULL && ifolder->exists_on_server >
 			    camel_folder_summary_count (((CamelFolder *) ifolder)->summary) && imapx_is_command_queue_empty (is))
@@ -2443,7 +2443,7 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 		camel_dlist_init (&failed);
 
 		QUEUE_LOCK (is);
-		cw = (CamelIMAPXCommand *)is->queue.head;
+		cw = (CamelIMAPXCommand *) is->queue.head;
 		cn = cw->next;
 
 		if (is->select_pending) {
@@ -2451,8 +2451,8 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 				if (cw->select && cw->select == is->select_pending) {
 					c(is->tagprefix, "Cancelling command '%s'(%p) for folder '%s'\n",
 					  cw->name, cw, camel_folder_get_full_name (cw->select));
-					camel_dlist_remove ((CamelDListNode *)cw);
-					camel_dlist_addtail (&failed, (CamelDListNode *)cw);
+					camel_dlist_remove ((CamelDListNode *) cw);
+					camel_dlist_addtail (&failed, (CamelDListNode *) cw);
 				}
 				cw = cn;
 				cn = cn->next;
@@ -2461,7 +2461,7 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 
 		QUEUE_UNLOCK (is);
 
-		cw = (CamelIMAPXCommand *)failed.head;
+		cw = (CamelIMAPXCommand *) failed.head;
 		if (cw) {
 			cn = cw->next;
 			while (cn) {
@@ -2510,14 +2510,14 @@ imapx_command_select_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 		selected_folder = camel_folder_get_full_name (is->select_folder);
 #if 0
 		/* This must trigger a complete index rebuild! */
-		if (is->uidvalidity && is->uidvalidity != ((CamelIMAPXSummary *)is->select_folder->summary)->uidvalidity)
+		if (is->uidvalidity && is->uidvalidity != ((CamelIMAPXSummary *) is->select_folder->summary)->uidvalidity)
 			g_warning("uidvalidity doesn't match!");
 
 		/* This should trigger a new messages scan */
 		if (is->exists != is->select_folder->summary->root_view->total_count)
 			g_warning("exists is %d our summary is %d and summary exists is %d\n", is->exists,
 				  is->select_folder->summary->root_view->total_count,
-				  ((CamelIMAPXSummary *)is->select_folder->summary)->exists);
+				  ((CamelIMAPXSummary *) is->select_folder->summary)->exists);
 #endif
 	}
 
@@ -2584,8 +2584,8 @@ imapx_select (CamelIMAPXServer *is,
 	ic = camel_imapx_command_new(is, "SELECT", NULL, cancellable, "SELECT %f", folder);
 
 	if (is->use_qresync) {
-		CamelIMAPXSummary *isum = (CamelIMAPXSummary *)folder->summary;
-		CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)folder;
+		CamelIMAPXSummary *isum = (CamelIMAPXSummary *) folder->summary;
+		CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) folder;
 		gint total = camel_folder_summary_count (folder->summary);
 		gchar *firstuid, *lastuid;
 
@@ -2742,7 +2742,7 @@ connect_to_server_process (CamelIMAPXServer *is, const gchar *cmd, GError **erro
 	cmd_stream = camel_stream_process_new ();
 
 	ret = camel_stream_process_connect (CAMEL_STREAM_PROCESS (cmd_stream),
-					    full_cmd, (const gchar **)child_env);
+					    full_cmd, (const gchar **) child_env);
 
 	while (i)
 		g_free (child_env[--i]);
@@ -2859,12 +2859,12 @@ imapx_connect_to_server (CamelIMAPXServer *is,
 	/* Disable Nagle - we send a lot of small requests which nagle slows down */
 	sockopt.option = CAMEL_SOCKOPT_NODELAY;
 	sockopt.value.no_delay = TRUE;
-	camel_tcp_stream_setsockopt ((CamelTcpStream *)tcp_stream, &sockopt);
+	camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
 
 	/* Set keepalive - needed for some hosts/router configurations, we're idle a lot */
 	sockopt.option = CAMEL_SOCKOPT_KEEPALIVE;
 	sockopt.value.keep_alive = TRUE;
-	camel_tcp_stream_setsockopt ((CamelTcpStream *)tcp_stream, &sockopt);
+	camel_tcp_stream_setsockopt ((CamelTcpStream *) tcp_stream, &sockopt);
 
  connected:
 	is->stream->tagprefix = is->tagprefix;
@@ -3094,7 +3094,7 @@ imapx_reconnect (CamelIMAPXServer *is,
 
 			auth_domain = camel_url_get_param (url, "auth-domain");
 			url->passwd = camel_session_get_password (
-				is->session, (CamelService *)is->store,
+				is->session, (CamelService *) is->store,
 				auth_domain, full_prompt, "password",
 				prompt_flags, error);
 
@@ -3177,7 +3177,7 @@ imapx_reconnect (CamelIMAPXServer *is,
 	is->state = IMAPX_AUTHENTICATED;
 
  preauthed:
-	if (((CamelIMAPXStore *)is->store)->rec_options & IMAPX_USE_IDLE)
+	if (((CamelIMAPXStore *) is->store)->rec_options & IMAPX_USE_IDLE)
 		is->use_idle = TRUE;
 	else
 		is->use_idle = FALSE;
@@ -3200,7 +3200,7 @@ imapx_reconnect (CamelIMAPXServer *is,
 		camel_imapx_command_free (ic);
 	}
 
-	if (((CamelIMAPXStore *)is->store)->rec_options & IMAPX_USE_QRESYNC &&
+	if (((CamelIMAPXStore *) is->store)->rec_options & IMAPX_USE_QRESYNC &&
 	    is->cinfo->capa & IMAPX_CAPABILITY_QRESYNC) {
 		ic = camel_imapx_command_new (
 			is, "ENABLE", NULL, cancellable,
@@ -3523,8 +3523,8 @@ imapx_command_append_message_done (CamelIMAPXServer *is,
 				/* should we update the message count ? */
 				camel_folder_summary_add (job->folder->summary, mi);
 				imapx_set_message_info_flags_for_new_message (mi,
-									      ((CamelMessageInfoBase *)job->u.append_message.info)->flags,
-									      ((CamelMessageInfoBase *)job->u.append_message.info)->user_flags,
+									      ((CamelMessageInfoBase *) job->u.append_message.info)->flags,
+									      ((CamelMessageInfoBase *) job->u.append_message.info)->user_flags,
 									      job->folder);
 				changes = camel_folder_change_info_new ();
 				camel_folder_change_info_add_uid (changes, mi->uid);
@@ -3567,8 +3567,8 @@ imapx_job_append_message_start (CamelIMAPXServer *is,
 	ic = camel_imapx_command_new (
 		is, "APPEND", NULL, job->cancellable,
 		"APPEND %f %F %P", job->folder,
-		((CamelMessageInfoBase *)job->u.append_message.info)->flags,
-		((CamelMessageInfoBase *)job->u.append_message.info)->user_flags,
+		((CamelMessageInfoBase *) job->u.append_message.info)->flags,
+		((CamelMessageInfoBase *) job->u.append_message.info)->user_flags,
 		job->u.append_message.path);
 	ic->complete = imapx_command_append_message_done;
 	ic->job = job;
@@ -3584,8 +3584,8 @@ imapx_refresh_info_uid_cmp (gconstpointer ap, gconstpointer bp)
 {
 	guint av, bv;
 
-	av = g_ascii_strtoull ((const gchar *)ap, NULL, 10);
-	bv = g_ascii_strtoull ((const gchar *)bp, NULL, 10);
+	av = g_ascii_strtoull ((const gchar *) ap, NULL, 10);
+	bv = g_ascii_strtoull ((const gchar *) bp, NULL, 10);
 
 	if (av<bv)
 		return -1;
@@ -3645,8 +3645,8 @@ static void
 imapx_command_step_fetch_done (CamelIMAPXServer *is,
                                CamelIMAPXCommand *ic)
 {
-	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)ic->job->folder;
-	CamelIMAPXSummary *isum = (CamelIMAPXSummary *)ic->job->folder->summary;
+	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) ic->job->folder;
+	CamelIMAPXSummary *isum = (CamelIMAPXSummary *) ic->job->folder->summary;
 	CamelIMAPXJob *job = ic->job;
 	gint i = job->u.refresh_info.index;
 	GArray *infos = job->u.refresh_info.infos;
@@ -3773,7 +3773,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 		CamelMessageInfo *s_minfo = NULL;
 		CamelIMAPXMessageInfo *info;
 		CamelFolderSummary *s = job->folder->summary;
-		CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)job->folder;
+		CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->folder;
 		GSList *removed = NULL, *l;
 		gboolean fetch_new = FALSE;
 		gint i;
@@ -3782,8 +3782,8 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 
 		/* Actually we wanted to do this after the SELECT but before the
 		   FETCH command was issued. But this should suffice. */
-		((CamelIMAPXSummary *)s)->uidnext = ifolder->uidnext_on_server;
-		((CamelIMAPXSummary *)s)->modseq = ifolder->modseq_on_server;
+		((CamelIMAPXSummary *) s)->uidnext = ifolder->uidnext_on_server;
+		((CamelIMAPXSummary *) s)->modseq = ifolder->modseq_on_server;
 
 		/* Here we do the typical sort/iterate/merge loop.
 		   If the server flags dont match what we had, we modify our
@@ -3821,7 +3821,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 
 			info = NULL;
 			if (s_minfo && uid_cmp (s_minfo->uid, r->uid, s) == 0) {
-				info = (CamelIMAPXMessageInfo *)s_minfo;
+				info = (CamelIMAPXMessageInfo *) s_minfo;
 
 				if (imapx_update_message_info_flags ((CamelMessageInfo *) info, r->server_flags, r->server_user_flags, job->folder, FALSE))
 					camel_folder_change_info_change_uid (job->u.refresh_info.changes, camel_message_info_uid (s_minfo));
@@ -3923,7 +3923,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 
 	/* There's no sane way to get the server-side unseen count on the
 	   select mailbox. So just work it out from the flags */
-	((CamelIMAPXFolder *)job->folder)->unread_on_server = job->folder->summary->unread_count;
+	((CamelIMAPXFolder *) job->folder)->unread_on_server = job->folder->summary->unread_count;
 
 	g_array_free (job->u.refresh_info.infos, TRUE);
 	imapx_job_done (is, job);
@@ -3955,8 +3955,8 @@ static void
 imapx_command_fetch_new_messages_done (CamelIMAPXServer *is,
                                        CamelIMAPXCommand *ic)
 {
-	CamelIMAPXSummary *isum = (CamelIMAPXSummary *)ic->job->folder->summary;
-	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)ic->job->folder;
+	CamelIMAPXSummary *isum = (CamelIMAPXSummary *) ic->job->folder->summary;
+	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) ic->job->folder;
 
 	if (ic->error != NULL || ic->status->result != IMAPX_OK) {
 		if (ic->error == NULL)
@@ -4055,7 +4055,7 @@ imapx_job_refresh_info_start (CamelIMAPXServer *is,
 {
 	guint32 total;
 	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) job->folder;
-	CamelIMAPXSummary *isum = (CamelIMAPXSummary *)job->folder->summary;
+	CamelIMAPXSummary *isum = (CamelIMAPXSummary *) job->folder->summary;
 	CamelFolder *folder = job->folder;
 	const gchar *full_name;
 	gboolean need_rescan = FALSE;
@@ -4162,7 +4162,7 @@ imapx_job_refresh_info_start (CamelIMAPXServer *is,
 	e(is->tagprefix, "folder %s is %sselected, total %u / %u, unread %u / %u, modseq %llu / %llu, uidnext %u / %u: will %srescan\n",
 	  full_name, is_selected?"": "not ", total, ifolder->exists_on_server,
 	  folder->summary->unread_count, ifolder->unread_on_server,
-	  (unsigned long long)isum->modseq, (unsigned long long)ifolder->modseq_on_server,
+	  (unsigned long long) isum->modseq, (unsigned long long) ifolder->modseq_on_server,
 	  isum->uidnext, ifolder->uidnext_on_server,
 	  need_rescan?"":"not ");
 
@@ -4653,7 +4653,7 @@ imapx_command_sync_changes_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 			if (!xinfo)
 				continue;
 
-			xinfo->server_flags = ((CamelMessageInfoBase *)xinfo)->flags & CAMEL_IMAPX_SERVER_FLAGS;
+			xinfo->server_flags = ((CamelMessageInfoBase *) xinfo)->flags & CAMEL_IMAPX_SERVER_FLAGS;
 			xinfo->info.flags &= ~CAMEL_MESSAGE_FOLDER_FLAGGED;
 			xinfo->info.dirty = TRUE;
 			camel_flag_list_copy (&xinfo->server_user_flags, &xinfo->info.user_flags);
@@ -4663,7 +4663,7 @@ imapx_command_sync_changes_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
 		}
 		/* Apply the changes to server-side unread count; it won't tell
 		   us of these changes, of course. */
-		((CamelIMAPXFolder *)job->folder)->unread_on_server += job->u.sync_changes.unread_change;
+		((CamelIMAPXFolder *) job->folder)->unread_on_server += job->u.sync_changes.unread_change;
 	}
 
 	if (job->commands == 0) {
@@ -4713,7 +4713,7 @@ imapx_job_sync_changes_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
 			c(is->tagprefix, "checking/storing %s flags '%s'\n", on?"on":"off", flags_table[j].name);
 			imapx_uidset_init (&ss, 0, 100);
 			for (i = 0; i < uids->len; i++) {
-				CamelIMAPXMessageInfo *info = (CamelIMAPXMessageInfo *)camel_folder_summary_uid
+				CamelIMAPXMessageInfo *info = (CamelIMAPXMessageInfo *) camel_folder_summary_uid
 										(job->folder->summary, uids->pdata[i]);
 				guint32 flags;
 				guint32 sflags;
@@ -4722,7 +4722,7 @@ imapx_job_sync_changes_start (CamelIMAPXServer *is, CamelIMAPXJob *job)
 				if (!info)
 					continue;
 
-				flags = ((CamelMessageInfoBase *)info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
+				flags = ((CamelMessageInfoBase *) info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
 				sflags = info->server_flags & CAMEL_IMAPX_SERVER_FLAGS;
 				send = 0;
 
@@ -4811,7 +4811,7 @@ cancel_all_jobs (CamelIMAPXServer *is, GError *error)
 
 		while ((*cw)->next) {
 			ic = *cw;
-			camel_dlist_remove ((CamelDListNode *)ic);
+			camel_dlist_remove ((CamelDListNode *) ic);
 			QUEUE_UNLOCK (is);
 
 			ic->error = g_error_copy (error);
@@ -4871,7 +4871,7 @@ imapx_parser_thread (gpointer d)
 			GPollFD fds[2] = { {0, 0, 0}, {0, 0, 0} };
 			gint res;
 
-			fds[0].fd = ((CamelStreamProcess *)is->stream->source)->sockfd;
+			fds[0].fd = ((CamelStreamProcess *) is->stream->source)->sockfd;
 			fds[0].events = G_IO_IN;
 			fds[1].fd = g_cancellable_get_fd (cancellable);
 			fds[1].events = G_IO_IN;
@@ -5252,7 +5252,7 @@ imapx_server_get_message (CamelIMAPXServer *is,
 	job->type = IMAPX_JOB_GET_MESSAGE;
 	job->start = imapx_job_get_message_start;
 	job->folder = folder;
-	job->u.get_message.uid = (gchar *)uid;
+	job->u.get_message.uid = (gchar *) uid;
 	job->u.get_message.stream = tmp_stream;
 
 	if (((CamelMessageInfoBase *) mi)->size > MULTI_SIZE)
@@ -5393,9 +5393,9 @@ camel_imapx_server_append_message (CamelIMAPXServer *is,
 	filter = camel_stream_filter_new (stream);
 	g_object_unref (stream);
 	canon = camel_mime_filter_canon_new (CAMEL_MIME_FILTER_CANON_CRLF);
-	camel_stream_filter_add ((CamelStreamFilter *)filter, canon);
+	camel_stream_filter_add ((CamelStreamFilter *) filter, canon);
 	res = camel_data_wrapper_write_to_stream_sync (
-		(CamelDataWrapper *)message, filter, cancellable, error);
+		(CamelDataWrapper *) message, filter, cancellable, error);
 	g_object_unref (canon);
 	g_object_unref (filter);
 
@@ -5407,7 +5407,7 @@ camel_imapx_server_append_message (CamelIMAPXServer *is,
 	}
 
 	tmp = camel_data_cache_get_filename (ifolder->cache, "new", uid, NULL);
-	info = camel_folder_summary_info_new_from_message ((CamelFolderSummary *)folder->summary, message, NULL);
+	info = camel_folder_summary_info_new_from_message ((CamelFolderSummary *) folder->summary, message, NULL);
 	info->uid = camel_pstring_strdup (uid);
 	if (mi)
 		((CamelMessageInfoBase *) info)->flags = ((CamelMessageInfoBase *) mi)->flags;
@@ -5576,14 +5576,14 @@ imapx_server_sync_changes (CamelIMAPXServer *is,
 			continue;
 		}
 
-		flags = ((CamelMessageInfoBase *)info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
+		flags = ((CamelMessageInfoBase *) info)->flags & CAMEL_IMAPX_SERVER_FLAGS;
 		sflags = info->server_flags & CAMEL_IMAPX_SERVER_FLAGS;
 		if (flags != sflags) {
 			off_orset |= ( flags ^ sflags ) & ~flags;
 			on_orset |= (flags ^ sflags) & flags;
 		}
 
-		uflags = ((CamelMessageInfoBase *)info)->user_flags;
+		uflags = ((CamelMessageInfoBase *) info)->user_flags;
 		suflags = info->server_user_flags;
 		while (uflags || suflags) {
 			gint res;
@@ -5765,8 +5765,8 @@ imapx_list_flatten (gpointer k, gpointer v, gpointer d)
 static gint
 imapx_list_cmp (gconstpointer ap, gconstpointer bp)
 {
-	struct _list_info *a = ((struct _list_info **)ap)[0];
-	struct _list_info *b = ((struct _list_info **)bp)[0];
+	struct _list_info *a = ((struct _list_info **) ap)[0];
+	struct _list_info *b = ((struct _list_info **) bp)[0];
 
 	return strcmp (a->name, b->name);
 }
diff --git a/camel/providers/imapx/camel-imapx-store-summary.c b/camel/providers/imapx/camel-imapx-store-summary.c
index 7f13f97..e733d73 100644
--- a/camel/providers/imapx/camel-imapx-store-summary.c
+++ b/camel/providers/imapx/camel-imapx-store-summary.c
@@ -86,7 +86,7 @@ camel_imapx_store_summary_class_init (CamelIMAPXStoreSummaryClass *class)
 static void
 camel_imapx_store_summary_init (CamelIMAPXStoreSummary *s)
 {
-	((CamelStoreSummary *)s)->store_info_size = sizeof (CamelIMAPXStoreInfo);
+	((CamelStoreSummary *) s)->store_info_size = sizeof (CamelIMAPXStoreInfo);
 	s->version = CAMEL_IMAPX_STORE_SUMMARY_VERSION;
 }
 
@@ -123,13 +123,13 @@ camel_imapx_store_summary_full_name (CamelIMAPXStoreSummary *s, const gchar *ful
 	gint count, i;
 	CamelIMAPXStoreInfo *info;
 
-	count = camel_store_summary_count ((CamelStoreSummary *)s);
+	count = camel_store_summary_count ((CamelStoreSummary *) s);
 	for (i=0;i<count;i++) {
-		info = (CamelIMAPXStoreInfo *)camel_store_summary_index ((CamelStoreSummary *)s, i);
+		info = (CamelIMAPXStoreInfo *) camel_store_summary_index ((CamelStoreSummary *) s, i);
 		if (info) {
 			if (strcmp (info->full_name, full_name) == 0)
 				return info;
-			camel_store_summary_info_free ((CamelStoreSummary *)s, (CamelStoreInfo *)info);
+			camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
 		}
 	}
 
@@ -168,7 +168,7 @@ camel_imapx_store_summary_path_to_full (CamelIMAPXStoreSummary *s, const gchar *
 	subpath = alloca (strlen (path)+1);
 	strcpy (subpath, path);
 	do {
-		si = camel_store_summary_path ((CamelStoreSummary *)s, subpath);
+		si = camel_store_summary_path ((CamelStoreSummary *) s, subpath);
 		if (si == NULL) {
 			last = strrchr (subpath, '/');
 			if (last)
@@ -179,7 +179,7 @@ camel_imapx_store_summary_path_to_full (CamelIMAPXStoreSummary *s, const gchar *
 	/* path is already present, use the raw version we have */
 	if (si && strlen (subpath) == strlen (path)) {
 		f = g_strdup (camel_imapx_store_info_full_name (s, si));
-		camel_store_summary_info_free ((CamelStoreSummary *)s, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, si);
 		return f;
 	}
 
@@ -208,7 +208,7 @@ camel_imapx_store_summary_path_to_full (CamelIMAPXStoreSummary *s, const gchar *
 	if (si) {
 		full = g_strdup_printf("%s%s", camel_imapx_store_info_full_name(s, si), f);
 		g_free (f);
-		camel_store_summary_info_free ((CamelStoreSummary *)s, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, si);
 		f = full;
 	} else if (ns) {
 		full = g_strdup_printf("%s%s", ns->full_name, f);
@@ -238,7 +238,7 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s, const gchar
 
 	info = camel_imapx_store_summary_full_name (s, full_name);
 	if (info) {
-		camel_store_summary_info_free ((CamelStoreSummary *)s, (CamelStoreInfo *)info);
+		camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
 		d("  already there\n");
 		return info;
 	}
@@ -267,10 +267,10 @@ camel_imapx_store_summary_add_from_full (CamelIMAPXStoreSummary *s, const gchar
 		pathu8 = camel_imapx_store_summary_full_to_path (s, full_name, dir_sep);
 	}
 
-	info = (CamelIMAPXStoreInfo *)camel_store_summary_add_from_path ((CamelStoreSummary *)s, pathu8);
+	info = (CamelIMAPXStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
 	if (info) {
 		d("  '%s' -> '%s'\n", pathu8, full_name);
-		camel_store_info_set_string ((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_IMAPX_STORE_INFO_FULL_NAME, full_name);
+		camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_IMAPX_STORE_INFO_FULL_NAME, full_name);
 
 		if (!g_ascii_strcasecmp(full_name, "inbox"))
 			info->info.flags |= CAMEL_FOLDER_SYSTEM|CAMEL_FOLDER_TYPE_INBOX;
@@ -332,7 +332,7 @@ void camel_imapx_store_summary_namespace_set (CamelIMAPXStoreSummary *s, CamelIM
 	d("Setting namesapce to '%s' '%c' -> '%s'\n", ns->full_name, ns->sep, ns->path);
 
 	/* CHEN not needed  */
-	camel_store_summary_touch ((CamelStoreSummary *)s);
+	camel_store_summary_touch ((CamelStoreSummary *) s);
 }
 
 CamelIMAPXStoreNamespace *
@@ -491,14 +491,14 @@ namespace_save (CamelStoreSummary *s, FILE *out, CamelIMAPXNamespaceList *nsl)
 static gint
 summary_header_load (CamelStoreSummary *s, FILE *in)
 {
-	CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *)s;
+	CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *) s;
 	CamelStoreSummaryClass *store_summary_class;
 	gint32 version, capabilities;
 
 	camel_imapx_namespace_list_clear (is->namespaces);
 
 	store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
-	if (store_summary_class->summary_header_load ((CamelStoreSummary *)s, in) == -1
+	if (store_summary_class->summary_header_load ((CamelStoreSummary *) s, in) == -1
 	    || camel_file_util_decode_fixed_int32 (in, &version) == -1)
 		return -1;
 
@@ -525,12 +525,12 @@ summary_header_load (CamelStoreSummary *s, FILE *in)
 static gint
 summary_header_save (CamelStoreSummary *s, FILE *out)
 {
-	CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *)s;
+	CamelIMAPXStoreSummary *is = (CamelIMAPXStoreSummary *) s;
 	CamelStoreSummaryClass *store_summary_class;
 
 	/* always write as latest version */
 	store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
-	if (store_summary_class->summary_header_save ((CamelStoreSummary *)s, out) == -1
+	if (store_summary_class->summary_header_save ((CamelStoreSummary *) s, out) == -1
 	    || camel_file_util_encode_fixed_int32 (out, CAMEL_IMAPX_STORE_SUMMARY_VERSION) == -1
 	    || camel_file_util_encode_fixed_int32 (out, is->capabilities) == -1)
 		return -1;
@@ -548,10 +548,10 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 	CamelStoreSummaryClass *store_summary_class;
 
 	store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
-	mi = (CamelIMAPXStoreInfo *)store_summary_class->store_info_load (s, in);
+	mi = (CamelIMAPXStoreInfo *) store_summary_class->store_info_load (s, in);
 	if (mi) {
 		if (camel_file_util_decode_string (in, &mi->full_name) == -1) {
-			camel_store_summary_info_free (s, (CamelStoreInfo *)mi);
+			camel_store_summary_info_free (s, (CamelStoreInfo *) mi);
 			mi = NULL;
 		} else {
 			/* NB: this is done again for compatability */
@@ -560,13 +560,13 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 		}
 	}
 
-	return (CamelStoreInfo *)mi;
+	return (CamelStoreInfo *) mi;
 }
 
 static gint
 store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 {
-	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *) mi;
 	CamelStoreSummaryClass *store_summary_class;
 
 	store_summary_class = CAMEL_STORE_SUMMARY_CLASS (camel_imapx_store_summary_parent_class);
@@ -580,7 +580,7 @@ store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 static void
 store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 {
-	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *) mi;
 	CamelStoreSummaryClass *store_summary_class;
 
 	g_free (isi->full_name);
@@ -592,7 +592,7 @@ store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 static const gchar *
 store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 {
-	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *) mi;
 	CamelStoreSummaryClass *store_summary_class;
 
 	/* FIXME: Locks? */
@@ -612,7 +612,7 @@ store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 static void
 store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
 {
-	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *)mi;
+	CamelIMAPXStoreInfo *isi = (CamelIMAPXStoreInfo *) mi;
 	CamelStoreSummaryClass *store_summary_class;
 
 	g_assert (mi != NULL);
diff --git a/camel/providers/imapx/camel-imapx-store-summary.h b/camel/providers/imapx/camel-imapx-store-summary.h
index ed4b2ca..485e13e 100644
--- a/camel/providers/imapx/camel-imapx-store-summary.h
+++ b/camel/providers/imapx/camel-imapx-store-summary.h
@@ -142,7 +142,7 @@ void		camel_imapx_store_summary_set_namespaces
 /* helpe macro's */
 #define camel_imapx_store_info_full_name(s, i) \
 	(camel_store_info_string ( \
-		(CamelStoreSummary *)s, (const CamelStoreInfo *)i, \
+		(CamelStoreSummary *) s, (const CamelStoreInfo *) i, \
 		CAMEL_IMAPX_STORE_INFO_FULL_NAME))
 
 G_END_DECLS
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index 3929871..1e2b290 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -134,7 +134,7 @@ imapx_store_finalize (GObject *object)
 	/* SIGH */
 
 	camel_service_disconnect_sync (
-		(CamelService *)imapx_store, TRUE, NULL);
+		(CamelService *) imapx_store, TRUE, NULL);
 	if (imapx_store->con_man) {
 		g_object_unref (imapx_store->con_man);
 		imapx_store->con_man = NULL;
@@ -201,7 +201,7 @@ imapx_connect_sync (CamelService *service,
                     GCancellable *cancellable,
                     GError **error)
 {
-	CamelIMAPXStore *istore = (CamelIMAPXStore *)service;
+	CamelIMAPXStore *istore = (CamelIMAPXStore *) service;
 	CamelIMAPXServer *server;
 
 	server = camel_imapx_store_get_server (istore, NULL, cancellable, error);
@@ -262,7 +262,7 @@ imapx_query_auth_types_sync (CamelService *service,
 	camel_service_lock (service, CAMEL_SERVICE_REC_CONNECT_LOCK);
 
 	url = camel_service_get_camel_url (service);
-	server = camel_imapx_server_new ((CamelStore *)istore, url);
+	server = camel_imapx_server_new ((CamelStore *) istore, url);
 
 	connected = server->stream != NULL;
 	if (!connected)
@@ -300,7 +300,7 @@ get_folder_offline (CamelStore *store, const gchar *folder_name,
 	service = CAMEL_SERVICE (store);
 	user_data_dir = camel_service_get_user_data_dir (service);
 
-	si = camel_store_summary_path ((CamelStoreSummary *)imapx_store->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) imapx_store->summary, folder_name);
 	if (si) {
 		gchar *folder_dir, *storage_path;
 
@@ -321,7 +321,7 @@ get_folder_offline (CamelStore *store, const gchar *folder_name,
 		new_folder = camel_imapx_folder_new (store, folder_dir, folder_name, error);
 
 		g_free (folder_dir);
-		camel_store_summary_info_free ((CamelStoreSummary *)imapx_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imapx_store->summary, si);
 	} else {
 		g_set_error (
 			error, CAMEL_STORE_ERROR,
@@ -380,8 +380,8 @@ fill_fi (CamelStore *store, CamelFolderInfo *fi, guint32 flags)
 		else
 			ims = (CamelIMAPXSummary *) camel_imapx_summary_new (folder, NULL);
 
-		fi->unread = ((CamelFolderSummary *)ims)->unread_count;
-		fi->total = ((CamelFolderSummary *)ims)->saved_count;
+		fi->unread = ((CamelFolderSummary *) ims)->unread_count;
+		fi->total = ((CamelFolderSummary *) ims)->saved_count;
 
 		if (!folder->summary)
 			g_object_unref (ims);
@@ -451,14 +451,14 @@ imapx_unmark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_nam
 {
 	CamelStoreInfo *si;
 
-	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) istore->summary, folder_name);
 	if (si) {
 		if (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) {
 			si->flags &= ~CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-			camel_store_summary_touch ((CamelStoreSummary *)istore->summary);
-			camel_store_summary_save ((CamelStoreSummary *)istore->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) istore->summary);
+			camel_store_summary_save ((CamelStoreSummary *) istore->summary);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 	}
 
 	if (emit_signal) {
@@ -475,14 +475,14 @@ imapx_mark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_name,
 {
 	CamelStoreInfo *si;
 
-	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) istore->summary, folder_name);
 	if (si) {
 		if ((si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) == 0) {
 			si->flags |= CAMEL_STORE_INFO_FOLDER_SUBSCRIBED;
-			camel_store_summary_touch ((CamelStoreSummary *)istore->summary);
-			camel_store_summary_save ((CamelStoreSummary *)istore->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) istore->summary);
+			camel_store_summary_save ((CamelStoreSummary *) istore->summary);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 	}
 
 	if (emit_signal) {
@@ -575,7 +575,7 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
 	g_unlink (state_file);
 	g_free (state_file);
 
-	camel_db_delete_folder (((CamelStore *)istore)->cdb_w, folder_name, NULL);
+	camel_db_delete_folder (((CamelStore *) istore)->cdb_w, folder_name, NULL);
 	g_rmdir (folder_dir);
 
 	state_file = g_strdup_printf("%s/subfolders", folder_dir);
@@ -586,8 +586,8 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
 	g_free (folder_dir);
 
  event:
-	camel_store_summary_remove_path ((CamelStoreSummary *)istore->summary, folder_name);
-	camel_store_summary_save ((CamelStoreSummary *)istore->summary);
+	camel_store_summary_remove_path ((CamelStoreSummary *) istore->summary, folder_name);
+	camel_store_summary_save ((CamelStoreSummary *) istore->summary);
 
 	fi = imapx_build_folder_info (istore, folder_name);
 	camel_store_folder_deleted (CAMEL_STORE (istore), fi);
@@ -603,9 +603,9 @@ rename_folder_info (CamelIMAPXStore *istore, const gchar *old_name, const gchar
 	const gchar *path;
 	gchar *npath, *nfull;
 
-	count = camel_store_summary_count ((CamelStoreSummary *)istore->summary);
+	count = camel_store_summary_count ((CamelStoreSummary *) istore->summary);
 	for (i=0;i<count;i++) {
-		si = camel_store_summary_index ((CamelStoreSummary *)istore->summary, i);
+		si = camel_store_summary_index ((CamelStoreSummary *) istore->summary, i);
 		if (si == NULL)
 			continue;
 		path = camel_store_info_path (istore->summary, si);
@@ -616,14 +616,14 @@ rename_folder_info (CamelIMAPXStore *istore, const gchar *old_name, const gchar
 				npath = g_strdup (new_name);
 			nfull = camel_imapx_store_summary_path_to_full (istore->summary, npath, istore->dir_sep);
 
-			camel_store_info_set_string ((CamelStoreSummary *)istore->summary, si, CAMEL_STORE_INFO_PATH, npath);
-			camel_store_info_set_string ((CamelStoreSummary *)istore->summary, si, CAMEL_IMAPX_STORE_INFO_FULL_NAME, nfull);
+			camel_store_info_set_string ((CamelStoreSummary *) istore->summary, si, CAMEL_STORE_INFO_PATH, npath);
+			camel_store_info_set_string ((CamelStoreSummary *) istore->summary, si, CAMEL_IMAPX_STORE_INFO_FULL_NAME, nfull);
 
-			camel_store_summary_touch ((CamelStoreSummary *)istore->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) istore->summary);
 			g_free (nfull);
 			g_free (npath);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 	}
 }
 
@@ -667,8 +667,8 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 	 * the moment. So let it do the right thing by bailing out if it's
 	 * not a folder we're explicitly interested in. */
 
-	for (i=0;i<camel_store_summary_count ((CamelStoreSummary *)imapx_store->summary);i++) {
-		CamelStoreInfo *si = camel_store_summary_index ((CamelStoreSummary *)imapx_store->summary, i);
+	for (i=0;i<camel_store_summary_count ((CamelStoreSummary *) imapx_store->summary);i++) {
+		CamelStoreInfo *si = camel_store_summary_index ((CamelStoreSummary *) imapx_store->summary, i);
 		const gchar *full_name;
 		CamelIMAPXStoreNamespace *ns;
 
@@ -677,7 +677,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 
 		full_name = camel_imapx_store_info_full_name (imapx_store->summary, si);
 		if (!full_name || !*full_name) {
-			camel_store_summary_info_free ((CamelStoreSummary *)imapx_store->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) imapx_store->summary, si);
 			continue;
 		}
 
@@ -692,7 +692,7 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 			|| (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)
 			|| (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIPTION_LIST) != 0)) {
 
-			fi = imapx_build_folder_info (imapx_store, camel_store_info_path ((CamelStoreSummary *)imapx_store->summary, si));
+			fi = imapx_build_folder_info (imapx_store, camel_store_info_path ((CamelStoreSummary *) imapx_store->summary, si));
 			fi->unread = si->unread;
 			fi->total = si->total;
 			fi->flags = si->flags;
@@ -709,13 +709,13 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
 			}
 
 			if (!(si->flags & CAMEL_FOLDER_NOSELECT))
-				fill_fi ((CamelStore *)imapx_store, fi, 0);
+				fill_fi ((CamelStore *) imapx_store, fi, 0);
 
 			if (!fi->child)
 				fi->flags |= CAMEL_FOLDER_NOCHILDREN;
 			g_ptr_array_add (folders, fi);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)imapx_store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) imapx_store->summary, si);
 	}
 	g_free (pattern);
 
@@ -947,7 +947,7 @@ sync_folders (CamelIMAPXStore *istore,
 
 		full_name = camel_imapx_store_info_full_name (istore->summary, si);
 		if (!full_name || !*full_name) {
-			camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 			continue;
 		}
 
@@ -955,7 +955,7 @@ sync_folders (CamelIMAPXStore *istore,
 			if ((fi = g_hash_table_lookup (folders_from_server, camel_store_info_path (istore->summary, si))) != NULL) {
 				if (((fi->flags ^ si->flags) & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED)) {
 					si->flags = (si->flags & ~CAMEL_FOLDER_SUBSCRIBED) | (fi->flags & CAMEL_FOLDER_SUBSCRIBED);
-					camel_store_summary_touch ((CamelStoreSummary *)istore->summary);
+					camel_store_summary_touch ((CamelStoreSummary *) istore->summary);
 
 					camel_store_folder_created (CAMEL_STORE (istore), fi);
 					camel_store_folder_subscribed (CAMEL_STORE (istore), fi);
@@ -968,14 +968,14 @@ sync_folders (CamelIMAPXStore *istore,
 					imapx_delete_folder_from_cache (istore, dup_folder_name);
 					g_free (dup_folder_name);
 				} else {
-					camel_store_summary_remove ((CamelStoreSummary *)istore->summary, si);
+					camel_store_summary_remove ((CamelStoreSummary *) istore->summary, si);
 				}
 
 				total--;
 				i--;
 			}
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 	}
 
 	g_hash_table_foreach (folders_from_server, imapx_get_folders_free, NULL);
@@ -1007,7 +1007,7 @@ discover_inbox (CamelStore *store,
                 GCancellable *cancellable)
 {
 	CamelStoreInfo *si;
-	CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
+	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
 
 	si = camel_store_summary_path((CamelStoreSummary *) istore->summary, "INBOX");
 	if (si == NULL || (si->flags & CAMEL_FOLDER_SUBSCRIBED) == 0) {
@@ -1067,10 +1067,10 @@ imapx_folder_is_subscribed (CamelStore *store,
 	CamelStoreInfo *si;
 	gint is_subscribed = FALSE;
 
-	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, folder_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) istore->summary, folder_name);
 	if (si) {
 		is_subscribed = (si->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0;
-		camel_store_summary_info_free ((CamelStoreSummary *)istore->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) istore->summary, si);
 	}
 
 	return is_subscribed;
@@ -1104,7 +1104,7 @@ imapx_store_get_folder_info_sync (CamelStore *store,
                                   GCancellable *cancellable,
                                   GError **error)
 {
-	CamelIMAPXStore *istore = (CamelIMAPXStore *)store;
+	CamelIMAPXStore *istore = (CamelIMAPXStore *) store;
 	CamelFolderInfo * fi= NULL;
 	CamelSession *session;
 	gboolean initial_setup = FALSE;
@@ -1145,7 +1145,7 @@ imapx_store_get_folder_info_sync (CamelStore *store,
 		return fi;
 	}
 
-	if (!camel_service_connect_sync ((CamelService *)store, error)) {
+	if (!camel_service_connect_sync ((CamelService *) store, error)) {
 		g_mutex_unlock (istore->get_finfo_lock);
 		return NULL;
 	}
@@ -1310,7 +1310,7 @@ imapx_store_create_folder_sync (CamelStore *store,
 		return NULL;
 	}
 
-	si = camel_store_summary_path ((CamelStoreSummary *)istore->summary, parent_name);
+	si = camel_store_summary_path ((CamelStoreSummary *) istore->summary, parent_name);
 	if (si && si->flags & CAMEL_STORE_INFO_FOLDER_NOINFERIORS) {
 		g_set_error (
 			error, CAMEL_FOLDER_ERROR,
@@ -1335,7 +1335,7 @@ imapx_store_create_folder_sync (CamelStore *store,
 		CamelIMAPXStoreInfo *si;
 
 		si = camel_imapx_store_summary_add_from_full (istore->summary, full_name, dir_sep);
-		camel_store_summary_save ((CamelStoreSummary *)istore->summary);
+		camel_store_summary_save ((CamelStoreSummary *) istore->summary);
 		fi = imapx_build_folder_info (istore, camel_store_info_path (istore->summary, si));
 		fi->flags |= CAMEL_FOLDER_NOCHILDREN;
 		camel_store_folder_created (store, fi);
@@ -1522,11 +1522,11 @@ imapx_store_initable_init (GInitable *initable,
 	store->summary = camel_imapx_store_summary_new ();
 
 	summary = g_build_filename (user_data_dir, ".ev-store-summary", NULL);
-	camel_store_summary_set_filename ((CamelStoreSummary *)store->summary, summary);
+	camel_store_summary_set_filename ((CamelStoreSummary *) store->summary, summary);
 	/* FIXME: need to remove params, passwords, etc */
 	camel_store_summary_set_uri_base (
-		(CamelStoreSummary *)store->summary, url);
-	camel_store_summary_load ((CamelStoreSummary *)store->summary);
+		(CamelStoreSummary *) store->summary, url);
+	camel_store_summary_load ((CamelStoreSummary *) store->summary);
 
 	g_free (summary);
 
diff --git a/camel/providers/imapx/camel-imapx-stream.c b/camel/providers/imapx/camel-imapx-stream.c
index c87a88f..99852f2 100644
--- a/camel/providers/imapx/camel-imapx-stream.c
+++ b/camel/providers/imapx/camel-imapx-stream.c
@@ -113,7 +113,7 @@ imapx_stream_read (CamelStream *stream,
                    GCancellable *cancellable,
                    GError **error)
 {
-	CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
+	CamelIMAPXStream *is = (CamelIMAPXStream *) stream;
 	gssize max;
 
 	if (is->literal == 0 || n == 0)
@@ -146,7 +146,7 @@ imapx_stream_write (CamelStream *stream,
                     GCancellable *cancellable,
                     GError **error)
 {
-	CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
+	CamelIMAPXStream *is = (CamelIMAPXStream *) stream;
 
 	io(is->tagprefix, "camel_imapx_write: '%.*s'\n", (gint)n, buffer);
 
@@ -174,7 +174,7 @@ imapx_stream_flush (CamelStream *stream,
 static gboolean
 imapx_stream_eos (CamelStream *stream)
 {
-	CamelIMAPXStream *is = (CamelIMAPXStream *)stream;
+	CamelIMAPXStream *is = (CamelIMAPXStream *) stream;
 
 	return is->literal == 0;
 }
@@ -257,7 +257,7 @@ camel_imapx_stream_new (CamelStream *source)
 	is = g_object_new (CAMEL_TYPE_IMAPX_STREAM, NULL);
 	is->source = g_object_ref (source);
 
-	return (CamelStream *)is;
+	return (CamelStream *) is;
 }
 
 GQuark
@@ -459,14 +459,14 @@ camel_imapx_stream_nstring_stream (CamelIMAPXStream *is,
 
 	switch (camel_imapx_stream_token (is, &token, &len, cancellable, &local_error)) {
 		case IMAPX_TOK_STRING:
-			mem = camel_stream_mem_new_with_buffer ((gchar *)token, len);
+			mem = camel_stream_mem_new_with_buffer ((gchar *) token, len);
 			*stream = mem;
 			break;
 		case IMAPX_TOK_LITERAL:
 			/* if len is big, we could automatically use a file backing */
 			camel_imapx_stream_set_literal (is, len);
 			mem = camel_stream_mem_new ();
-			if (camel_stream_write_to_stream ((CamelStream *)is, mem, cancellable, error) == -1) {
+			if (camel_stream_write_to_stream ((CamelStream *) is, mem, cancellable, error) == -1) {
 				g_object_unref (mem);
 				ret = -1;
 				break;
@@ -507,7 +507,7 @@ camel_imapx_stream_number (CamelIMAPXStream *is,
 		return 0;
 	}
 
-	return strtoull ((gchar *)token, 0, 10);
+	return strtoull ((gchar *) token, 0, 10);
 }
 
 gint
diff --git a/camel/providers/imapx/camel-imapx-summary.c b/camel/providers/imapx/camel-imapx-summary.c
index a71d2b3..0a97ed6 100644
--- a/camel/providers/imapx/camel-imapx-summary.c
+++ b/camel/providers/imapx/camel-imapx-summary.c
@@ -56,7 +56,7 @@ imapx_message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 {
 	CamelIMAPXMessageInfo *to;
 	CamelFolderSummaryClass *folder_summary_class;
-	const CamelIMAPXMessageInfo *from = (const CamelIMAPXMessageInfo *)mi;
+	const CamelIMAPXMessageInfo *from = (const CamelIMAPXMessageInfo *) mi;
 
 	folder_summary_class = CAMEL_FOLDER_SUMMARY_CLASS (
 		camel_imapx_summary_parent_class);
@@ -68,7 +68,7 @@ imapx_message_info_clone (CamelFolderSummary *s, const CamelMessageInfo *mi)
 	/* FIXME: parent clone should do this */
 	to->info.content = camel_folder_summary_content_info_new (s);
 
-	return (CamelMessageInfo *)to;
+	return (CamelMessageInfo *) to;
 }
 
 static void
@@ -125,7 +125,7 @@ sort_uid_cmp (gpointer enc, gint len1, gpointer  data1, gint len2, gpointer data
 static gint
 uid_compare (gconstpointer va, gconstpointer vb)
 {
-	const gchar **sa = (const gchar **)va, **sb = (const gchar **)vb;
+	const gchar **sa = (const gchar **) va, **sb = (const gchar **) vb;
 	gulong a, b;
 
 	a = strtoul (*sa, NULL, 10);
@@ -279,8 +279,8 @@ summary_header_to_db (CamelFolderSummary *s, GError **error)
 	if (!fir)
 		return NULL;
 	fir->bdata = g_strdup_printf ("%d %llu %u %llu", CAMEL_IMAPX_SUMMARY_VERSION,
-				      (unsigned long long)ims->validity, ims->uidnext,
-				      (unsigned long long)ims->modseq);
+				      (unsigned long long) ims->validity, ims->uidnext,
+				      (unsigned long long) ims->modseq);
 	return fir;
 }
 
@@ -305,7 +305,7 @@ message_info_from_db (CamelFolderSummary *s, CamelMIRecord *mir)
 	if (info) {
 		gchar *part = mir->bdata;
 
-		iinfo = (CamelIMAPXMessageInfo *)info;
+		iinfo = (CamelIMAPXMessageInfo *) info;
 		iinfo->server_flags = bdata_extract_digit (&part);
 	}
 
@@ -324,7 +324,7 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 
 	info = folder_summary_class->message_info_migrate (s, in);
 	if (info) {
-		iinfo = (CamelIMAPXMessageInfo *)info;
+		iinfo = (CamelIMAPXMessageInfo *) info;
 
 		if (camel_file_util_decode_uint32 (in, &iinfo->server_flags) == -1)
 			goto error;
@@ -339,7 +339,7 @@ error:
 static CamelMIRecord *
 message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 {
-	CamelIMAPXMessageInfo *iinfo = (CamelIMAPXMessageInfo *)info;
+	CamelIMAPXMessageInfo *iinfo = (CamelIMAPXMessageInfo *) info;
 	CamelFolderSummaryClass *folder_summary_class;
 	struct _CamelMIRecord *mir;
 
@@ -366,7 +366,7 @@ info_set_user_flag (CamelMessageInfo *info, const gchar *id, gboolean state)
 
 	/* there was a change, so do not forget to store it to server */
 	if (res)
-		((CamelIMAPXMessageInfo *)info)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+		((CamelIMAPXMessageInfo *) info)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
 
 	return res;
 }
@@ -441,26 +441,26 @@ camel_imapx_summary_add_offline (CamelFolderSummary *summary, const gchar *uid,
 	const CamelTag *tag;
 
 	/* Create summary entry */
-	mi = (CamelIMAPXMessageInfo *)camel_folder_summary_info_new_from_message (summary, message, NULL);
+	mi = (CamelIMAPXMessageInfo *) camel_folder_summary_info_new_from_message (summary, message, NULL);
 
 	/* Copy flags 'n' tags */
 	mi->info.flags = camel_message_info_flags (info);
 
 	flag = camel_message_info_user_flags (info);
 	while (flag) {
-		camel_message_info_set_user_flag ((CamelMessageInfo *)mi, flag->name, TRUE);
+		camel_message_info_set_user_flag ((CamelMessageInfo *) mi, flag->name, TRUE);
 		flag = flag->next;
 	}
 	tag = camel_message_info_user_tags (info);
 	while (tag) {
-		camel_message_info_set_user_tag ((CamelMessageInfo *)mi, tag->name, tag->value);
+		camel_message_info_set_user_tag ((CamelMessageInfo *) mi, tag->name, tag->value);
 		tag = tag->next;
 	}
 
 	mi->info.size = camel_message_info_size (info);
 	mi->info.uid = camel_pstring_strdup (uid);
 
-	camel_folder_summary_add (summary, (CamelMessageInfo *)mi);
+	camel_folder_summary_add (summary, (CamelMessageInfo *) mi);
 }
 
 void
@@ -472,5 +472,5 @@ camel_imapx_summary_add_offline_uncached (CamelFolderSummary *summary, const gch
 	mi = camel_message_info_clone (info);
 	mi->info.uid = camel_pstring_strdup (uid);
 
-	camel_folder_summary_add (summary, (CamelMessageInfo *)mi);
+	camel_folder_summary_add (summary, (CamelMessageInfo *) mi);
 }
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index 303cacf..226bf1d 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -255,7 +255,7 @@ gboolean
 imapx_update_message_info_flags (CamelMessageInfo *info, guint32 server_flags, CamelFlag *server_user_flags, CamelFolder *folder, gboolean unsolicited)
 {
 	gboolean changed = FALSE;
-	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)folder;
+	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) folder;
 	CamelIMAPXMessageInfo *xinfo = (CamelIMAPXMessageInfo *) info;
 
 	if (server_flags != xinfo->server_flags)
@@ -364,7 +364,7 @@ void
 imapx_update_summary_for_removed_message (CamelMessageInfo *info, CamelFolder *folder, gboolean unsolicited)
 {
 	CamelMessageInfoBase *dinfo = (CamelMessageInfoBase *) info;
-	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *)folder;
+	CamelIMAPXFolder *ifolder = (CamelIMAPXFolder *) folder;
 	gint unread=0, deleted=0, junk=0;
 	guint32 flags;
 
@@ -483,7 +483,7 @@ imapx_parse_capability (CamelIMAPXStream *stream,
 					*p++ = toupper(c);
 				if (!strncmp ((gchar *) token, "AUTH=", 5)) {
 					g_hash_table_insert (cinfo->auth_types,
-							g_strdup ((gchar *)token + 5),
+							g_strdup ((gchar *) token + 5),
 							GINT_TO_POINTER (1));
 					break;
 				}
@@ -1054,7 +1054,7 @@ imapx_parse_envelope (CamelIMAPXStream *is,
 
 	p(is->tagprefix, "envelope\n");
 
-	minfo = (CamelMessageInfoBase *)camel_message_info_new (NULL);
+	minfo = (CamelMessageInfoBase *) camel_message_info_new (NULL);
 
 	tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
 	if (tok != '(') {
@@ -1149,7 +1149,7 @@ imapx_parse_envelope (CamelIMAPXStream *is,
 	if (local_error != NULL)
 		g_propagate_error (error, local_error);
 
-	return (CamelMessageInfo *)minfo;
+	return (CamelMessageInfo *) minfo;
 }
 
 struct _CamelMessageContentInfo *
@@ -1245,7 +1245,7 @@ imapx_parse_body (CamelIMAPXStream *is,
 			/* what do we do with the envelope?? */
 			minfo = imapx_parse_envelope (is, cancellable, &local_error);
 			/* what do we do with the message content info?? */
-			//((CamelMessageInfoBase *)minfo)->content = imapx_parse_body (is);
+			//((CamelMessageInfoBase *) minfo)->content = imapx_parse_body (is);
 			camel_message_info_free (minfo);
 			minfo = NULL;
 			d(is->tagprefix, "Scanned envelope - what do i do with it?\n");
@@ -1607,7 +1607,7 @@ imapx_parse_status_info (CamelIMAPXStream *is,
 		g_free (sinfo);
 		return NULL;
 	}
-	sinfo->name = camel_utf7_utf8 ((gchar *)token);
+	sinfo->name = camel_utf7_utf8 ((gchar *) token);
 
 	tok = camel_imapx_stream_token (is, &token, &len, cancellable, NULL);
 	if (tok != '(') {
diff --git a/camel/providers/imapx/camel-imapx-view-summary.c b/camel/providers/imapx/camel-imapx-view-summary.c
index 33f34e4..3208718 100644
--- a/camel/providers/imapx/camel-imapx-view-summary.c
+++ b/camel/providers/imapx/camel-imapx-view-summary.c
@@ -45,7 +45,7 @@ static CamelViewSummaryDiskClass *cmvs_parent;
 CamelIMAPXViewSummary *
 camel_imapx_view_summary_new (const gchar *base, GError **error)
 {
-	return (CamelIMAPXViewSummary *)camel_view_summary_disk_construct (camel_object_new (camel_imapx_view_summary_get_type ()), base, ex);
+	return (CamelIMAPXViewSummary *) camel_view_summary_disk_construct (camel_object_new (camel_imapx_view_summary_get_type ()), base, ex);
 }
 
 /* NB: must have write lock on folder */
@@ -55,7 +55,7 @@ guint32 camel_imapx_view_next_uid (CamelIMAPXView *view)
 	guint32 uid;
 
 	uid = view->nextuid++;
-	camel_view_changed ((CamelView *)view);
+	camel_view_changed ((CamelView *) view);
 
 	return uid;
 #endif
@@ -68,7 +68,7 @@ void camel_imapx_view_last_uid (CamelIMAPXView *view, guint32 uid)
 	uid++;
 	if (uid > view->nextuid) {
 		view->nextuid = uid;
-		camel_view_changed ((CamelView *)view);
+		camel_view_changed ((CamelView *) view);
 	}
 #endif
 }
@@ -78,18 +78,18 @@ imapx_view_decode (CamelViewSummaryDisk *s, CamelView *view, CamelRecordDecoder
 {
 	gint tag, ver;
 
-	((CamelViewSummaryDiskClass *)cmvs_parent)->decode (s, view, crd);
+	((CamelViewSummaryDiskClass *) cmvs_parent)->decode (s, view, crd);
 
 	if (strchr (view->vid, 1) == NULL) {
 		camel_record_decoder_reset (crd);
 		while ((tag = camel_record_decoder_next_section (crd, &ver)) != CR_SECTION_INVALID) {
 			switch (tag) {
 			case CVS_IMAPX_SECTION_VIEWINFO:
-				((CamelIMAPXView *)view)->uidvalidity = camel_record_decoder_int32 (crd);
-				((CamelIMAPXView *)view)->permanentflags = camel_record_decoder_int32 (crd);
-				((CamelIMAPXView *)view)->exists = camel_record_decoder_int32 (crd);
-				((CamelIMAPXView *)view)->separator = camel_record_decoder_int8 (crd);
-				((CamelIMAPXView *)view)->raw_name = g_strdup (camel_record_decoder_string (crd));
+				((CamelIMAPXView *) view)->uidvalidity = camel_record_decoder_int32 (crd);
+				((CamelIMAPXView *) view)->permanentflags = camel_record_decoder_int32 (crd);
+				((CamelIMAPXView *) view)->exists = camel_record_decoder_int32 (crd);
+				((CamelIMAPXView *) view)->separator = camel_record_decoder_int8 (crd);
+				((CamelIMAPXView *) view)->raw_name = g_strdup (camel_record_decoder_string (crd));
 				break;
 			}
 		}
@@ -101,17 +101,17 @@ imapx_view_decode (CamelViewSummaryDisk *s, CamelView *view, CamelRecordDecoder
 static void
 imapx_view_encode (CamelViewSummaryDisk *s, CamelView *view, CamelRecordEncoder *cre)
 {
-	((CamelViewSummaryDiskClass *)cmvs_parent)->encode (s, view, cre);
+	((CamelViewSummaryDiskClass *) cmvs_parent)->encode (s, view, cre);
 
 	/* We only store extra data on the root view */
 
 	if (strchr (view->vid, 1) == NULL) {
 		camel_record_encoder_start_section (cre, CVS_IMAPX_SECTION_VIEWINFO, 0);
-		camel_record_encoder_int32 (cre, ((CamelIMAPXView *)view)->uidvalidity);
-		camel_record_encoder_int32 (cre, ((CamelIMAPXView *)view)->permanentflags);
-		camel_record_encoder_int32 (cre, ((CamelIMAPXView *)view)->exists);
-		camel_record_encoder_int8 (cre, ((CamelIMAPXView *)view)->separator);
-		camel_record_encoder_string (cre, ((CamelIMAPXView *)view)->raw_name);
+		camel_record_encoder_int32 (cre, ((CamelIMAPXView *) view)->uidvalidity);
+		camel_record_encoder_int32 (cre, ((CamelIMAPXView *) view)->permanentflags);
+		camel_record_encoder_int32 (cre, ((CamelIMAPXView *) view)->exists);
+		camel_record_encoder_int8 (cre, ((CamelIMAPXView *) view)->separator);
+		camel_record_encoder_string (cre, ((CamelIMAPXView *) view)->raw_name);
 		camel_record_encoder_end_section (cre);
 	}
 }
@@ -119,7 +119,7 @@ imapx_view_encode (CamelViewSummaryDisk *s, CamelView *view, CamelRecordEncoder
 static void
 camel_imapx_view_summary_init (CamelIMAPXViewSummary *obj)
 {
-	struct _CamelFolderSummary *s = (CamelFolderSummary *)obj;
+	struct _CamelFolderSummary *s = (CamelFolderSummary *) obj;
 
 	s = s;
 }
@@ -133,10 +133,10 @@ camel_imapx_view_summary_finalize (CamelObject *obj)
 static void
 camel_imapx_view_summary_class_init (CamelIMAPXViewSummaryClass *klass)
 {
-	((CamelViewSummaryClass *)klass)->view_sizeof = sizeof (CamelIMAPXView);
+	((CamelViewSummaryClass *) klass)->view_sizeof = sizeof (CamelIMAPXView);
 
-	((CamelViewSummaryDiskClass *)klass)->encode = imapx_view_encode;
-	((CamelViewSummaryDiskClass *)klass)->decode = imapx_view_decode;
+	((CamelViewSummaryDiskClass *) klass)->encode = imapx_view_encode;
+	((CamelViewSummaryDiskClass *) klass)->decode = imapx_view_decode;
 }
 
 CamelType
@@ -145,7 +145,7 @@ camel_imapx_view_summary_get_type (void)
 	static CamelType type = CAMEL_INVALID_TYPE;
 
 	if (type == CAMEL_INVALID_TYPE) {
-		cmvs_parent = (CamelViewSummaryDiskClass *)camel_view_summary_disk_get_type ();
+		cmvs_parent = (CamelViewSummaryDiskClass *) camel_view_summary_disk_get_type ();
 		type = camel_type_register((CamelType)cmvs_parent, "CamelIMAPXViewSummary",
 					   sizeof (CamelIMAPXViewSummary),
 					   sizeof (CamelIMAPXViewSummaryClass),
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 71f3770..08d9035 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -278,7 +278,7 @@ local_folder_search_free (CamelFolder *folder,
 static void
 local_folder_delete (CamelFolder *folder)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 
 	if (lf->index)
 		camel_index_delete (lf->index);
@@ -290,7 +290,7 @@ static void
 local_folder_rename (CamelFolder *folder,
                      const gchar *newname)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	gchar *statepath;
 	CamelLocalStore *ls;
 	CamelStore *parent_store;
@@ -315,8 +315,8 @@ local_folder_rename (CamelFolder *folder,
 
 	/* FIXME: Poke some internals, sigh */
 	camel_folder_summary_set_filename (folder->summary, lf->summary_path);
-	g_free (((CamelLocalSummary *)folder->summary)->folder_path);
-	((CamelLocalSummary *)folder->summary)->folder_path = g_strdup (lf->folder_path);
+	g_free (((CamelLocalSummary *) folder->summary)->folder_path);
+	((CamelLocalSummary *) folder->summary)->folder_path = g_strdup (lf->folder_path);
 
 	CAMEL_FOLDER_CLASS (camel_local_folder_parent_class)->rename (folder, newname);
 }
@@ -369,10 +369,10 @@ local_folder_refresh_info_sync (CamelFolder *folder,
                                 GCancellable *cancellable,
                                 GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 
 	if (lf->need_summary_check &&
-	    camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, cancellable, error) == -1)
+	    camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error) == -1)
 		return FALSE;
 
 	if (camel_folder_change_info_changed (lf->changes)) {
@@ -401,7 +401,7 @@ local_folder_synchronize_sync (CamelFolder *folder,
 
 	/* if sync fails, we'll pass it up on exit through ex */
 	success = (camel_local_summary_sync (
-		(CamelLocalSummary *)folder->summary,
+		(CamelLocalSummary *) folder->summary,
 		expunge, lf->changes, cancellable, error) == 0);
 	camel_local_folder_unlock (lf);
 
@@ -592,7 +592,7 @@ camel_local_folder_construct (CamelLocalFolder *lf,
 		if (forceindex)
 			flag |= O_TRUNC;
 
-		lf->index = (CamelIndex *)camel_text_index_new (lf->index_path, flag);
+		lf->index = (CamelIndex *) camel_text_index_new (lf->index_path, flag);
 		if (lf->index == NULL) {
 			/* yes, this isn't fatal at all */
 			g_warning("Could not open/create index file: %s: indexing not performed", g_strerror (errno));
@@ -607,13 +607,13 @@ camel_local_folder_construct (CamelLocalFolder *lf,
 		forceindex = FALSE;
 	}
 
-	folder->summary = (CamelFolderSummary *)CAMEL_LOCAL_FOLDER_GET_CLASS (lf)->create_summary (lf, lf->summary_path, lf->folder_path, lf->index);
-	if (!(flags & CAMEL_STORE_IS_MIGRATING) && camel_local_summary_load ((CamelLocalSummary *)folder->summary, forceindex, NULL) == -1) {
+	folder->summary = (CamelFolderSummary *) CAMEL_LOCAL_FOLDER_GET_CLASS (lf)->create_summary (lf, lf->summary_path, lf->folder_path, lf->index);
+	if (!(flags & CAMEL_STORE_IS_MIGRATING) && camel_local_summary_load ((CamelLocalSummary *) folder->summary, forceindex, NULL) == -1) {
 		/* ? */
 		if (lf->need_summary_check &&
-		    camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, cancellable, error) == 0) {
+		    camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error) == 0) {
 			/* we sync here so that any hard work setting up the folder isn't lost */
-			if (camel_local_summary_sync ((CamelLocalSummary *)folder->summary, FALSE, lf->changes, cancellable, error) == -1) {
+			if (camel_local_summary_sync ((CamelLocalSummary *) folder->summary, FALSE, lf->changes, cancellable, error) == -1) {
 				g_object_unref (CAMEL_OBJECT (folder));
 				return NULL;
 			}
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index cef2bea..2d21b67 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -162,11 +162,11 @@ local_store_get_folder_sync (CamelStore *store,
                              GCancellable *cancellable,
                              GError **error)
 {
-	gint len = strlen (((CamelLocalStore *)store)->toplevel_dir);
+	gint len = strlen (((CamelLocalStore *) store)->toplevel_dir);
 	gchar *path = g_alloca (len + 1);
 	struct stat st;
 
-	strcpy (path, ((CamelLocalStore *)store)->toplevel_dir);
+	strcpy (path, ((CamelLocalStore *) store)->toplevel_dir);
 	if (G_IS_DIR_SEPARATOR (path[len-1]))
 		path[len-1] = '\0';
 
@@ -276,7 +276,7 @@ local_store_get_junk_folder_sync (CamelStore *store,
 static gchar *
 get_name (CamelService *service, gboolean brief)
 {
-	gchar *dir = ((CamelLocalStore*)service)->toplevel_dir;
+	gchar *dir = ((CamelLocalStore*) service)->toplevel_dir;
 
 	if (brief)
 		return g_strdup (dir);
@@ -307,7 +307,7 @@ local_store_create_folder_sync (CamelStore *store,
                                 GCancellable *cancellable,
                                 GError **error)
 {
-	gchar *path = ((CamelLocalStore *)store)->toplevel_dir;
+	gchar *path = ((CamelLocalStore *) store)->toplevel_dir;
 	gchar *name;
 	CamelFolder *folder;
 	CamelFolderInfo *info = NULL;
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 7b67584..f2265e4 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -145,7 +145,7 @@ static gint
 local_summary_load (CamelLocalSummary *cls, gint forceindex, GError **error)
 {
 	d(g_print ("\nlocal_summary_load called \n"));
-	return camel_folder_summary_load_from_db ((CamelFolderSummary *)cls, error);
+	return camel_folder_summary_load_from_db ((CamelFolderSummary *) cls, error);
 }
 
 /* load/check the summary */
@@ -161,7 +161,7 @@ camel_local_summary_load (CamelLocalSummary *cls, gint forceindex, GError **erro
 	if ((forceindex && class->need_index ())
 	    || class->load (cls, forceindex, error) == -1) {
 		w(g_warning("Could not load summary: flags may be reset"));
-		camel_folder_summary_clear ((CamelFolderSummary *)cls);
+		camel_folder_summary_clear ((CamelFolderSummary *) cls);
 		return -1;
 	}
 
@@ -200,7 +200,7 @@ static void
 do_stat_ci (CamelLocalSummary *cls, struct _stat_info *info, CamelMessageContentInfo *ci)
 {
 	info->cicount++;
-	info->citotal += ((CamelFolderSummary *)cls)->content_info_size /*+ 4 memchunks are 1/4 byte overhead per mi */;
+	info->citotal += ((CamelFolderSummary *) cls)->content_info_size /*+ 4 memchunks are 1/4 byte overhead per mi */;
 	if (ci->id)
 		info->citotal += strlen (ci->id) + 4;
 	if (ci->description)
@@ -237,7 +237,7 @@ static void
 do_stat_mi (CamelLocalSummary *cls, struct _stat_info *info, CamelMessageInfo *mi)
 {
 	info->micount++;
-	info->mitotal += ((CamelFolderSummary *)cls)->content_info_size /*+ 4*/;
+	info->mitotal += ((CamelFolderSummary *) cls)->content_info_size /*+ 4*/;
 
 	if (mi->subject)
 		info->mitotal += strlen (mi->subject) + 4;
@@ -280,7 +280,7 @@ camel_local_summary_check (CamelLocalSummary *cls,
 #ifdef DOSTATS
 	if (ret != -1) {
 		gint i;
-		CamelFolderSummary *s = (CamelFolderSummary *)cls;
+		CamelFolderSummary *s = (CamelFolderSummary *) cls;
 		struct _stat_info stats = { 0 };
 
 		for (i=0;i<camel_folder_summary_count (s);i++) {
@@ -292,7 +292,7 @@ camel_local_summary_check (CamelLocalSummary *cls,
 		printf("\nMemory used by summary:\n\n");
 		printf("Total of %d messages\n", camel_folder_summary_count(s));
 		printf("Total: %d bytes (ave %f)\n", stats.citotal + stats.mitotal,
-		       (double)(stats.citotal+stats.mitotal)/(double)camel_folder_summary_count (s));
+		       (double)(stats.citotal+stats.mitotal)/(double) camel_folder_summary_count (s));
 		printf("Message Info: %d (ave %f)\n", stats.mitotal, (double)stats.mitotal/(double)stats.micount);
 		printf("Content Info; %d (ave %f) count %d\n", stats.citotal, (double)stats.citotal/(double)stats.cicount, stats.cicount);
 		printf("message id's: %d (ave %f) count %d\n", stats.msgid, (double)stats.msgid/(double)stats.msgcount, stats.msgcount);
@@ -498,12 +498,12 @@ local_summary_add (CamelLocalSummary *cls,
                    GError **error)
 {
 	CamelLocalMessageInfo *mi;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 	gchar *xev;
 
 	d(printf("Adding message to summary\n"));
 
-	mi = (CamelLocalMessageInfo *)camel_folder_summary_add_from_message ((CamelFolderSummary *)cls, msg);
+	mi = (CamelLocalMessageInfo *) camel_folder_summary_add_from_message ((CamelFolderSummary *) cls, msg);
 	if (mi) {
 		/*d(printf("Added, uid = %s\n", mi->uid));*/
 		if (info) {
@@ -511,12 +511,12 @@ local_summary_add (CamelLocalSummary *cls,
 			const CamelFlag *flag = camel_message_info_user_flags (info);
 
 			while (flag) {
-				camel_message_info_set_user_flag ((CamelMessageInfo *)mi, flag->name, TRUE);
+				camel_message_info_set_user_flag ((CamelMessageInfo *) mi, flag->name, TRUE);
 				flag = flag->next;
 			}
 
 			while (tag) {
-				camel_message_info_set_user_tag ((CamelMessageInfo *)mi, tag->name, tag->value);
+				camel_message_info_set_user_tag ((CamelMessageInfo *) mi, tag->name, tag->value);
 				tag = tag->next;
 			}
 
@@ -527,11 +527,11 @@ local_summary_add (CamelLocalSummary *cls,
 
 		/* we need to calculate the size ourselves */
 		if (mi->info.size == 0) {
-			CamelStreamNull *sn = (CamelStreamNull *)camel_stream_null_new ();
+			CamelStreamNull *sn = (CamelStreamNull *) camel_stream_null_new ();
 
 			camel_data_wrapper_write_to_stream_sync (
-				(CamelDataWrapper *)msg,
-				(CamelStream *)sn, NULL, NULL);
+				(CamelDataWrapper *) msg,
+				(CamelStream *) sn, NULL, NULL);
 			mi->info.size = sn->written;
 			g_object_unref (sn);
 		}
@@ -547,7 +547,7 @@ local_summary_add (CamelLocalSummary *cls,
 			error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
 			_("Unable to add message to summary: unknown reason"));
 	}
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static gchar *
@@ -642,7 +642,7 @@ local_summary_decode_x_evolution (CamelLocalSummary *cls, const gchar *xev, Came
 				gchar **flagv = g_strsplit(scan->value, ",", 1000);
 
 				for (i=0;flagv[i];i++)
-					camel_message_info_set_user_flag ((CamelMessageInfo *)mi, flagv[i], TRUE);
+					camel_message_info_set_user_flag ((CamelMessageInfo *) mi, flagv[i], TRUE);
 				g_strfreev (flagv);
 			} else if (!g_ascii_strcasecmp(scan->name, "tags")) {
 				gchar **tagv = g_strsplit(scan->value, ",", 10000);
@@ -652,7 +652,7 @@ local_summary_decode_x_evolution (CamelLocalSummary *cls, const gchar *xev, Came
 					val = strchr (tagv[i], '=');
 					if (val) {
 						*val++ = 0;
-						camel_message_info_set_user_tag ((CamelMessageInfo *)mi, tagv[i], val);
+						camel_message_info_set_user_tag ((CamelMessageInfo *) mi, tagv[i], val);
 						val[-1]='=';
 					}
 				}
@@ -672,7 +672,7 @@ local_summary_decode_x_evolution (CamelLocalSummary *cls, const gchar *xev, Came
 static gint
 summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *fir)
 {
-	CamelLocalSummary *cls = (CamelLocalSummary *)s;
+	CamelLocalSummary *cls = (CamelLocalSummary *) s;
 	gchar *part, *tmp;
 
 	/* We dont actually add our own headers, but version that we don't anyway */
@@ -696,7 +696,7 @@ summary_header_from_db (CamelFolderSummary *s, CamelFIRecord *fir)
 static gint
 summary_header_load (CamelFolderSummary *s, FILE *in)
 {
-	CamelLocalSummary *cls = (CamelLocalSummary *)s;
+	CamelLocalSummary *cls = (CamelLocalSummary *) s;
 
 	/* We dont actually add our own headers, but version that we don't anyway */
 
@@ -741,9 +741,9 @@ static CamelMessageInfo *
 message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelLocalMessageInfo *mi;
-	CamelLocalSummary *cls = (CamelLocalSummary *)s;
+	CamelLocalSummary *cls = (CamelLocalSummary *) s;
 
-	mi = (CamelLocalMessageInfo *)CAMEL_FOLDER_SUMMARY_CLASS (camel_local_summary_parent_class)->message_info_new_from_header (s, h);
+	mi = (CamelLocalMessageInfo *) CAMEL_FOLDER_SUMMARY_CLASS (camel_local_summary_parent_class)->message_info_new_from_header (s, h);
 	if (mi) {
 		const gchar *xev;
 		gint doindex = FALSE;
@@ -772,5 +772,5 @@ message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h
 		}
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 043d3a1..e17cf63 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -88,7 +88,7 @@ maildir_folder_get_filename (CamelFolder *folder,
                              const gchar *uid,
                              GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelMaildirMessageInfo *mdi;
 	CamelMessageInfo *info;
 	gchar *res;
@@ -101,7 +101,7 @@ maildir_folder_get_filename (CamelFolder *folder,
 		return NULL;
 	}
 
-	mdi = (CamelMaildirMessageInfo *)info;
+	mdi = (CamelMaildirMessageInfo *) info;
 
 	/* If filename is NULL, it means folder_summary_check is not yet executed.
 	   Try to find the file in the folder and use it, otherwise construct its
@@ -153,7 +153,7 @@ maildir_folder_append_message_sync (CamelFolder *folder,
                                     GCancellable *cancellable,
                                     GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelStream *output_stream;
 	CamelMessageInfo *mi;
 	CamelMaildirMessageInfo *mdi;
@@ -176,7 +176,7 @@ maildir_folder_append_message_sync (CamelFolder *folder,
 	if ((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (message))
 		camel_message_info_set_flags (mi, CAMEL_MESSAGE_ATTACHMENTS, 0);
 
-	mdi = (CamelMaildirMessageInfo *)mi;
+	mdi = (CamelMaildirMessageInfo *) mi;
 
 	d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
 
@@ -188,7 +188,7 @@ maildir_folder_append_message_sync (CamelFolder *folder,
 		goto fail_write;
 
 	if (camel_data_wrapper_write_to_stream_sync (
-		(CamelDataWrapper *)message, output_stream, cancellable, error) == -1
+		(CamelDataWrapper *) message, output_stream, cancellable, error) == -1
 	    || camel_stream_close (output_stream, cancellable, error) == -1)
 		goto fail_write;
 
@@ -250,7 +250,7 @@ maildir_folder_get_message_sync (CamelFolder *folder,
                                  GCancellable *cancellable,
                                  GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelStream *message_stream = NULL;
 	CamelMimeMessage *message = NULL;
 	gchar *name = NULL;
@@ -275,7 +275,7 @@ maildir_folder_get_message_sync (CamelFolder *folder,
 
 	message = camel_mime_message_new ();
 	if (!camel_data_wrapper_construct_from_stream_sync (
-		(CamelDataWrapper *)message,
+		(CamelDataWrapper *) message,
 		message_stream, cancellable, error)) {
 		g_prefix_error (
 			error, _("Cannot get message %s from folder %s: "),
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 6383ea0..5c5c0b8 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -77,7 +77,7 @@ maildir_store_create_folder_sync (CamelStore *store,
 	       GCancellable *cancellable,
                GError **error)
 {
-	gchar *path = ((CamelLocalStore *)store)->toplevel_dir;
+	gchar *path = ((CamelLocalStore *) store)->toplevel_dir;
 	gchar *name;
 	CamelFolder *folder;
 	CamelFolderInfo *info = NULL;
@@ -371,7 +371,7 @@ fill_fi (CamelStore *store,
 		const gchar *root;
 
 		/* This should be fast enough not to have to test for INFO_FAST */
-		root = camel_local_store_get_toplevel_dir ((CamelLocalStore *)store);
+		root = camel_local_store_get_toplevel_dir ((CamelLocalStore *) store);
 
 		dir_name = maildir_full_name_to_dir_name (fi->full_name);
 
@@ -383,7 +383,7 @@ fill_fi (CamelStore *store,
 			folderpath = g_strdup_printf("%s%s", root, dir_name);
 		}
 
-		s = (CamelFolderSummary *)camel_maildir_summary_new (NULL, path, folderpath, NULL);
+		s = (CamelFolderSummary *) camel_maildir_summary_new (NULL, path, folderpath, NULL);
 		if (camel_folder_summary_header_load_from_db (s, store, fi->full_name, NULL) != -1) {
 			fi->unread = s->unread_count;
 			fi->total = s->saved_count;
@@ -806,7 +806,7 @@ scan_old_dir_info (CamelStore *store, CamelFolderInfo *topfi, GError **error)
 
 	sn = g_malloc0 (sizeof (*sn));
 	sn->fi = topfi;
-	camel_dlist_addtail (&queue, (CamelDListNode *)sn);
+	camel_dlist_addtail (&queue, (CamelDListNode *) sn);
 	g_hash_table_insert (visited, sn, sn);
 
 	while (!camel_dlist_empty (&queue)) {
@@ -815,7 +815,7 @@ scan_old_dir_info (CamelStore *store, CamelFolderInfo *topfi, GError **error)
 		struct dirent *d;
 		CamelFolderInfo *last;
 
-		sn = (struct _scan_node *)camel_dlist_remhead (&queue);
+		sn = (struct _scan_node *) camel_dlist_remhead (&queue);
 
 		last = (CamelFolderInfo *)&sn->fi->child;
 
@@ -876,7 +876,7 @@ scan_old_dir_info (CamelStore *store, CamelFolderInfo *topfi, GError **error)
 					snew->fi->parent = sn->fi;
 
 					g_hash_table_insert (visited, snew, snew);
-					camel_dlist_addtail (&queue, (CamelDListNode *)snew);
+					camel_dlist_addtail (&queue, (CamelDListNode *) snew);
 				}
 			}
 			g_free (tmp);
@@ -905,7 +905,7 @@ maildir_rename_old_folder (CamelMaildirStore *mstore, CamelFolderInfo *fi, GCanc
 
 	store_class = CAMEL_STORE_CLASS (camel_maildir_store_parent_class);
 	store_class->rename_folder_sync (
-		(CamelStore *)mstore, fi->full_name, new_name, cancellable, error);
+		(CamelStore *) mstore, fi->full_name, new_name, cancellable, error);
 
 	g_free (old_name);
 	g_free (new_name);
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 972d203..b4bb16d 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -151,16 +151,16 @@ CamelMaildirSummary
 	CamelMaildirSummary *o;
 
 	o = g_object_new (CAMEL_TYPE_MAILDIR_SUMMARY, NULL);
-	((CamelFolderSummary *)o)->folder = folder;
+	((CamelFolderSummary *) o)->folder = folder;
 	if (folder) {
 		CamelStore *parent_store;
 
 		parent_store = camel_folder_get_parent_store (folder);
 		camel_db_set_collate (parent_store->cdb_r, "dreceived", NULL, NULL);
 		((CamelFolderSummary *)o)->sort_by = "dreceived";
-		((CamelFolderSummary *)o)->collate = NULL;
+		((CamelFolderSummary *) o)->collate = NULL;
 	}
-	camel_local_summary_construct ((CamelLocalSummary *)o, filename, maildirdir, index);
+	camel_local_summary_construct ((CamelLocalSummary *) o, filename, maildirdir, index);
 	return o;
 }
 
@@ -267,21 +267,21 @@ maildir_summary_add (CamelLocalSummary *cls,
 		}
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static CamelMessageInfo *
 message_info_new_from_header (CamelFolderSummary * s, struct _camel_header_raw *h)
 {
 	CamelMessageInfo *mi, *info;
-	CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
+	CamelMaildirSummary *mds = (CamelMaildirSummary *) s;
 	CamelMaildirMessageInfo *mdi;
 	const gchar *uid;
 
 	mi = ((CamelFolderSummaryClass *) camel_maildir_summary_parent_class)->message_info_new_from_header (s, h);
 	/* assign the uid and new filename */
 	if (mi) {
-		mdi = (CamelMaildirMessageInfo *)mi;
+		mdi = (CamelMaildirMessageInfo *) mi;
 
 		uid = camel_message_info_uid (mi);
 		if (uid==NULL || uid[0] == 0)
@@ -336,7 +336,7 @@ message_info_new_from_header (CamelFolderSummary * s, struct _camel_header_raw *
 static void
 message_info_free (CamelFolderSummary *s, CamelMessageInfo *mi)
 {
-	CamelMaildirMessageInfo *mdi = (CamelMaildirMessageInfo *)mi;
+	CamelMaildirMessageInfo *mdi = (CamelMaildirMessageInfo *) mi;
 
 	g_free (mdi->filename);
 
@@ -345,7 +345,7 @@ message_info_free (CamelFolderSummary *s, CamelMessageInfo *mi)
 
 static gchar *maildir_summary_next_uid_string (CamelFolderSummary *s)
 {
-	CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
+	CamelMaildirSummary *mds = (CamelMaildirSummary *) s;
 
 	d(printf("next uid string called?\n"));
 
@@ -363,7 +363,7 @@ static gchar *maildir_summary_next_uid_string (CamelFolderSummary *s)
 #if 0
 		return g_strdup_printf("%ld.%d_%u.%s", time(0), getpid(), camel_folder_summary_next_uid(s), mds->priv->hostname);
 #else
-		CamelLocalSummary *cls = (CamelLocalSummary *)s;
+		CamelLocalSummary *cls = (CamelLocalSummary *) s;
 		gchar *name = NULL, *uid = NULL;
 		struct stat st;
 		gint retry = 0;
@@ -393,7 +393,7 @@ static CamelMessageInfo *
 message_info_migrate (CamelFolderSummary *s, FILE *in)
 {
 	CamelMessageInfo *mi;
-	CamelMaildirSummary *mds = (CamelMaildirSummary *)s;
+	CamelMaildirSummary *mds = (CamelMaildirSummary *) s;
 
 	mi = ((CamelFolderSummaryClass *) camel_maildir_summary_parent_class)->message_info_migrate (s, in);
 	if (mi) {
@@ -403,7 +403,7 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 		    && (name = g_hash_table_lookup (mds->priv->load_map, camel_message_info_uid (mi)))) {
 			d(printf("Setting filename of %s to %s\n", camel_message_info_uid(mi), name));
 			camel_maildir_info_set_filename (mi, g_strdup (name));
-			camel_maildir_summary_name_to_info ((CamelMaildirMessageInfo *)mi, name);
+			camel_maildir_summary_name_to_info ((CamelMaildirMessageInfo *) mi, name);
 		}
 	}
 
@@ -419,7 +419,7 @@ maildir_summary_load (CamelLocalSummary *cls,
 	gchar *cur;
 	DIR *dir;
 	struct dirent *d;
-	CamelMaildirSummary *mds = (CamelMaildirSummary *)cls;
+	CamelMaildirSummary *mds = (CamelMaildirSummary *) cls;
 	gchar *uid;
 	CamelMemPool *pool;
 	gint ret;
@@ -479,7 +479,7 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
                            gint forceindex,
                            GCancellable *cancellable)
 {
-	CamelMaildirSummary *maildirs = (CamelMaildirSummary *)cls;
+	CamelMaildirSummary *maildirs = (CamelMaildirSummary *) cls;
 	gchar *filename = g_strdup_printf("%s/cur/%s", cls->folder_path, name);
 	gint fd;
 	CamelMimeParser *mp;
@@ -497,15 +497,15 @@ camel_maildir_summary_add (CamelLocalSummary *cls,
 	camel_mime_parser_init_with_fd (mp, fd);
 	if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
 		d(printf("forcing indexing of message content\n"));
-		camel_folder_summary_set_index ((CamelFolderSummary *)maildirs, cls->index);
+		camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, cls->index);
 	} else {
-		camel_folder_summary_set_index ((CamelFolderSummary *)maildirs, NULL);
+		camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, NULL);
 	}
-	maildirs->priv->current_file = (gchar *)name;
-	camel_folder_summary_add_from_parser ((CamelFolderSummary *)maildirs, mp);
+	maildirs->priv->current_file = (gchar *) name;
+	camel_folder_summary_add_from_parser ((CamelFolderSummary *) maildirs, mp);
 	g_object_unref (mp);
 	maildirs->priv->current_file = NULL;
-	camel_folder_summary_set_index ((CamelFolderSummary *)maildirs, NULL);
+	camel_folder_summary_set_index ((CamelFolderSummary *) maildirs, NULL);
 	g_free (filename);
 	return 0;
 }
@@ -523,7 +523,7 @@ remove_summary (gchar *key, CamelMessageInfo *info, struct _remove_data *rd)
 		camel_index_delete_name (rd->cls->index, camel_message_info_uid (info));
 	if (rd->changes)
 		camel_folder_change_info_remove_uid (rd->changes, key);
-	camel_folder_summary_remove ((CamelFolderSummary *)rd->cls, info);
+	camel_folder_summary_remove ((CamelFolderSummary *) rd->cls, info);
 	camel_message_info_free (info);
 }
 
@@ -538,7 +538,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 	gchar *p;
 	CamelMessageInfo *info;
 	CamelMaildirMessageInfo *mdi;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 	GHashTable *left;
 	gint i, count, total;
 	gint forceindex;
@@ -578,9 +578,9 @@ maildir_summary_check (CamelLocalSummary *cls,
 	count = camel_folder_summary_count (s);
 	forceindex = count == 0;
 	for (i=0;i<count;i++) {
-		info = camel_folder_summary_index ((CamelFolderSummary *)cls, i);
+		info = camel_folder_summary_index ((CamelFolderSummary *) cls, i);
 		if (info) {
-			g_hash_table_insert (left, (gchar *)camel_message_info_uid (info), info);
+			g_hash_table_insert (left, (gchar *) camel_message_info_uid (info), info);
 		}
 	}
 
@@ -615,7 +615,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 			g_hash_table_remove (left, uid);
 		}
 
-		info = camel_folder_summary_uid ((CamelFolderSummary *)cls, uid);
+		info = camel_folder_summary_uid ((CamelFolderSummary *) cls, uid);
 		if (info == NULL) {
 			/* must be a message incorporated by another client, this is not a 'recent' uid */
 			if (camel_maildir_summary_add (cls, d->d_name, forceindex, cancellable) == 0)
@@ -629,7 +629,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 				camel_maildir_summary_add (cls, d->d_name, forceindex, cancellable);
 			}
 
-			mdi = (CamelMaildirMessageInfo *)info;
+			mdi = (CamelMaildirMessageInfo *) info;
 			filename = camel_maildir_info_filename (mdi);
 			/* TODO: only store the extension in the mdi->filename struct, not the whole lot */
 			if (filename == NULL || strcmp (filename, d->d_name) != 0) {
@@ -641,7 +641,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 		g_free (uid);
 	}
 	closedir (dir);
-	g_hash_table_foreach (left, (GHFunc)remove_summary, &rd);
+	g_hash_table_foreach (left, (GHFunc) remove_summary, &rd);
 	g_hash_table_destroy (left);
 
 	camel_operation_pop_message (cancellable);
@@ -671,7 +671,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 				continue;
 
 			/* already in summary?  shouldn't happen, but just incase ... */
-			if ((info = camel_folder_summary_uid ((CamelFolderSummary *)cls, name))) {
+			if ((info = camel_folder_summary_uid ((CamelFolderSummary *) cls, name))) {
 				camel_message_info_free (info);
 				newname = destname = camel_folder_summary_next_uid_string (s);
 			} else {
@@ -742,13 +742,13 @@ maildir_summary_sync (CamelLocalSummary *cls,
 
 	camel_operation_push_message (cancellable, _("Storing folder"));
 
-	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *)cls, error);
-	count = camel_folder_summary_count ((CamelFolderSummary *)cls);
+	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *) cls, error);
+	count = camel_folder_summary_count ((CamelFolderSummary *) cls);
 	for (i=count-1;i>=0;i--) {
 		camel_operation_progress (cancellable, (count-i)*100/count);
 
-		info = camel_folder_summary_index ((CamelFolderSummary *)cls, i);
-		mdi = (CamelMaildirMessageInfo *)info;
+		info = camel_folder_summary_index ((CamelFolderSummary *) cls, i);
+		mdi = (CamelMaildirMessageInfo *) info;
 		if (mdi && (mdi->info.info.flags & CAMEL_MESSAGE_DELETED) && expunge) {
 			name = g_strdup_printf("%s/cur/%s", cls->folder_path, camel_maildir_info_filename(mdi));
 			d(printf("deleting %s\n", name));
@@ -759,7 +759,7 @@ maildir_summary_sync (CamelLocalSummary *cls,
 					camel_index_delete_name (cls->index, camel_message_info_uid (info));
 
 				camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
-				camel_folder_summary_remove ((CamelFolderSummary *)cls, info);
+				camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
 			}
 			g_free (name);
 		} else if (mdi && (mdi->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 571b12c..5180b08 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -67,8 +67,8 @@ mbox_folder_cmp_uids (CamelFolder *folder,
 
 	res = a->frompos < b->frompos ? -1 : a->frompos == b->frompos ? 0 : 1;
 
-	camel_message_info_free ((CamelMessageInfo *)a);
-	camel_message_info_free ((CamelMessageInfo *)b);
+	camel_message_info_free ((CamelMessageInfo *) a);
+	camel_message_info_free ((CamelMessageInfo *) b);
 
 	return res;
 }
@@ -91,7 +91,7 @@ mbox_folder_get_filename (CamelFolder *folder,
                           const gchar *uid,
                           GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelMboxMessageInfo *info;
 	goffset frompos;
 	gchar *filename = NULL;
@@ -103,7 +103,7 @@ mbox_folder_get_filename (CamelFolder *folder,
 		return NULL;
 
 	/* check for new messages always */
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, NULL, error) == -1) {
+	if (camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, NULL, error) == -1) {
 		camel_local_folder_unlock (lf);
 		return NULL;
 	}
@@ -119,12 +119,12 @@ mbox_folder_get_filename (CamelFolder *folder,
 	}
 
 	if (info->frompos == -1) {
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 		goto fail;
 	}
 
 	frompos = info->frompos;
-	camel_message_info_free ((CamelMessageInfo *)info);
+	camel_message_info_free ((CamelMessageInfo *) info);
 
 	filename = g_strdup_printf ("%s%s!%" PRId64, lf->folder_path, G_DIR_SEPARATOR_S, (gint64) frompos);
 
@@ -143,10 +143,10 @@ mbox_folder_append_message_sync (CamelFolder *folder,
                                  GCancellable *cancellable,
                                  GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelStream *output_stream = NULL, *filter_stream = NULL;
 	CamelMimeFilter *filter_from;
-	CamelMboxSummary *mbs = (CamelMboxSummary *)folder->summary;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) folder->summary;
 	CamelMessageInfo *mi;
 	gchar *fromline = NULL;
 	struct stat st;
@@ -161,12 +161,12 @@ mbox_folder_append_message_sync (CamelFolder *folder,
 	d(printf("Appending message\n"));
 
 	/* first, check the summary is correct (updates folder_size too) */
-	retval = camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, cancellable, error);
+	retval = camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error);
 	if (retval == -1)
 		goto fail;
 
 	/* add it to the summary/assign the uid, etc */
-	mi = camel_local_summary_add ((CamelLocalSummary *)folder->summary, message, info, lf->changes, error);
+	mi = camel_local_summary_add ((CamelLocalSummary *) folder->summary, message, info, lf->changes, error);
 	if (mi == NULL)
 		goto fail;
 
@@ -186,9 +186,9 @@ mbox_folder_append_message_sync (CamelFolder *folder,
 	}
 
 	/* and we need to set the frompos/XEV explicitly */
-	((CamelMboxMessageInfo *)mi)->frompos = mbs->folder_size;
+	((CamelMboxMessageInfo *) mi)->frompos = mbs->folder_size;
 #if 0
-	xev = camel_local_summary_encode_x_evolution ((CamelLocalSummary *)folder->summary, mi);
+	xev = camel_local_summary_encode_x_evolution ((CamelLocalSummary *) folder->summary, mi);
 	if (xev) {
 		/* the x-ev header should match the 'current' flags, no problem, so store as much */
 		camel_medium_set_header((CamelMedium *)message, "X-Evolution", xev);
@@ -219,8 +219,8 @@ mbox_folder_append_message_sync (CamelFolder *folder,
 	g_object_unref (output_stream);
 	g_free (fromline);
 
-	if (!((CamelMessageInfoBase *)mi)->preview && camel_folder_summary_get_need_preview (folder->summary)) {
-		if (camel_mime_message_build_preview ((CamelMimePart *)message, mi) && ((CamelMessageInfoBase *)mi)->preview)
+	if (!((CamelMessageInfoBase *) mi)->preview && camel_folder_summary_get_need_preview (folder->summary)) {
+		if (camel_mime_message_build_preview ((CamelMimePart *) message, mi) && ((CamelMessageInfoBase *) mi)->preview)
 			camel_folder_summary_add_preview (folder->summary, mi);
 	}
 
@@ -295,7 +295,7 @@ mbox_folder_get_message_sync (CamelFolder *folder,
                               GCancellable *cancellable,
                               GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelMimeMessage *message = NULL;
 	CamelMboxMessageInfo *info;
 	CamelMimeParser *parser = NULL;
@@ -310,7 +310,7 @@ mbox_folder_get_message_sync (CamelFolder *folder,
 		return NULL;
 
 	/* check for new messages always */
-	if (camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, cancellable, error) == -1) {
+	if (camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error) == -1) {
 		camel_local_folder_unlock (lf);
 		return NULL;
 	}
@@ -327,12 +327,12 @@ retry:
 	}
 
 	if (info->frompos == -1) {
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 		goto fail;
 	}
 
 	frompos = info->frompos;
-	camel_message_info_free ((CamelMessageInfo *)info);
+	camel_message_info_free ((CamelMessageInfo *) info);
 
 	/* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache
 	   the whole message in memory if the stream is non-seekable (which it is when built from a parser
@@ -358,7 +358,7 @@ retry:
 
 		g_warning("Summary doesn't match the folder contents!  eek!\n"
 			  "  expecting offset %ld got %ld, state = %d", (glong)frompos,
-			  (glong)camel_mime_parser_tell_start_from (parser),
+			  (glong) camel_mime_parser_tell_start_from (parser),
 			  camel_mime_parser_state (parser));
 
 		g_object_unref (parser);
@@ -366,8 +366,8 @@ retry:
 
 		if (!retried) {
 			retried = TRUE;
-			camel_local_summary_check_force ((CamelLocalSummary *)folder->summary);
-			retval = camel_local_summary_check ((CamelLocalSummary *)folder->summary, lf->changes, cancellable, error);
+			camel_local_summary_check_force ((CamelLocalSummary *) folder->summary);
+			retval = camel_local_summary_check ((CamelLocalSummary *) folder->summary, lf->changes, cancellable, error);
 			if (retval != -1)
 				goto retry;
 		}
@@ -381,7 +381,7 @@ retry:
 
 	message = camel_mime_message_new ();
 	if (!camel_mime_part_construct_from_parser_sync (
-		(CamelMimePart *)message, parser, cancellable, error)) {
+		(CamelMimePart *) message, parser, cancellable, error)) {
 		g_prefix_error (
 			error, _("Cannot get message %s from folder %s: "),
 			uid, lf->folder_path);
@@ -414,7 +414,7 @@ mbox_folder_create_summary (CamelLocalFolder *lf,
                             const gchar *folder,
                             CamelIndex *index)
 {
-	return (CamelLocalSummary *)camel_mbox_summary_new ((CamelFolder *)lf, path, folder, index);
+	return (CamelLocalSummary *) camel_mbox_summary_new ((CamelFolder *) lf, path, folder, index);
 }
 
 static gint
@@ -423,7 +423,7 @@ mbox_folder_lock (CamelLocalFolder *lf,
                   GError **error)
 {
 #ifndef G_OS_WIN32
-	CamelMboxFolder *mf = (CamelMboxFolder *)lf;
+	CamelMboxFolder *mf = (CamelMboxFolder *) lf;
 
 	/* make sure we have matching unlocks for locks, camel-local-folder class should enforce this */
 	g_assert (mf->lockfd == -1);
@@ -451,7 +451,7 @@ static void
 mbox_folder_unlock (CamelLocalFolder *lf)
 {
 #ifndef G_OS_WIN32
-	CamelMboxFolder *mf = (CamelMboxFolder *)lf;
+	CamelMboxFolder *mf = (CamelMboxFolder *) lf;
 
 	g_assert (mf->lockfd != -1);
 	camel_unlock_folder (lf->folder_path, mf->lockfd);
@@ -501,8 +501,8 @@ camel_mbox_folder_new (CamelStore *parent_store,
 		CAMEL_TYPE_MBOX_FOLDER,
 		"display-name", basename, "full-name", full_name,
 		"parent-store", parent_store, NULL);
-	folder = (CamelFolder *)camel_local_folder_construct (
-		(CamelLocalFolder *)folder, flags, cancellable, error);
+	folder = (CamelFolder *) camel_local_folder_construct (
+		(CamelLocalFolder *) folder, flags, cancellable, error);
 
 	g_free (basename);
 
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index fd3bc9d..f1e72f6 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -119,11 +119,11 @@ fill_fi (CamelStore *store,
 		path = camel_local_store_get_meta_path(store, fi->full_name, ".ev-summary");
 		folderpath = camel_local_store_get_full_path (store, fi->full_name);
 
-		mbs = (CamelMboxSummary *)camel_mbox_summary_new (NULL, path, folderpath, NULL);
+		mbs = (CamelMboxSummary *) camel_mbox_summary_new (NULL, path, folderpath, NULL);
 		/* FIXME[disk-summary] track exception */
-		if (camel_folder_summary_header_load_from_db ((CamelFolderSummary *)mbs, store, fi->full_name, NULL) != -1) {
-			fi->unread = ((CamelFolderSummary *)mbs)->unread_count;
-			fi->total = ((CamelFolderSummary *)mbs)->saved_count;
+		if (camel_folder_summary_header_load_from_db ((CamelFolderSummary *) mbs, store, fi->full_name, NULL) != -1) {
+			fi->unread = ((CamelFolderSummary *) mbs)->unread_count;
+			fi->total = ((CamelFolderSummary *) mbs)->saved_count;
 		}
 
 		g_object_unref (mbs);
@@ -261,7 +261,7 @@ scan_dir (CamelStore *store,
 static gint
 xrename (CamelStore *store, const gchar *old_name, const gchar *new_name, const gchar *ext, gboolean missingok)
 {
-	CamelLocalStore *ls = (CamelLocalStore *)store;
+	CamelLocalStore *ls = (CamelLocalStore *) store;
 	gchar *oldpath, *newpath;
 	struct stat st;
 	gint ret = -1;
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index f0eb45d..192f02e 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -85,7 +85,7 @@ mbox_info_set_user_flag (CamelMessageInfo *mi, const gchar *name, gboolean value
 
 	res = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->info_set_user_flag (mi, name, value);
 	if (res)
-		((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+		((CamelLocalMessageInfo *) mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
 
 	return res;
 }
@@ -97,7 +97,7 @@ mbox_info_set_user_tag (CamelMessageInfo *mi, const gchar *name, const gchar *va
 
 	res = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->info_set_user_tag (mi, name, value);
 	if (res)
-		((CamelLocalMessageInfo *)mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
+		((CamelLocalMessageInfo *) mi)->info.flags |= CAMEL_MESSAGE_FOLDER_FLAGGED;
 
 	return res;
 }
@@ -109,7 +109,7 @@ mbox_info_set_flags (CamelMessageInfo *mi,
                      guint32 set)
 {
 	/* Basically, if anything could change the Status line, presume it does */
-	if (((CamelMboxSummary *)mi->summary)->xstatus
+	if (((CamelMboxSummary *) mi->summary)->xstatus
 	    && (flags & (CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FLAGGED|CAMEL_MESSAGE_ANSWERED|CAMEL_MESSAGE_DELETED))) {
 		flags |= CAMEL_MESSAGE_FOLDER_XEVCHANGE|CAMEL_MESSAGE_FOLDER_FLAGGED;
 		set |= CAMEL_MESSAGE_FOLDER_XEVCHANGE|CAMEL_MESSAGE_FOLDER_FLAGGED;
@@ -180,9 +180,9 @@ camel_mbox_summary_new (struct _CamelFolder *folder, const gchar *filename, cons
 	CamelMboxSummary *new;
 
 	new = g_object_new (CAMEL_TYPE_MBOX_SUMMARY, NULL);
-	((CamelFolderSummary *)new)->folder = folder;
+	((CamelFolderSummary *) new)->folder = folder;
 	if (folder) {
-		CamelFolderSummary *summary = (CamelFolderSummary *)new;
+		CamelFolderSummary *summary = (CamelFolderSummary *) new;
 		CamelStore *parent_store;
 
 		parent_store = camel_folder_get_parent_store (folder);
@@ -193,7 +193,7 @@ camel_mbox_summary_new (struct _CamelFolder *folder, const gchar *filename, cons
 		summary->collate = "mbox_frompos_sort";
 
 	}
-	camel_local_summary_construct ((CamelLocalSummary *)new, filename, mbox_name, index);
+	camel_local_summary_construct ((CamelLocalSummary *) new, filename, mbox_name, index);
 	return new;
 }
 
@@ -294,9 +294,9 @@ static CamelMessageInfo *
 message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h)
 {
 	CamelMboxMessageInfo *mi;
-	CamelMboxSummary *mbs = (CamelMboxSummary *)s;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) s;
 
-	mi = (CamelMboxMessageInfo *)CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_new_from_header (s, h);
+	mi = (CamelMboxMessageInfo *) CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_new_from_header (s, h);
 	if (mi) {
 		const gchar *xev, *uid;
 		CamelMboxMessageInfo *info = NULL;
@@ -318,7 +318,7 @@ message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h
 		/* if we have an xev header, use it, else assign a new one */
 		xev = camel_header_raw_find(&h, "X-Evolution", NULL);
 		if (xev != NULL
-		    && camel_local_summary_decode_x_evolution ((CamelLocalSummary *)s, xev, &mi->info) == 0) {
+		    && camel_local_summary_decode_x_evolution ((CamelLocalSummary *) s, xev, &mi->info) == 0) {
 			uid = camel_message_info_uid (mi);
 			d(printf("found valid x-evolution: %s\n", uid));
 			/* If one is there, it should be there already */
@@ -368,7 +368,7 @@ message_info_new_from_header (CamelFolderSummary *s, struct _camel_header_raw *h
 		mi->frompos = -1;
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static CamelMessageInfo *
@@ -378,7 +378,7 @@ message_info_new_from_parser (CamelFolderSummary *s, CamelMimeParser *mp)
 
 	mi = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_new_from_parser (s, mp);
 	if (mi) {
-		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
+		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *) mi;
 
 		mbi->frompos = camel_mime_parser_tell_start_from (mp);
 	}
@@ -394,7 +394,7 @@ message_info_from_db (CamelFolderSummary *s, struct _CamelMIRecord *mir)
 	mi = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_from_db (s, mir);
 
 	if (mi) {
-		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
+		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *) mi;
 		gchar *part = mir->bdata;
 		if (part) {
 			mbi->frompos = bdata_extract_digit (&part);
@@ -414,7 +414,7 @@ message_info_migrate (CamelFolderSummary *s, FILE *in)
 	mi = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_migrate (s, in);
 	if (mi) {
 		off_t ot = -1;
-		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)mi;
+		CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *) mi;
 
 		if (camel_file_util_decode_off_t (in, &ot) == -1)
 			goto error;
@@ -431,7 +431,7 @@ error:
 static struct _CamelMIRecord *
 message_info_to_db (CamelFolderSummary *s, CamelMessageInfo *info)
 {
-	CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *)info;
+	CamelMboxMessageInfo *mbi = (CamelMboxMessageInfo *) info;
 	struct _CamelMIRecord *mir;
 
 	mir = CAMEL_FOLDER_SUMMARY_CLASS (camel_mbox_summary_parent_class)->message_info_to_db (s, info);
@@ -449,8 +449,8 @@ summary_update (CamelLocalSummary *cls,
                 GError **error)
 {
 	gint i, count;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
-	CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) cls;
 	CamelMimeParser *mp;
 	CamelMboxMessageInfo *mi;
 	CamelStore *parent_store;
@@ -505,7 +505,7 @@ summary_update (CamelLocalSummary *cls,
 	camel_folder_summary_prepare_fetch_all (s, NULL);
 	count = camel_folder_summary_count (s);
 	for (i=0;i<count;i++) {
-		mi = (CamelMboxMessageInfo *)camel_folder_summary_index (s, i);
+		mi = (CamelMboxMessageInfo *) camel_folder_summary_index (s, i);
 		if (offset == 0)
 			mi->info.info.flags |= CAMEL_MESSAGE_FOLDER_NOTSEEN;
 		else
@@ -548,7 +548,7 @@ summary_update (CamelLocalSummary *cls,
 
 	count = camel_folder_summary_count (s);
 	for (i=0;i<count;i++) {
-		mi = (CamelMboxMessageInfo *)camel_folder_summary_index (s, i);
+		mi = (CamelMboxMessageInfo *) camel_folder_summary_index (s, i);
 		/* must've dissapeared from the file? */
 		if (!mi || mi->info.info.flags & CAMEL_MESSAGE_FOLDER_NOTSEEN) {
 			gchar *uid;
@@ -605,8 +605,8 @@ mbox_summary_check (CamelLocalSummary *cls,
                     GCancellable *cancellable,
                     GError **error)
 {
-	CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 	struct stat st;
 	gint ret = 0;
 	gint i, count;
@@ -680,7 +680,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
                         GCancellable *cancellable,
                         GError **error)
 {
-	CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
+	CamelLocalSummary *cls = (CamelLocalSummary *) mbs;
 	gint fd = -1, fdout = -1;
 	gchar *tmpname = NULL;
 	guint32 flags = (expunge?1:0);
@@ -714,7 +714,7 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
 	}
 
 	if (camel_mbox_summary_sync_mbox (
-		(CamelMboxSummary *)cls, flags, changeinfo,
+		(CamelMboxSummary *) cls, flags, changeinfo,
 		fd, fdout, cancellable, error) == -1)
 		goto error;
 
@@ -780,13 +780,13 @@ mbox_summary_sync_full (CamelMboxSummary *mbs,
 static gint
 cms_sort_frompos (gpointer a, gpointer b, gpointer data)
 {
-	CamelFolderSummary *summary = (CamelFolderSummary *)data;
+	CamelFolderSummary *summary = (CamelFolderSummary *) data;
 	CamelMboxMessageInfo *info1, *info2;
 	gint ret = 0;
 
 	/* Things are in memory already. Sorting speeds up syncing, if things are sorted by from pos. */
-	info1 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(gchar **)a);
-	info2 = (CamelMboxMessageInfo *)camel_folder_summary_uid (summary, *(gchar **)b);
+	info1 = (CamelMboxMessageInfo *) camel_folder_summary_uid (summary, *(gchar **) a);
+	info2 = (CamelMboxMessageInfo *) camel_folder_summary_uid (summary, *(gchar **) b);
 
 	if (info1->frompos > info2->frompos)
 		ret = 1;
@@ -809,8 +809,8 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
                          GCancellable *cancellable,
                          GError **error)
 {
-	CamelLocalSummary *cls = (CamelLocalSummary *)mbs;
-	CamelFolderSummary *s = (CamelFolderSummary *)mbs;
+	CamelLocalSummary *cls = (CamelLocalSummary *) mbs;
+	CamelFolderSummary *s = (CamelFolderSummary *) mbs;
 	CamelMimeParser *mp = NULL;
 	gint i;
 	CamelMboxMessageInfo *info = NULL;
@@ -856,9 +856,9 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 
 	camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 	/* Sync only the changes */
-	summary = camel_folder_summary_get_changed ((CamelFolderSummary *)mbs);
+	summary = camel_folder_summary_get_changed ((CamelFolderSummary *) mbs);
 	if (summary->len)
-		g_ptr_array_sort_with_data (summary, (GCompareDataFunc)cms_sort_frompos, (gpointer) mbs);
+		g_ptr_array_sort_with_data (summary, (GCompareDataFunc) cms_sort_frompos, (gpointer) mbs);
 
 	for (i = 0; i < summary->len; i++) {
 		gint xevoffset;
@@ -866,12 +866,12 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 
 		camel_operation_progress (cancellable, pc);
 
-		info = (CamelMboxMessageInfo *)camel_folder_summary_uid (s, summary->pdata[i]);
+		info = (CamelMboxMessageInfo *) camel_folder_summary_uid (s, summary->pdata[i]);
 
 		d(printf("Checking message %s %08x\n", camel_message_info_uid(info), ((CamelMessageInfoBase *)info)->flags));
 
 		if ((info->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) == 0) {
-			camel_message_info_free ((CamelMessageInfo *)info);
+			camel_message_info_free ((CamelMessageInfo *) info);
 			info = NULL;
 			continue;
 		}
@@ -889,7 +889,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 
 		if (camel_mime_parser_tell_start_from (mp) != info->frompos) {
 			g_warning("Didn't get the next message where I expected (%d) got %d instead",
-				  (gint)info->frompos, (gint)camel_mime_parser_tell_start_from (mp));
+				  (gint) info->frompos, (gint) camel_mime_parser_tell_start_from (mp));
 			g_set_error (
 				error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
 				_("Summary and folder mismatch, even after a sync"));
@@ -935,7 +935,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 
 		info->info.info.flags &= 0xffff;
 		info->info.info.dirty = TRUE;
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 		info = NULL;
 	}
 
@@ -968,7 +968,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 	if (mp)
 		g_object_unref (mp);
 	if (info)
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 
 	camel_operation_pop_message (cancellable);
 	camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -984,8 +984,8 @@ mbox_summary_sync (CamelLocalSummary *cls,
                    GError **error)
 {
 	struct stat st;
-	CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 	CamelStore *parent_store;
 	const gchar *full_name;
 	gint i;
@@ -1002,9 +1002,9 @@ mbox_summary_sync (CamelLocalSummary *cls,
 
 	/* Sync only the changes */
 
-	summary = camel_folder_summary_get_changed ((CamelFolderSummary *)mbs);
+	summary = camel_folder_summary_get_changed ((CamelFolderSummary *) mbs);
 	for (i=0; i<summary->len; i++) {
-		CamelMboxMessageInfo *info = (CamelMboxMessageInfo *)camel_folder_summary_uid (s, summary->pdata[i]);
+		CamelMboxMessageInfo *info = (CamelMboxMessageInfo *) camel_folder_summary_uid (s, summary->pdata[i]);
 
 		if ((expunge && (info->info.info.flags & CAMEL_MESSAGE_DELETED)) ||
 		    (info->info.info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_XEVCHANGE)))
@@ -1071,8 +1071,8 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
                               GCancellable *cancellable,
                               GError **error)
 {
-	CamelMboxSummary *mbs = (CamelMboxSummary *)cls;
-	CamelFolderSummary *s = (CamelFolderSummary *)mbs;
+	CamelMboxSummary *mbs = (CamelMboxSummary *) cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) mbs;
 	CamelMimeParser *mp = NULL;
 	CamelStore *parent_store;
 	const gchar *full_name;
@@ -1114,7 +1114,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 
 		camel_operation_progress (cancellable, pc);
 
-		info = (CamelMboxMessageInfo *)camel_folder_summary_index (s, i);
+		info = (CamelMboxMessageInfo *) camel_folder_summary_index (s, i);
 
 		if (!info)
 			continue;
@@ -1134,7 +1134,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 
 		if (camel_mime_parser_tell_start_from (mp) != info->frompos) {
 			g_warning("Didn't get the next message where I expected (%d) got %d instead",
-				  (gint)info->frompos, (gint)camel_mime_parser_tell_start_from (mp));
+				  (gint) info->frompos, (gint) camel_mime_parser_tell_start_from (mp));
 			g_set_error (
 				error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
 				_("Summary and folder mismatch, even after a sync"));
@@ -1148,8 +1148,8 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 			gint read, junk;
 			d(printf("Deleting %s\n", uid));
 
-			if (((CamelLocalSummary *)cls)->index)
-				camel_index_delete_name (((CamelLocalSummary *)cls)->index, uid);
+			if (((CamelLocalSummary *) cls)->index)
+				camel_index_delete_name (((CamelLocalSummary *) cls)->index, uid);
 
 			/* remove it from the change list */
 			junk = flags & CAMEL_MESSAGE_JUNK;
@@ -1163,7 +1163,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 			camel_folder_change_info_remove_uid (changeinfo, uid);
 			camel_folder_summary_remove_index_fast (s, i);
 			del = g_slist_prepend (del, (gpointer) camel_pstring_strdup (uid));
-			camel_message_info_free ((CamelMessageInfo *)info);
+			camel_message_info_free ((CamelMessageInfo *) info);
 			count--;
 			i--;
 			info = NULL;
@@ -1176,7 +1176,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 				write(fdout, "\n", 1);
 #endif
 			info->frompos = lseek (fdout, 0, SEEK_CUR);
-			((CamelMessageInfo *)info)->dirty = TRUE;
+			((CamelMessageInfo *) info)->dirty = TRUE;
 			fromline = camel_mime_parser_from_line (mp);
 			d(printf("Saving %s:%d\n", camel_message_info_uid(info), info->frompos));
 			write (fdout, fromline, strlen (fromline));
@@ -1190,7 +1190,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 				goto error;
 			}
 
-			xevnew = camel_local_summary_encode_x_evolution ((CamelLocalSummary *)cls, &info->info);
+			xevnew = camel_local_summary_encode_x_evolution ((CamelLocalSummary *) cls, &info->info);
 #ifdef STATUS_PINE
 			if (mbs->xstatus) {
 				encode_status (info->info.info.flags & STATUS_STATUS, statnew);
@@ -1227,7 +1227,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 						error, G_IO_ERROR,
 						g_io_error_from_errno (errno),
 						_("Writing to temporary mailbox failed: %s: %s"),
-						((CamelLocalSummary *)cls)->folder_path,
+						((CamelLocalSummary *) cls)->folder_path,
 						g_strerror (errno));
 					goto error;
 				}
@@ -1243,9 +1243,9 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 			}
 
 			d(printf("we are now at %d, from = %d\n", (gint)camel_mime_parser_tell(mp),
-				 (gint)camel_mime_parser_tell_start_from (mp)));
+				 (gint) camel_mime_parser_tell_start_from (mp)));
 			camel_mime_parser_unstep (mp);
-			camel_message_info_free ((CamelMessageInfo *)info);
+			camel_message_info_free ((CamelMessageInfo *) info);
 			info = NULL;
 		}
 	}
@@ -1266,16 +1266,16 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 
 	/* clear working flags */
 	for (i=0; i<count; i++) {
-		info = (CamelMboxMessageInfo *)camel_folder_summary_index (s, i);
+		info = (CamelMboxMessageInfo *) camel_folder_summary_index (s, i);
 		if (info) {
 			if (info->info.info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED|CAMEL_MESSAGE_FOLDER_XEVCHANGE)) {
 				info->info.info.flags &= ~(CAMEL_MESSAGE_FOLDER_NOXEV
 							   |CAMEL_MESSAGE_FOLDER_FLAGGED
 							   |CAMEL_MESSAGE_FOLDER_XEVCHANGE);
-				((CamelMessageInfo *)info)->dirty = TRUE;
+				((CamelMessageInfo *) info)->dirty = TRUE;
 				camel_folder_summary_touch (s);
 			}
-			camel_message_info_free ((CamelMessageInfo *)info);
+			camel_message_info_free ((CamelMessageInfo *) info);
 			info = NULL;
 		}
 	}
@@ -1292,7 +1292,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
 	if (mp)
 		g_object_unref (mp);
 	if (info)
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 
 	camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 
@@ -1314,7 +1314,7 @@ mbox_summary_add (CamelLocalSummary *cls,
 	local_summary_class = CAMEL_LOCAL_SUMMARY_CLASS (camel_mbox_summary_parent_class);
 	mi = (CamelMboxMessageInfo *) local_summary_class->add (
 		cls, msg, info, ci, error);
-	if (mi && ((CamelMboxSummary *)cls)->xstatus) {
+	if (mi && ((CamelMboxSummary *) cls)->xstatus) {
 		gchar status[8];
 
 		/* we snoop and add status/x-status headers to suit */
@@ -1324,7 +1324,7 @@ mbox_summary_add (CamelLocalSummary *cls,
 		camel_medium_set_header((CamelMedium *)msg, "X-Status", status);
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static struct {
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 3d422e7..2fb208f 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -47,7 +47,7 @@ mh_folder_get_filename (CamelFolder *folder,
                         const gchar *uid,
                         GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 
 	return g_strdup_printf("%s/%s", lf->folder_path, uid);
 }
@@ -60,7 +60,7 @@ mh_folder_append_message_sync (CamelFolder *folder,
                                GCancellable *cancellable,
                                GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelStream *output_stream;
 	CamelMessageInfo *mi;
 	gchar *name;
@@ -74,7 +74,7 @@ mh_folder_append_message_sync (CamelFolder *folder,
 		return FALSE;
 
 	/* add it to the summary/assign the uid, etc */
-	mi = camel_local_summary_add ((CamelLocalSummary *)folder->summary, message, info, lf->changes, error);
+	mi = camel_local_summary_add ((CamelLocalSummary *) folder->summary, message, info, lf->changes, error);
 	if (mi == NULL)
 		goto check_changed;
 
@@ -91,7 +91,7 @@ mh_folder_append_message_sync (CamelFolder *folder,
 		goto fail_write;
 
 	if (camel_data_wrapper_write_to_stream_sync (
-		(CamelDataWrapper *)message, output_stream, cancellable, error) == -1
+		(CamelDataWrapper *) message, output_stream, cancellable, error) == -1
 	    || camel_stream_close (output_stream, cancellable, error) == -1)
 		goto fail_write;
 
@@ -138,7 +138,7 @@ mh_folder_get_message_sync (CamelFolder *folder,
                             GCancellable *cancellable,
                             GError **error)
 {
-	CamelLocalFolder *lf = (CamelLocalFolder *)folder;
+	CamelLocalFolder *lf = (CamelLocalFolder *) folder;
 	CamelStream *message_stream = NULL;
 	CamelMimeMessage *message = NULL;
 	CamelMessageInfo *info;
@@ -172,7 +172,7 @@ mh_folder_get_message_sync (CamelFolder *folder,
 
 	message = camel_mime_message_new ();
 	if (!camel_data_wrapper_construct_from_stream_sync (
-		(CamelDataWrapper *)message,
+		(CamelDataWrapper *) message,
 		message_stream, cancellable, error)) {
 		g_prefix_error (
 			error, _("Cannot get message %s from folder %s: "),
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index 0b56280..99d8382 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -80,7 +80,7 @@ folders_update (const gchar *root,
 		goto done;
 	}
 
-	while ((line = camel_stream_buffer_read_line ((CamelStreamBuffer *)in, cancellable, NULL))) {
+	while ((line = camel_stream_buffer_read_line ((CamelStreamBuffer *) in, cancellable, NULL))) {
 		gint copy = TRUE;
 
 		switch (mode) {
@@ -173,10 +173,10 @@ fill_fi (CamelStore *store,
 		   scan of all messages for their status flags.  But its probably not worth
 		   it as we need to read the top of every file, i.e. very very slow */
 
-		root = camel_local_store_get_toplevel_dir ((CamelLocalStore *)store);
+		root = camel_local_store_get_toplevel_dir ((CamelLocalStore *) store);
 		path = g_strdup_printf("%s/%s.ev-summary", root, fi->full_name);
 		folderpath = g_strdup_printf("%s/%s", root, fi->full_name);
-		s = (CamelFolderSummary *)camel_mh_summary_new (NULL, path, folderpath, NULL);
+		s = (CamelFolderSummary *) camel_mh_summary_new (NULL, path, folderpath, NULL);
 		if (camel_folder_summary_header_load_from_db (s, store, fi->full_name, NULL) != -1) {
 			fi->unread = s->unread_count;
 			fi->total = s->saved_count;
@@ -244,7 +244,7 @@ recursive_scan (CamelStore *store,
 		fullpath = alloca (strlen (root) + strlen (path) + 2);
 		sprintf (fullpath, "%s/%s", root, path);
 	} else
-		fullpath = (gchar *)root;
+		fullpath = (gchar *) root;
 
 	if (g_stat (fullpath, &st) == -1 || !S_ISDIR (st.st_mode))
 		return;
@@ -329,7 +329,7 @@ folders_scan (CamelStore *store,
 	visited = g_hash_table_new (g_str_hash, g_str_equal);
 	folders = g_ptr_array_new ();
 
-	while ( (len = camel_stream_buffer_gets ((CamelStreamBuffer *)in, line, sizeof (line), cancellable, NULL)) > 0) {
+	while ( (len = camel_stream_buffer_gets ((CamelStreamBuffer *) in, line, sizeof (line), cancellable, NULL)) > 0) {
 		/* ignore blank lines */
 		if (len <= 1)
 			continue;
@@ -379,7 +379,7 @@ folders_scan (CamelStore *store,
 		*fip = camel_folder_info_build(folders, top, '/', TRUE);
 	g_ptr_array_free (folders, TRUE);
 
-	g_hash_table_foreach (visited, (GHFunc)g_free, NULL);
+	g_hash_table_foreach (visited, (GHFunc) g_free, NULL);
 	g_hash_table_destroy (visited);
 
 	g_object_unref (in);
@@ -478,8 +478,8 @@ mh_store_get_folder_sync (CamelStore *store,
 
 		/* add to .folders if we are supposed to */
 		/* FIXME: throw exception on error */
-		if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS)
-			folders_update (((CamelLocalStore *)store)->toplevel_dir, UPDATE_ADD, folder_name, NULL, cancellable);
+		if (((CamelMhStore *) store)->flags & CAMEL_MH_DOTFOLDERS)
+			folders_update (((CamelLocalStore *) store)->toplevel_dir, UPDATE_ADD, folder_name, NULL, cancellable);
 	} else if (!S_ISDIR (st.st_mode)) {
 		g_set_error (
 			error, CAMEL_STORE_ERROR,
@@ -515,7 +515,7 @@ mh_store_get_folder_info_sync (CamelStore *store,
 	url = camel_service_get_camel_url (CAMEL_SERVICE (store));
 
 	/* use .folders if we are supposed to */
-	if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) {
+	if (((CamelMhStore *) store)->flags & CAMEL_MH_DOTFOLDERS) {
 		folders_scan (
 			store, url->path, top, &fi, flags, cancellable);
 	} else {
@@ -577,8 +577,8 @@ mh_store_delete_folder_sync (CamelStore *store,
 	g_free (name);
 
 	/* remove from .folders if we are supposed to */
-	if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS)
-		folders_update (((CamelLocalStore *)store)->toplevel_dir, UPDATE_REMOVE, folder_name, NULL, cancellable);
+	if (((CamelMhStore *) store)->flags & CAMEL_MH_DOTFOLDERS)
+		folders_update (((CamelLocalStore *) store)->toplevel_dir, UPDATE_REMOVE, folder_name, NULL, cancellable);
 
 	/* Chain up to parent's delete_folder() method. */
 	store_class = CAMEL_STORE_CLASS (camel_mh_store_parent_class);
@@ -601,9 +601,9 @@ mh_store_rename_folder_sync (CamelStore *store,
 		store, old, new, cancellable, error))
 		return FALSE;
 
-	if (((CamelMhStore *)store)->flags & CAMEL_MH_DOTFOLDERS) {
+	if (((CamelMhStore *) store)->flags & CAMEL_MH_DOTFOLDERS) {
 		/* yeah this is messy, but so is mh! */
-		folders_update (((CamelLocalStore *)store)->toplevel_dir, UPDATE_RENAME, old, new, cancellable);
+		folders_update (((CamelLocalStore *) store)->toplevel_dir, UPDATE_RENAME, old, new, cancellable);
 	}
 
 	return TRUE;
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 55c1fc6..fd556fe 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -99,7 +99,7 @@ camel_mh_summary_new (CamelFolder *folder,
 	CamelMhSummary *o;
 
 	o = g_object_new (CAMEL_TYPE_MH_SUMMARY, NULL);
-	((CamelFolderSummary *)o)->folder = folder;
+	((CamelFolderSummary *) o)->folder = folder;
 	if (folder) {
 		CamelStore *parent_store;
 
@@ -109,15 +109,15 @@ camel_mh_summary_new (CamelFolder *folder,
 		((CamelFolderSummary *)o)->collate = "mh_uid_sort";
 	}
 
-	camel_local_summary_construct ((CamelLocalSummary *)o, filename, mhdir, index);
+	camel_local_summary_construct ((CamelLocalSummary *) o, filename, mhdir, index);
 	return o;
 }
 
 static gchar *
 mh_summary_next_uid_string (CamelFolderSummary *s)
 {
-	CamelMhSummary *mhs = (CamelMhSummary *)s;
-	CamelLocalSummary *cls = (CamelLocalSummary *)s;
+	CamelMhSummary *mhs = (CamelMhSummary *) s;
+	CamelLocalSummary *cls = (CamelLocalSummary *) s;
 	gint fd = -1;
 	guint32 uid;
 	gchar *name;
@@ -155,7 +155,7 @@ camel_mh_summary_add (CamelLocalSummary *cls,
                       gint forceindex,
                       GCancellable *cancellable)
 {
-	CamelMhSummary *mhs = (CamelMhSummary *)cls;
+	CamelMhSummary *mhs = (CamelMhSummary *) cls;
 	gchar *filename = g_strdup_printf("%s/%s", cls->folder_path, name);
 	gint fd;
 	CamelMimeParser *mp;
@@ -173,15 +173,15 @@ camel_mh_summary_add (CamelLocalSummary *cls,
 	camel_mime_parser_init_with_fd (mp, fd);
 	if (cls->index && (forceindex || !camel_index_has_name (cls->index, name))) {
 		d(printf("forcing indexing of message content\n"));
-		camel_folder_summary_set_index ((CamelFolderSummary *)mhs, cls->index);
+		camel_folder_summary_set_index ((CamelFolderSummary *) mhs, cls->index);
 	} else {
-		camel_folder_summary_set_index ((CamelFolderSummary *)mhs, NULL);
+		camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
 	}
-	mhs->priv->current_uid = (gchar *)name;
-	camel_folder_summary_add_from_parser ((CamelFolderSummary *)mhs, mp);
+	mhs->priv->current_uid = (gchar *) name;
+	camel_folder_summary_add_from_parser ((CamelFolderSummary *) mhs, mp);
 	g_object_unref (mp);
 	mhs->priv->current_uid = NULL;
-	camel_folder_summary_set_index ((CamelFolderSummary *)mhs, NULL);
+	camel_folder_summary_set_index ((CamelFolderSummary *) mhs, NULL);
 	g_free (filename);
 	return 0;
 }
@@ -194,7 +194,7 @@ remove_summary (gchar *key,
 	d(printf("removing message %s from summary\n", key));
 	if (cls->index)
 		camel_index_delete_name (cls->index, camel_message_info_uid (info));
-	camel_folder_summary_remove ((CamelFolderSummary *)cls, info);
+	camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
 	camel_message_info_free (info);
 }
 
@@ -208,7 +208,7 @@ mh_summary_check (CamelLocalSummary *cls,
 	struct dirent *d;
 	gchar *p, c;
 	CamelMessageInfo *info;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 	GHashTable *left;
 	gint i, count;
 	gint forceindex;
@@ -231,13 +231,13 @@ mh_summary_check (CamelLocalSummary *cls,
 
 	/* keeps track of all uid's that have not been processed */
 	left = g_hash_table_new (g_str_hash, g_str_equal);
-	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *)cls, error);
-	count = camel_folder_summary_count ((CamelFolderSummary *)cls);
+	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *) cls, error);
+	count = camel_folder_summary_count ((CamelFolderSummary *) cls);
 	forceindex = count == 0;
 	for (i=0;i<count;i++) {
-		info = camel_folder_summary_index ((CamelFolderSummary *)cls, i);
+		info = camel_folder_summary_index ((CamelFolderSummary *) cls, i);
 		if (info) {
-			g_hash_table_insert (left, (gchar *)camel_message_info_uid (info), info);
+			g_hash_table_insert (left, (gchar *) camel_message_info_uid (info), info);
 		}
 	}
 
@@ -249,12 +249,12 @@ mh_summary_check (CamelLocalSummary *cls,
 				break;
 		}
 		if (c==0) {
-			info = camel_folder_summary_uid ((CamelFolderSummary *)cls, d->d_name);
+			info = camel_folder_summary_uid ((CamelFolderSummary *) cls, d->d_name);
 			if (info == NULL || (cls->index && (!camel_index_has_name (cls->index, d->d_name)))) {
 				/* need to add this file to the summary */
 				if (info != NULL) {
 					g_hash_table_remove (left, camel_message_info_uid (info));
-					camel_folder_summary_remove ((CamelFolderSummary *)cls, info);
+					camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
 					camel_message_info_free (info);
 				}
 				camel_mh_summary_add (cls, d->d_name, forceindex, cancellable);
@@ -271,7 +271,7 @@ mh_summary_check (CamelLocalSummary *cls,
 		}
 	}
 	closedir (dir);
-	g_hash_table_foreach (left, (GHFunc)remove_summary, cls);
+	g_hash_table_foreach (left, (GHFunc) remove_summary, cls);
 	g_hash_table_destroy (left);
 
 	/* sort the summary based on message number (uid), since the directory order is not useful */
@@ -304,10 +304,10 @@ mh_summary_sync (CamelLocalSummary *cls,
 
 	/* FIXME: need to update/honour .mh_sequences or whatever it is */
 
-	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *)cls, error);
-	count = camel_folder_summary_count ((CamelFolderSummary *)cls);
+	camel_folder_summary_prepare_fetch_all ((CamelFolderSummary *) cls, error);
+	count = camel_folder_summary_count ((CamelFolderSummary *) cls);
 	for (i=count-1;i>=0;i--) {
-		info = (CamelLocalMessageInfo *)camel_folder_summary_index ((CamelFolderSummary *)cls, i);
+		info = (CamelLocalMessageInfo *) camel_folder_summary_index ((CamelFolderSummary *) cls, i);
 		g_assert (info);
 		if (expunge && (info->info.flags & CAMEL_MESSAGE_DELETED)) {
 			uid = camel_message_info_uid (info);
@@ -317,10 +317,10 @@ mh_summary_sync (CamelLocalSummary *cls,
 
 				/* FIXME: put this in folder_summary::remove()? */
 				if (cls->index)
-					camel_index_delete_name (cls->index, (gchar *)uid);
+					camel_index_delete_name (cls->index, (gchar *) uid);
 
 				camel_folder_change_info_remove_uid (changes, uid);
-				camel_folder_summary_remove ((CamelFolderSummary *)cls, (CamelMessageInfo *)info);
+				camel_folder_summary_remove ((CamelFolderSummary *) cls, (CamelMessageInfo *) info);
 			}
 			g_free (name);
 		} else if (info->info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV|CAMEL_MESSAGE_FOLDER_FLAGGED)) {
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index 004e42f..fda7c4b 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -58,8 +58,8 @@ spool_folder_lock (CamelLocalFolder *lf,
                    GError **error)
 {
 	gint retry = 0;
-	CamelMboxFolder *mf = (CamelMboxFolder *)lf;
-	CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
+	CamelMboxFolder *mf = (CamelMboxFolder *) lf;
+	CamelSpoolFolder *sf = (CamelSpoolFolder *) lf;
 	GError *local_error = NULL;
 
 	mf->lockfd = open (lf->folder_path, O_RDWR|O_LARGEFILE, 0);
@@ -101,8 +101,8 @@ spool_folder_lock (CamelLocalFolder *lf,
 static void
 spool_folder_unlock (CamelLocalFolder *lf)
 {
-	CamelMboxFolder *mf = (CamelMboxFolder *)lf;
-	CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
+	CamelMboxFolder *mf = (CamelMboxFolder *) lf;
+	CamelSpoolFolder *sf = (CamelSpoolFolder *) lf;
 
 	camel_lock_helper_unlock (sf->lockid);
 	sf->lockid = -1;
@@ -155,11 +155,11 @@ camel_spool_folder_new (CamelStore *parent_store,
 		folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
 	flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
 
-	folder = (CamelFolder *)camel_local_folder_construct (
-		(CamelLocalFolder *)folder, flags, cancellable, error);
+	folder = (CamelFolder *) camel_local_folder_construct (
+		(CamelLocalFolder *) folder, flags, cancellable, error);
 	if (folder) {
 		if (camel_url_get_param (url, "xstatus"))
-			camel_mbox_summary_xstatus ((CamelMboxSummary *)folder->summary, TRUE);
+			camel_mbox_summary_xstatus ((CamelMboxSummary *) folder->summary, TRUE);
 	}
 
 	g_free (basename);
diff --git a/camel/providers/local/camel-spool-store.c b/camel/providers/local/camel-spool-store.c
index 9a786c7..682009a 100644
--- a/camel/providers/local/camel-spool-store.c
+++ b/camel/providers/local/camel-spool-store.c
@@ -309,7 +309,7 @@ spool_store_get_name (CamelService *service,
 		return g_strdup (url->path);
 	else
 		return g_strdup_printf (
-			((CamelSpoolStore *)service)->type ==
+			((CamelSpoolStore *) service)->type ==
 				CAMEL_SPOOL_STORE_MBOX ?
 			_("Spool mail file %s") :
 			_("Spool folder tree %s"),
@@ -344,7 +344,7 @@ spool_store_get_folder_sync (CamelStore *store,
 	url = camel_service_get_camel_url (CAMEL_SERVICE (store));
 
 	/* we only support an 'INBOX' in mbox mode */
-	if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX) {
+	if (((CamelSpoolStore *) store)->type == CAMEL_SPOOL_STORE_MBOX) {
 		if (strcmp(folder_name, "INBOX") != 0) {
 			g_set_error (
 				error, CAMEL_STORE_ERROR,
@@ -401,7 +401,7 @@ spool_store_get_folder_info_sync (CamelStore *store,
                                   GCancellable *cancellable,
                                   GError **error)
 {
-	if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX)
+	if (((CamelSpoolStore *) store)->type == CAMEL_SPOOL_STORE_MBOX)
 		return get_folder_info_mbox (store, top, flags, cancellable, error);
 	else
 		return get_folder_info_elm (store, top, flags, cancellable, error);
@@ -412,7 +412,7 @@ spool_store_get_inbox_folder_sync (CamelStore *store,
                                    GCancellable *cancellable,
                                    GError **error)
 {
-	if (((CamelSpoolStore *)store)->type == CAMEL_SPOOL_STORE_MBOX)
+	if (((CamelSpoolStore *) store)->type == CAMEL_SPOOL_STORE_MBOX)
 		return spool_store_get_folder_sync (
 			store, "INBOX", CAMEL_STORE_FOLDER_CREATE,
 			cancellable, error);
@@ -458,7 +458,7 @@ static gchar *
 spool_store_get_full_path (CamelLocalStore *ls,
                            const gchar *full_name)
 {
-	if (((CamelSpoolStore *)ls)->type == CAMEL_SPOOL_STORE_MBOX)
+	if (((CamelSpoolStore *) ls)->type == CAMEL_SPOOL_STORE_MBOX)
 		/* a trailing / is always present on toplevel_dir from CamelLocalStore */
 		return g_strndup (ls->toplevel_dir, strlen (ls->toplevel_dir)-1);
 	else
@@ -519,10 +519,10 @@ spool_store_initable_init (GInitable *initable,
 	}
 
 	if (S_ISREG (st.st_mode))
-		((CamelSpoolStore *)service)->type = CAMEL_SPOOL_STORE_MBOX;
+		((CamelSpoolStore *) service)->type = CAMEL_SPOOL_STORE_MBOX;
 	else if (S_ISDIR (st.st_mode))
 		/* we could check here for slight variations */
-		((CamelSpoolStore *)service)->type = CAMEL_SPOOL_STORE_ELM;
+		((CamelSpoolStore *) service)->type = CAMEL_SPOOL_STORE_ELM;
 	else {
 		g_set_error (
 			error, CAMEL_STORE_ERROR,
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index 3dbf398..f8587b3 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -87,7 +87,7 @@ camel_spool_summary_new (CamelFolder *folder,
 	CamelSpoolSummary *new;
 
 	new = g_object_new (CAMEL_TYPE_SPOOL_SUMMARY, NULL);
-	((CamelFolderSummary *)new)->folder = folder;
+	((CamelFolderSummary *) new)->folder = folder;
 	if (folder) {
 		CamelStore *parent_store;
 
@@ -96,8 +96,8 @@ camel_spool_summary_new (CamelFolder *folder,
 		((CamelFolderSummary *)new)->sort_by = "bdata";
 		((CamelFolderSummary *)new)->collate = "spool_frompos_sort";
 	}
-	camel_local_summary_construct ((CamelLocalSummary *)new, NULL, mbox_name, NULL);
-	camel_folder_summary_load_from_db ((CamelFolderSummary *)new, NULL);
+	camel_local_summary_construct ((CamelLocalSummary *) new, NULL, mbox_name, NULL);
+	camel_folder_summary_load_from_db ((CamelFolderSummary *) new, NULL);
 	return new;
 }
 
@@ -130,13 +130,13 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 
 	camel_operation_push_message (cancellable, _("Storing folder"));
 
-	fd = open (((CamelLocalSummary *)cls)->folder_path, O_RDWR|O_LARGEFILE);
+	fd = open (((CamelLocalSummary *) cls)->folder_path, O_RDWR|O_LARGEFILE);
 	if (fd == -1) {
 		g_set_error (
 			error, G_IO_ERROR,
 			g_io_error_from_errno (errno),
 			_("Could not open file: %s: %s"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno));
 		camel_operation_pop_message (cancellable);
 		return -1;
@@ -156,7 +156,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 	}
 
 	if (camel_mbox_summary_sync_mbox (
-		(CamelMboxSummary *)cls, flags, changeinfo,
+		(CamelMboxSummary *) cls, flags, changeinfo,
 		fd, fdout, cancellable, error) == -1)
 		goto error;
 
@@ -167,7 +167,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			error, G_IO_ERROR,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize temporary folder %s: %s"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno));
 		goto error;
 	}
@@ -179,7 +179,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			error, G_IO_ERROR,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize temporary folder %s: %s"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno));
 		goto error;
 	}
@@ -191,7 +191,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			error, G_IO_ERROR,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize temporary folder %s: %s"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno));
 		goto error;
 	}
@@ -209,7 +209,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			error, G_IO_ERROR,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize spool folder %s: %s"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno));
 		/* incase we ran out of room, remove any trailing space first */
 		ftruncate (fd, spoollen);
@@ -242,7 +242,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 				g_io_error_from_errno (errno),
 				_("Could not synchronize spool folder %s: %s\n"
 				  "Folder may be corrupt, copy saved in '%s'"),
-				((CamelLocalSummary *)cls)->folder_path,
+				((CamelLocalSummary *) cls)->folder_path,
 				g_strerror (errno), tmpname);
 			/* so we dont delete it */
 			tmpname[0] = '\0';
@@ -261,7 +261,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize spool folder %s: %s\n"
 			  "Folder may be corrupt, copy saved in '%s'"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno), tmpname);
 		tmpname[0] = '\0';
 		goto error;
@@ -274,7 +274,7 @@ spool_summary_sync_full (CamelMboxSummary *cls,
 			g_io_error_from_errno (errno),
 			_("Could not synchronize spool folder %s: %s\n"
 			  "Folder may be corrupt, copy saved in '%s'"),
-			((CamelLocalSummary *)cls)->folder_path,
+			((CamelLocalSummary *) cls)->folder_path,
 			g_strerror (errno), tmpname);
 		tmpname[0] = '\0';
 		fd = -1;
@@ -312,7 +312,7 @@ spool_summary_check (CamelLocalSummary *cls,
 {
 	gint i, work, count;
 	struct stat st;
-	CamelFolderSummary *s = (CamelFolderSummary *)cls;
+	CamelFolderSummary *s = (CamelFolderSummary *) cls;
 
 	if (CAMEL_LOCAL_SUMMARY_CLASS (camel_spool_summary_parent_class)->check (cls, changeinfo, cancellable, error) == -1)
 		return -1;
@@ -322,10 +322,10 @@ spool_summary_check (CamelLocalSummary *cls,
 	camel_folder_summary_prepare_fetch_all (s, error);
 	count = camel_folder_summary_count (s);
 	for (i=0;!work && i<count; i++) {
-		CamelMboxMessageInfo *info = (CamelMboxMessageInfo *)camel_folder_summary_index (s, i);
+		CamelMboxMessageInfo *info = (CamelMboxMessageInfo *) camel_folder_summary_index (s, i);
 		g_assert (info);
 		work = (info->info.info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV)) != 0;
-		camel_message_info_free ((CamelMessageInfo *)info);
+		camel_message_info_free ((CamelMessageInfo *) info);
 	}
 
 	/* if we do, then write out the headers using sync_full, etc */
@@ -345,8 +345,8 @@ spool_summary_check (CamelLocalSummary *cls,
 			return -1;
 		}
 
-		((CamelMboxSummary *)cls)->folder_size = st.st_size;
-		((CamelFolderSummary *)cls)->time = st.st_mtime;
+		((CamelMboxSummary *) cls)->folder_size = st.st_size;
+		((CamelFolderSummary *) cls)->time = st.st_mtime;
 	}
 
 	return 0;
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index c4aa6ab..9d04891 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -668,7 +668,7 @@ camel_nntp_folder_new (CamelStore *parent,
 		"display-name", folder_name,
 		"full-name", folder_name,
 		"parent-store", parent, NULL);
-	nntp_folder = (CamelNNTPFolder *)folder;
+	nntp_folder = (CamelNNTPFolder *) folder;
 
 	folder->folder_flags |=
 		CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY |
diff --git a/camel/providers/nntp/camel-nntp-provider.c b/camel/providers/nntp/camel-nntp-provider.c
index 73367ba..3210193 100644
--- a/camel/providers/nntp/camel-nntp-provider.c
+++ b/camel/providers/nntp/camel-nntp-provider.c
@@ -109,7 +109,7 @@ add_hash (guint *hash, gchar *s)
 static guint
 nntp_url_hash (gconstpointer key)
 {
-	const CamelURL *u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *) key;
 	guint hash = 0;
 
 	add_hash (&hash, u->user);
diff --git a/camel/providers/nntp/camel-nntp-store-summary.c b/camel/providers/nntp/camel-nntp-store-summary.c
index 0c074ea..6b34c04 100644
--- a/camel/providers/nntp/camel-nntp-store-summary.c
+++ b/camel/providers/nntp/camel-nntp-store-summary.c
@@ -116,11 +116,11 @@ camel_nntp_store_summary_full_name (CamelNNTPStoreSummary *s, const gchar *full_
 
 	count = camel_store_summary_count ((CamelStoreSummary *) s);
 	for (i = 0; i < count; i++) {
-		info = (CamelNNTPStoreInfo *)camel_store_summary_index ((CamelStoreSummary *) s, i);
+		info = (CamelNNTPStoreInfo *) camel_store_summary_index ((CamelStoreSummary *) s, i);
 		if (info) {
 			if (strcmp (info->full_name, full_name) == 0)
 				return info;
-			camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *)info);
+			camel_store_summary_info_free ((CamelStoreSummary *) s, (CamelStoreInfo *) info);
 		}
 	}
 
@@ -262,7 +262,7 @@ camel_nntp_store_summary_add_from_full (CamelNNTPStoreSummary *s, const gchar *f
 	info = (CamelNNTPStoreInfo *) camel_store_summary_add_from_path ((CamelStoreSummary *) s, pathu8);
 	if (info) {
 		d(printf("  '%s' -> '%s'\n", pathu8, full_name));
-		camel_store_info_set_string ((CamelStoreSummary *)s, (CamelStoreInfo *)info, CAMEL_NNTP_STORE_INFO_FULL_NAME, full_name);
+		camel_store_info_set_string ((CamelStoreSummary *) s, (CamelStoreInfo *) info, CAMEL_NNTP_STORE_INFO_FULL_NAME, full_name);
 	} else {
 		d(printf("  failed\n"));
 	}
@@ -321,7 +321,7 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 			camel_store_summary_info_free (s, (CamelStoreInfo *) ni);
 			return NULL;
 		}
-		if (((CamelNNTPStoreSummary *)s)->version >= CAMEL_NNTP_STORE_SUMMARY_VERSION_1) {
+		if (((CamelNNTPStoreSummary *) s)->version >= CAMEL_NNTP_STORE_SUMMARY_VERSION_1) {
 			if (camel_file_util_decode_uint32 (in, &ni->first) == -1
 			    || camel_file_util_decode_uint32 (in, &ni->last) == -1) {
 				camel_store_summary_info_free (s, (CamelStoreInfo *) ni);
@@ -337,7 +337,7 @@ store_info_load (CamelStoreSummary *s, FILE *in)
 static gint
 store_info_save (CamelStoreSummary *s, FILE *out, CamelStoreInfo *mi)
 {
-	CamelNNTPStoreInfo *isi = (CamelNNTPStoreInfo *)mi;
+	CamelNNTPStoreInfo *isi = (CamelNNTPStoreInfo *) mi;
 
 	if (CAMEL_STORE_SUMMARY_CLASS (camel_nntp_store_summary_parent_class)->store_info_save (s, out, mi) == -1
 	    || camel_file_util_encode_string (out, isi->full_name) == -1
@@ -360,7 +360,7 @@ store_info_free (CamelStoreSummary *s, CamelStoreInfo *mi)
 static const gchar *
 store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 {
-	CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
+	CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *) mi;
 
 	/* FIXME: Locks? */
 
@@ -377,7 +377,7 @@ store_info_string (CamelStoreSummary *s, const CamelStoreInfo *mi, gint type)
 static void
 store_info_set_string (CamelStoreSummary *s, CamelStoreInfo *mi, gint type, const gchar *str)
 {
-	CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *)mi;
+	CamelNNTPStoreInfo *nsi = (CamelNNTPStoreInfo *) mi;
 
 	g_assert (mi != NULL);
 
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index c21b13b..e0acb3e 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -720,7 +720,7 @@ nntp_folder_info_from_name (CamelNNTPStore *store,
 static CamelNNTPStoreInfo *
 nntp_store_info_update (CamelNNTPStore *store, gchar *line)
 {
-	CamelStoreSummary *summ = (CamelStoreSummary *)store->summary;
+	CamelStoreSummary *summ = (CamelStoreSummary *) store->summary;
 	CamelURL *base_url;
 	CamelNNTPStoreInfo *si, *fsi;
 	CamelURL *url;
@@ -733,9 +733,9 @@ nntp_store_info_update (CamelNNTPStore *store, gchar *line)
 	if (tmp)
 		*tmp++ = 0;
 
-	fsi = si = (CamelNNTPStoreInfo *)camel_store_summary_path ((CamelStoreSummary *)store->summary, line);
+	fsi = si = (CamelNNTPStoreInfo *) camel_store_summary_path ((CamelStoreSummary *) store->summary, line);
 	if (si == NULL) {
-		si = (CamelNNTPStoreInfo*)camel_store_summary_info_new (summ);
+		si = (CamelNNTPStoreInfo*) camel_store_summary_info_new (summ);
 
 		relpath = g_alloca (strlen (line)+2);
 		sprintf(relpath, "/%s", line);
@@ -745,7 +745,7 @@ nntp_store_info_update (CamelNNTPStore *store, gchar *line)
 
 		si->info.path = g_strdup (line);
 		si->full_name = g_strdup (line); /* why do we keep this? */
-		camel_store_summary_add ((CamelStoreSummary *)store->summary, &si->info);
+		camel_store_summary_add ((CamelStoreSummary *) store->summary, &si->info);
 	} else {
 		first = si->first;
 		last = si->last;
@@ -776,9 +776,9 @@ nntp_store_info_update (CamelNNTPStore *store, gchar *line)
 	si->first = first;
 
 	if (fsi)
-		camel_store_summary_info_free ((CamelStoreSummary *)store->summary, &fsi->info);
+		camel_store_summary_info_free ((CamelStoreSummary *) store->summary, &fsi->info);
 	else			/* TODO see if we really did touch it */
-		camel_store_summary_touch ((CamelStoreSummary *)store->summary);
+		camel_store_summary_touch ((CamelStoreSummary *) store->summary);
 
 	return si;
 }
@@ -811,7 +811,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store,
 
 				folder = (CamelNNTPFolder *)
 					camel_store_get_folder_sync (
-					(CamelStore *)store, si->path,
+					(CamelStore *) store, si->path,
 					0, cancellable, NULL);
 				if (folder) {
 					CamelFolderChangeInfo *changes = NULL;
@@ -998,10 +998,10 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store,
 			}
 		} else if (subscribed_or_flag && first) {
 			/* we have already added subitems, but this item is no longer a subitem */
-			camel_store_summary_info_free ((CamelStoreSummary *)store->summary, si);
+			camel_store_summary_info_free ((CamelStoreSummary *) store->summary, si);
 			break;
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)store->summary, si);
+		camel_store_summary_info_free ((CamelStoreSummary *) store->summary, si);
 	}
 
 	g_hash_table_destroy (known);
@@ -1114,7 +1114,7 @@ nntp_store_get_folder_info_all (CamelNNTPStore *nntp_store,
 			}
 
 			all = g_hash_table_new (g_str_hash, g_str_equal);
-			for (i = 0; (si = (CamelNNTPStoreInfo *)camel_store_summary_index ((CamelStoreSummary *)nntp_store->summary, i)); i++)
+			for (i = 0; (si = (CamelNNTPStoreInfo *) camel_store_summary_index ((CamelStoreSummary *) nntp_store->summary, i)); i++)
 				g_hash_table_insert (all, si->info.path, si);
 
 			while ((ret = camel_nntp_stream_line (nntp_store->stream, &line, &len, cancellable, error)) > 0) {
@@ -1380,7 +1380,7 @@ nntp_store_initable_init (GInitable *initable,
 	g_free (tmp);
 
 	camel_url_free (summary_url);
-	camel_store_summary_load ((CamelStoreSummary *)nntp_store->summary);
+	camel_store_summary_load ((CamelStoreSummary *) nntp_store->summary);
 
 	/* get options */
 	if (camel_url_get_param (url, "show_short_notation"))
@@ -1461,7 +1461,7 @@ camel_nntp_store_init (CamelNNTPStore *nntp_store)
 
 	store->flags = CAMEL_STORE_SUBSCRIPTIONS;
 
-	nntp_store->mem = (CamelStreamMem *)camel_stream_mem_new ();
+	nntp_store->mem = (CamelStreamMem *) camel_stream_mem_new ();
 
 	nntp_store->priv = G_TYPE_INSTANCE_GET_PRIVATE (
 		nntp_store, CAMEL_TYPE_NNTP_STORE, CamelNNTPStorePrivate);
@@ -1499,7 +1499,7 @@ camel_nntp_raw_commandv (CamelNNTPStore *store,
 			switch (c) {
 			case 's':
 				s = va_arg (ap, gchar *);
-				camel_stream_write ((CamelStream *)store->mem, s, strlen (s), NULL, NULL);
+				camel_stream_write ((CamelStream *) store->mem, s, strlen (s), NULL, NULL);
 				break;
 			case 'd':
 				d = va_arg (ap, gint);
@@ -1622,7 +1622,7 @@ camel_nntp_command (CamelNNTPStore *store,
 	guint u;
 	GError *local_error = NULL;
 
-	if (((CamelDiscoStore *)store)->status == CAMEL_DISCO_STORE_OFFLINE) {
+	if (((CamelDiscoStore *) store)->status == CAMEL_DISCO_STORE_OFFLINE) {
 		g_set_error (
 			error, CAMEL_SERVICE_ERROR,
 			CAMEL_SERVICE_ERROR_NOT_CONNECTED,
diff --git a/camel/providers/nntp/camel-nntp-stream.c b/camel/providers/nntp/camel-nntp-stream.c
index bce5b68..91d7bd5 100644
--- a/camel/providers/nntp/camel-nntp-stream.c
+++ b/camel/providers/nntp/camel-nntp-stream.c
@@ -111,7 +111,7 @@ nntp_stream_read (CamelStream *stream,
                   GCancellable *cancellable,
                   GError **error)
 {
-	CamelNNTPStream *is = (CamelNNTPStream *)stream;
+	CamelNNTPStream *is = (CamelNNTPStream *) stream;
 	gchar *o, *oe;
 	guchar *p, *e, c;
 	gint state;
@@ -187,7 +187,7 @@ nntp_stream_write (CamelStream *stream,
                    GCancellable *cancellable,
                    GError **error)
 {
-	CamelNNTPStream *is = (CamelNNTPStream *)stream;
+	CamelNNTPStream *is = (CamelNNTPStream *) stream;
 
 	return camel_stream_write (is->source, buffer, n, cancellable, error);
 }
@@ -213,7 +213,7 @@ nntp_stream_flush (CamelStream *stream,
 static gboolean
 nntp_stream_eos (CamelStream *stream)
 {
-	CamelNNTPStream *is = (CamelNNTPStream *)stream;
+	CamelNNTPStream *is = (CamelNNTPStream *) stream;
 
 	return is->mode != CAMEL_NNTP_STREAM_DATA;
 }
@@ -276,7 +276,7 @@ camel_nntp_stream_new (CamelStream *source)
 	is = g_object_new (CAMEL_TYPE_NNTP_STREAM, NULL);
 	is->source = g_object_ref (source);
 
-	return (CamelStream *)is;
+	return (CamelStream *) is;
 }
 
 /* Get one line from the nntp stream */
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 33d0e0c..e79a979 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -97,10 +97,10 @@ camel_nntp_summary_new (CamelFolder *folder, const gchar *path)
 	CamelNNTPSummary *cns;
 
 	cns = g_object_new (CAMEL_TYPE_NNTP_SUMMARY, NULL);
-	((CamelFolderSummary *)cns)->folder = folder;
+	((CamelFolderSummary *) cns)->folder = folder;
 
-	camel_folder_summary_set_filename ((CamelFolderSummary *)cns, path);
-	camel_folder_summary_set_build_content ((CamelFolderSummary *)cns, FALSE);
+	camel_folder_summary_set_filename ((CamelFolderSummary *) cns, path);
+	camel_folder_summary_set_build_content ((CamelFolderSummary *) cns, FALSE);
 
 	return cns;
 }
@@ -110,13 +110,13 @@ message_info_new_from_header (CamelFolderSummary *s,
                               struct _camel_header_raw *h)
 {
 	CamelMessageInfoBase *mi;
-	CamelNNTPSummary *cns = (CamelNNTPSummary *)s;
+	CamelNNTPSummary *cns = (CamelNNTPSummary *) s;
 
 	/* error to call without this setup */
 	if (cns->priv->uid == NULL)
 		return NULL;
 
-	mi = (CamelMessageInfoBase *)CAMEL_FOLDER_SUMMARY_CLASS (camel_nntp_summary_parent_class)->message_info_new_from_header (s, h);
+	mi = (CamelMessageInfoBase *) CAMEL_FOLDER_SUMMARY_CLASS (camel_nntp_summary_parent_class)->message_info_new_from_header (s, h);
 	if (mi) {
 		camel_pstring_free (mi->uid);
 		mi->uid = camel_pstring_strdup (cns->priv->uid);
@@ -124,7 +124,7 @@ message_info_new_from_header (CamelFolderSummary *s,
 		cns->priv->uid = NULL;
 	}
 
-	return (CamelMessageInfo *)mi;
+	return (CamelMessageInfo *) mi;
 }
 
 static gint
@@ -226,7 +226,7 @@ add_range_xover (CamelNNTPSummary *cns,
 	struct _xover_header *xover;
 	GHashTable *summary_table;
 
-	s = (CamelFolderSummary *)cns;
+	s = (CamelFolderSummary *) cns;
 	summary_table = camel_folder_summary_get_hashtable (s);
 
 	url = camel_service_get_camel_url (CAMEL_SERVICE (store));
@@ -341,7 +341,7 @@ add_range_head (CamelNNTPSummary *cns,
 	CamelMimeParser *mp;
 	GHashTable *summary_table;
 
-	s = (CamelFolderSummary *)cns;
+	s = (CamelFolderSummary *) cns;
 
 	summary_table = camel_folder_summary_get_hashtable (s);
 
@@ -380,7 +380,7 @@ add_range_head (CamelNNTPSummary *cns,
 			line[1] = 0;
 			cns->priv->uid = g_strdup_printf ("%u,%s\n", n, msgid);
 			if (!GPOINTER_TO_INT (g_hash_table_lookup (summary_table, cns->priv->uid))) {
-				if (camel_mime_parser_init_with_stream (mp, (CamelStream *)store->stream, error) == -1)
+				if (camel_mime_parser_init_with_stream (mp, (CamelStream *) store->stream, error) == -1)
 					goto error;
 				mi = camel_folder_summary_add_from_parser (s, mp);
 				while (camel_mime_parser_step (mp, NULL, NULL) != CAMEL_MIME_PARSER_STATE_EOF)
@@ -449,7 +449,7 @@ camel_nntp_summary_check (CamelNNTPSummary *cns,
 	GSList *del = NULL;
 	const gchar *full_name;
 
-	s = (CamelFolderSummary *)cns;
+	s = (CamelFolderSummary *) cns;
 
 	full_name = camel_folder_get_full_name (s->folder);
 	parent_store = camel_folder_get_parent_store (s->folder);
@@ -532,7 +532,7 @@ camel_nntp_summary_check (CamelNNTPSummary *cns,
 update:
 	/* update store summary if we have it */
 	if (folder
-	    && (si = (CamelNNTPStoreInfo *)camel_store_summary_path ((CamelStoreSummary *)store->summary, folder))) {
+	    && (si = (CamelNNTPStoreInfo *) camel_store_summary_path ((CamelStoreSummary *) store->summary, folder))) {
 		guint32 unread = 0;
 
 		count = camel_folder_summary_count (s);
@@ -546,10 +546,10 @@ update:
 			si->info.total = count;
 			si->first = f;
 			si->last = l;
-			camel_store_summary_touch ((CamelStoreSummary *)store->summary);
-			camel_store_summary_save ((CamelStoreSummary *)store->summary);
+			camel_store_summary_touch ((CamelStoreSummary *) store->summary);
+			camel_store_summary_save ((CamelStoreSummary *) store->summary);
 		}
-		camel_store_summary_info_free ((CamelStoreSummary *)store->summary, (CamelStoreInfo *)si);
+		camel_store_summary_info_free ((CamelStoreSummary *) store->summary, (CamelStoreInfo *) si);
 	} else {
 		if (folder)
 			g_warning ("Group '%s' not present in summary", folder);
diff --git a/camel/providers/pop3/camel-pop3-engine.c b/camel/providers/pop3/camel-pop3-engine.c
index b07f302..5d0b8878 100644
--- a/camel/providers/pop3/camel-pop3-engine.c
+++ b/camel/providers/pop3/camel-pop3-engine.c
@@ -134,7 +134,7 @@ camel_pop3_engine_new (CamelStream *source, guint32 flags)
 
 	pe = g_object_new (CAMEL_TYPE_POP3_ENGINE, NULL);
 
-	pe->stream = (CamelPOP3Stream *)camel_pop3_stream_new (source);
+	pe->stream = (CamelPOP3Stream *) camel_pop3_stream_new (source);
 	pe->state = CAMEL_POP3_ENGINE_AUTH;
 	pe->flags = flags;
 
@@ -246,13 +246,13 @@ engine_command_queue (CamelPOP3Engine *pe, CamelPOP3Command *pc)
 {
 	if (((pe->capa & CAMEL_POP3_CAP_PIPE) == 0 || (pe->sentlen + strlen (pc->data)) > CAMEL_POP3_SEND_LIMIT)
 	    && pe->current != NULL) {
-		camel_dlist_addtail (&pe->queue, (CamelDListNode *)pc);
+		camel_dlist_addtail (&pe->queue, (CamelDListNode *) pc);
 		return FALSE;
 	}
 
 	/* ??? */
-	if (camel_stream_write ((CamelStream *)pe->stream, pc->data, strlen (pc->data), NULL, NULL) == -1) {
-		camel_dlist_addtail (&pe->queue, (CamelDListNode *)pc);
+	if (camel_stream_write ((CamelStream *) pe->stream, pc->data, strlen (pc->data), NULL, NULL) == -1) {
+		camel_dlist_addtail (&pe->queue, (CamelDListNode *) pc);
 		return FALSE;
 	}
 
@@ -263,7 +263,7 @@ engine_command_queue (CamelPOP3Engine *pe, CamelPOP3Command *pc)
 	if (pe->current == NULL)
 		pe->current = pc;
 	else
-		camel_dlist_addtail (&pe->active, (CamelDListNode *)pc);
+		camel_dlist_addtail (&pe->active, (CamelDListNode *) pc);
 
 	return TRUE;
 }
@@ -317,14 +317,14 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
 		break;
 	}
 
-	camel_dlist_addtail (&pe->done, (CamelDListNode *)pc);
+	camel_dlist_addtail (&pe->done, (CamelDListNode *) pc);
 	pe->sentlen -= strlen (pc->data);
 
 	/* Set next command */
-	pe->current = (CamelPOP3Command *)camel_dlist_remhead (&pe->active);
+	pe->current = (CamelPOP3Command *) camel_dlist_remhead (&pe->active);
 
 	/* check the queue for sending any we can now send also */
-	pw = (CamelPOP3Command *)pe->queue.head;
+	pw = (CamelPOP3Command *) pe->queue.head;
 	pn = pw->next;
 
 	while (pn) {
@@ -332,10 +332,10 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
 		    && pe->current != NULL)
 			break;
 
-		if (camel_stream_write ((CamelStream *)pe->stream, pw->data, strlen (pw->data), NULL, NULL) == -1)
+		if (camel_stream_write ((CamelStream *) pe->stream, pw->data, strlen (pw->data), NULL, NULL) == -1)
 			goto ioerror;
 
-		camel_dlist_remove ((CamelDListNode *)pw);
+		camel_dlist_remove ((CamelDListNode *) pw);
 
 		pe->sentlen += strlen (pw->data);
 		pw->state = CAMEL_POP3_COMMAND_DISPATCHED;
@@ -343,7 +343,7 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
 		if (pe->current == NULL)
 			pe->current = pw;
 		else
-			camel_dlist_addtail (&pe->active, (CamelDListNode *)pw);
+			camel_dlist_addtail (&pe->active, (CamelDListNode *) pw);
 
 		pw = pn;
 		pn = pn->next;
@@ -357,19 +357,19 @@ camel_pop3_engine_iterate (CamelPOP3Engine *pe, CamelPOP3Command *pcwait)
 	return pe->current==NULL?0:1;
 ioerror:
 	/* we assume all outstanding commands are gunna fail now */
-	while ((pw = (CamelPOP3Command*)camel_dlist_remhead (&pe->active))) {
+	while ((pw = (CamelPOP3Command*) camel_dlist_remhead (&pe->active))) {
 		pw->state = CAMEL_POP3_COMMAND_ERR;
-		camel_dlist_addtail (&pe->done, (CamelDListNode *)pw);
+		camel_dlist_addtail (&pe->done, (CamelDListNode *) pw);
 	}
 
-	while ((pw = (CamelPOP3Command*)camel_dlist_remhead (&pe->queue))) {
+	while ((pw = (CamelPOP3Command*) camel_dlist_remhead (&pe->queue))) {
 		pw->state = CAMEL_POP3_COMMAND_ERR;
-		camel_dlist_addtail (&pe->done, (CamelDListNode *)pw);
+		camel_dlist_addtail (&pe->done, (CamelDListNode *) pw);
 	}
 
 	if (pe->current) {
 		pe->current->state = CAMEL_POP3_COMMAND_ERR;
-		camel_dlist_addtail (&pe->done, (CamelDListNode *)pe->current);
+		camel_dlist_addtail (&pe->done, (CamelDListNode *) pe->current);
 		pe->current = NULL;
 	}
 
@@ -401,7 +401,7 @@ void
 camel_pop3_engine_command_free (CamelPOP3Engine *pe, CamelPOP3Command *pc)
 {
 	if (pe->current != pc)
-		camel_dlist_remove ((CamelDListNode *)pc);
+		camel_dlist_remove ((CamelDListNode *) pc);
 	g_free (pc->data);
 	g_free (pc);
 }
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index ddae12a..724899e 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -94,7 +94,7 @@ cmd_builduid (CamelPOP3Engine *pe,
 
 	checksum = g_checksum_new (G_CHECKSUM_MD5);
 	mp = camel_mime_parser_new ();
-	camel_mime_parser_init_with_stream (mp, (CamelStream *)stream, NULL);
+	camel_mime_parser_init_with_stream (mp, (CamelStream *) stream, NULL);
 	switch (camel_mime_parser_step (mp, NULL, NULL)) {
 	case CAMEL_MIME_PARSER_STATE_HEADER:
 	case CAMEL_MIME_PARSER_STATE_MESSAGE:
@@ -141,11 +141,11 @@ cmd_list (CamelPOP3Engine *pe, CamelPOP3Stream *stream, gpointer data)
 				fi = g_malloc0 (sizeof (*fi));
 				fi->size = size;
 				fi->id = id;
-				fi->index = ((CamelPOP3Folder *)folder)->uids->len;
+				fi->index = ((CamelPOP3Folder *) folder)->uids->len;
 				if ((pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) == 0)
 					fi->cmd = camel_pop3_engine_command_new(pe, CAMEL_POP3_COMMAND_MULTI, cmd_builduid, fi, "TOP %u 0\r\n", id);
-				g_ptr_array_add (((CamelPOP3Folder *)folder)->uids, fi);
-				g_hash_table_insert (((CamelPOP3Folder *)folder)->uids_id, GINT_TO_POINTER (id), fi);
+				g_ptr_array_add (((CamelPOP3Folder *) folder)->uids, fi);
+				g_hash_table_insert (((CamelPOP3Folder *) folder)->uids_id, GINT_TO_POINTER (id), fi);
 			}
 		}
 	} while (ret>0);
@@ -167,7 +167,7 @@ cmd_tocache (CamelPOP3Engine *pe,
 	if ((n = camel_stream_write (fi->stream, "*", 1, NULL, NULL)) == -1)
 		goto done;
 
-	while ((n = camel_stream_read ((CamelStream *)stream, buffer, sizeof (buffer), NULL, NULL)) > 0) {
+	while ((n = camel_stream_read ((CamelStream *) stream, buffer, sizeof (buffer), NULL, NULL)) > 0) {
 		n = camel_stream_write (fi->stream, buffer, n, NULL, NULL);
 		if (n == -1)
 			break;
@@ -200,7 +200,7 @@ static void
 pop3_folder_dispose (GObject *object)
 {
 	CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (object);
-	CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
+	CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **) pop3_folder->uids->pdata;
 	CamelPOP3Store *pop3_store;
 	CamelStore *parent_store;
 	gint i;
@@ -243,7 +243,7 @@ pop3_folder_get_uids (CamelFolder *folder)
 {
 	CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (folder);
 	GPtrArray *uids = g_ptr_array_new ();
-	CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
+	CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **) pop3_folder->uids->pdata;
 	gint i;
 
 	for (i=0;i<pop3_folder->uids->len;i++,fi++) {
@@ -693,7 +693,7 @@ pop3_get_message_time_from_cache (CamelFolder *folder, const gchar *uid, time_t
 
 		message = camel_mime_message_new ();
 		if (!camel_data_wrapper_construct_from_stream_sync (
-			(CamelDataWrapper *)message, stream, NULL, NULL)) {
+			(CamelDataWrapper *) message, stream, NULL, NULL)) {
 			g_warning (_("Cannot get message %s: %s"), uid, g_strerror (errno));
 			g_object_unref (message);
 			message = NULL;
diff --git a/camel/providers/pop3/camel-pop3-provider.c b/camel/providers/pop3/camel-pop3-provider.c
index 1e68c80..80e6f36 100644
--- a/camel/providers/pop3/camel-pop3-provider.c
+++ b/camel/providers/pop3/camel-pop3-provider.c
@@ -128,7 +128,7 @@ add_hash (guint *hash, gchar *s)
 static guint
 pop3_url_hash (gconstpointer key)
 {
-	const CamelURL *u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *) key;
 	guint hash = 0;
 
 	add_hash (&hash, u->user);
diff --git a/camel/providers/pop3/camel-pop3-store.c b/camel/providers/pop3/camel-pop3-store.c
index 27cdfd9..c3bc1d3 100644
--- a/camel/providers/pop3/camel-pop3-store.c
+++ b/camel/providers/pop3/camel-pop3-store.c
@@ -396,7 +396,7 @@ pop3_try_authenticate (CamelService *service,
                        GCancellable *cancellable,
                        GError **error)
 {
-	CamelPOP3Store *store = (CamelPOP3Store *)service;
+	CamelPOP3Store *store = (CamelPOP3Store *) service;
 	CamelPOP3Command *pcu = NULL, *pcp = NULL;
 	CamelURL *url;
 	gint status;
@@ -554,7 +554,7 @@ pop3_store_finalize (GObject *object)
 	/* force disconnect so we dont have it run later, after we've cleaned up some stuff */
 	/* SIGH */
 
-	camel_service_disconnect_sync ((CamelService *)pop3_store, TRUE, NULL);
+	camel_service_disconnect_sync ((CamelService *) pop3_store, TRUE, NULL);
 
 	if (pop3_store->engine)
 		g_object_unref (pop3_store->engine);
@@ -587,7 +587,7 @@ pop3_store_connect_sync (CamelService *service,
                          GCancellable *cancellable,
                          GError **error)
 {
-	CamelPOP3Store *store = (CamelPOP3Store *)service;
+	CamelPOP3Store *store = (CamelPOP3Store *) service;
 	gboolean reprompt = FALSE;
 	CamelURL *url;
 	const gchar *user_data_dir;
diff --git a/camel/providers/pop3/camel-pop3-stream.c b/camel/providers/pop3/camel-pop3-stream.c
index 7c803db..8bbf8eb 100644
--- a/camel/providers/pop3/camel-pop3-stream.c
+++ b/camel/providers/pop3/camel-pop3-stream.c
@@ -100,7 +100,7 @@ stream_read (CamelStream *stream,
              GCancellable *cancellable,
              GError **error)
 {
-	CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
+	CamelPOP3Stream *is = (CamelPOP3Stream *) stream;
 	gchar *o, *oe;
 	guchar *p, *e, c;
 	gint state;
@@ -176,7 +176,7 @@ stream_write (CamelStream *stream,
               GCancellable *cancellable,
               GError **error)
 {
-	CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
+	CamelPOP3Stream *is = (CamelPOP3Stream *) stream;
 
 	if (strncmp (buffer, "PASS ", 5) != 0)
 		dd (printf ("POP3_STREAM_WRITE (%d):\n%.*s\n", (gint)n, (gint)n, buffer));
@@ -207,7 +207,7 @@ stream_flush (CamelStream *stream,
 static gboolean
 stream_eos (CamelStream *stream)
 {
-	CamelPOP3Stream *is = (CamelPOP3Stream *)stream;
+	CamelPOP3Stream *is = (CamelPOP3Stream *) stream;
 
 	return is->mode != CAMEL_POP3_STREAM_DATA;
 }
@@ -270,7 +270,7 @@ camel_pop3_stream_new (CamelStream *source)
 	is = g_object_new (CAMEL_TYPE_POP3_STREAM, NULL);
 	is->source = g_object_ref (source);
 
-	return (CamelStream *)is;
+	return (CamelStream *) is;
 }
 
 /* Get one line from the pop3 stream */
diff --git a/camel/providers/sendmail/camel-sendmail-transport.c b/camel/providers/sendmail/camel-sendmail-transport.c
index 6600ac1..2d39fe7 100644
--- a/camel/providers/sendmail/camel-sendmail-transport.c
+++ b/camel/providers/sendmail/camel-sendmail-transport.c
@@ -158,7 +158,7 @@ sendmail_send_to_sync (CamelTransport *transport,
 		close (nullfd);
 		close (fd[1]);
 
-		execv (SENDMAIL_PATH, (gchar **)argv);
+		execv (SENDMAIL_PATH, (gchar **) argv);
 		_exit (255);
 	}
 	g_free (argv);
diff --git a/camel/providers/smtp/camel-smtp-provider.c b/camel/providers/smtp/camel-smtp-provider.c
index 7a1df0b..b4bd7d5 100644
--- a/camel/providers/smtp/camel-smtp-provider.c
+++ b/camel/providers/smtp/camel-smtp-provider.c
@@ -88,7 +88,7 @@ add_hash (guint *hash, gchar *s)
 static guint
 smtp_url_hash (gconstpointer key)
 {
-	const CamelURL *u = (CamelURL *)key;
+	const CamelURL *u = (CamelURL *) key;
 	guint hash = 0;
 
 	add_hash (&hash, u->user);
diff --git a/camel/tests/folder/test11.c b/camel/tests/folder/test11.c
index 021eb66..de497ce 100644
--- a/camel/tests/folder/test11.c
+++ b/camel/tests/folder/test11.c
@@ -41,8 +41,8 @@ static CamelFolderInfo fi_list_3[] = {
 static gint
 cmp_fi (gconstpointer a, gconstpointer b)
 {
-	const CamelFolderInfo *fa = ((const CamelFolderInfo **)a)[0];
-	const CamelFolderInfo *fb = ((const CamelFolderInfo **)b)[0];
+	const CamelFolderInfo *fa = ((const CamelFolderInfo **) a)[0];
+	const CamelFolderInfo *fb = ((const CamelFolderInfo **) b)[0];
 
 	return strcmp (fa->full_name, fb->full_name);
 }
diff --git a/camel/tests/folder/test8.c b/camel/tests/folder/test8.c
index 14264b9..75ed44d 100644
--- a/camel/tests/folder/test8.c
+++ b/camel/tests/folder/test8.c
@@ -78,14 +78,14 @@ worker (gpointer d)
 
 		push ("getting message '%s'", res->pdata[0]);
 		msg = camel_folder_get_message_sync (
-			info->folder, (gchar *)res->pdata[0], NULL, &error);
+			info->folder, (gchar *) res->pdata[0], NULL, &error);
 		check_msg (error == NULL, "%s", error->message);
 		g_clear_error (&error);
 		pull ();
 
 		content = g_strdup_printf ("Test message %08x contents\n\n", id+i);
 		push ("comparing content '%s': '%s'", res->pdata[0], content);
-		test_message_compare_content (camel_medium_get_content ((CamelMedium *)msg), content, strlen (content));
+		test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg), content, strlen (content));
 		test_free (content);
 		pull ();
 
diff --git a/camel/tests/lib/camel-test.c b/camel/tests/lib/camel-test.c
index 3344d2a..c57dabc 100644
--- a/camel/tests/lib/camel-test.c
+++ b/camel/tests/lib/camel-test.c
@@ -63,7 +63,7 @@ die (gint sig)
 	if (!indie) {
 		indie = 1;
 		printf("\n\nReceived fatal signal %d\n", sig);
-		g_hash_table_foreach (info_table, (GHFunc)dump_action, 0);
+		g_hash_table_foreach (info_table, (GHFunc) dump_action, 0);
 
 		if (camel_test_verbose > 2) {
 			printf("Attach debugger to pid %d to debug\n", getpid());
@@ -249,7 +249,7 @@ void camel_test_failv (const gchar *why, va_list ap)
 
 	if ((s->nonfatal == 0 && camel_test_verbose > 0)
 	    || (s->nonfatal && camel_test_verbose > 2)) {
-		g_hash_table_foreach (info_table, (GHFunc)dump_action, 0);
+		g_hash_table_foreach (info_table, (GHFunc) dump_action, 0);
 	}
 
 	if (s->nonfatal == 0) {
diff --git a/camel/tests/lib/messages.c b/camel/tests/lib/messages.c
index 0e2d03d..27c4140 100644
--- a/camel/tests/lib/messages.c
+++ b/camel/tests/lib/messages.c
@@ -16,10 +16,10 @@ test_message_create_simple (void)
 	addr = camel_internet_address_new ();
 	camel_internet_address_add (addr, "Michael Zucchi", "zed nowhere com");
 	camel_mime_message_set_from (msg, addr);
-	camel_address_remove ((CamelAddress *)addr, -1);
+	camel_address_remove ((CamelAddress *) addr, -1);
 	camel_internet_address_add (addr, "POSTMASTER", "POSTMASTER somewhere net");
 	camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_TO, addr);
-	camel_address_remove ((CamelAddress *)addr, -1);
+	camel_address_remove ((CamelAddress *) addr, -1);
 	camel_internet_address_add (addr, "Michael Zucchi", "zed nowhere com");
 	camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_CC, addr);
 
@@ -50,24 +50,24 @@ test_message_set_content_simple (CamelMimePart *part, gint how, const gchar *typ
 		camel_mime_part_set_content (part, text, len, type);
 		break;
 	case 1:
-		content = (CamelStreamMem *)camel_stream_mem_new_with_buffer (text, len);
+		content = (CamelStreamMem *) camel_stream_mem_new_with_buffer (text, len);
 		break;
 	case 2:
-		content = (CamelStreamMem *)camel_stream_mem_new ();
+		content = (CamelStreamMem *) camel_stream_mem_new ();
 		camel_stream_mem_set_buffer (content, text, len);
 		break;
 	case 3:
 		ba = g_byte_array_new ();
 		g_byte_array_append (ba, (guint8 *) text, len);
 
-		content = (CamelStreamMem *)camel_stream_mem_new_with_byte_array (ba);
+		content = (CamelStreamMem *) camel_stream_mem_new_with_byte_array (ba);
 		ba = NULL;
 		break;
 	case 4:
 		ba = g_byte_array_new ();
 		g_byte_array_append (ba, (guint8 *) text, len);
 
-		content = (CamelStreamMem *)camel_stream_mem_new ();
+		content = (CamelStreamMem *) camel_stream_mem_new ();
 		camel_stream_mem_set_byte_array (content, ba);
 
 		g_object_weak_ref (
@@ -81,8 +81,8 @@ test_message_set_content_simple (CamelMimePart *part, gint how, const gchar *typ
 		camel_data_wrapper_set_mime_type (dw, type);
 
 		camel_data_wrapper_construct_from_stream_sync (
-			dw, (CamelStream *)content, NULL, NULL);
-		camel_medium_set_content ((CamelMedium *)part, dw);
+			dw, (CamelStream *) content, NULL, NULL);
+		camel_medium_set_content ((CamelMedium *) part, dw);
 
 		check_unref (content, 2);
 		check_unref (dw, 2);
@@ -267,7 +267,7 @@ message_dump_rec (CamelMimeMessage *msg, CamelMimePart *part, gint depth)
 	memset (s, ' ', depth);
 	s[depth] = 0;
 
-	mime_type = camel_data_wrapper_get_mime_type ((CamelDataWrapper *)part);
+	mime_type = camel_data_wrapper_get_mime_type ((CamelDataWrapper *) part);
 	printf ("%sPart <%s>\n", s, G_OBJECT_TYPE_NAME (part));
 	printf ("%sContent-Type: %s\n", s, mime_type);
 	g_free (mime_type);
@@ -294,12 +294,12 @@ message_dump_rec (CamelMimeMessage *msg, CamelMimePart *part, gint depth)
 			message_dump_rec (msg, part, depth+1);
 		}
 	} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
-		message_dump_rec (msg, (CamelMimePart *)containee, depth+1);
+		message_dump_rec (msg, (CamelMimePart *) containee, depth+1);
 	}
 }
 
 void
 test_message_dump_structure (CamelMimeMessage *m)
 {
-	message_dump_rec (m, (CamelMimePart *)m, 0);
+	message_dump_rec (m, (CamelMimePart *) m, 0);
 }
diff --git a/camel/tests/message/test1.c b/camel/tests/message/test1.c
index bb925fd..0fc7522 100644
--- a/camel/tests/message/test1.c
+++ b/camel/tests/message/test1.c
@@ -127,7 +127,7 @@ main (gint argc, gchar **argv)
 			pull ();
 
 			push("compare original content");
-			test_message_compare_content (camel_medium_get_content ((CamelMedium *)msg), text, len);
+			test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg), text, len);
 			pull ();
 
 			push("save message to test1.msg");
@@ -141,7 +141,7 @@ main (gint argc, gchar **argv)
 			pull ();
 
 			push("compare read with original content");
-			test_message_compare_content (camel_medium_get_content ((CamelMedium *)msg2), text, len);
+			test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg2), text, len);
 			check_unref (msg2, 1);
 			pull ();
 
@@ -167,7 +167,7 @@ main (gint argc, gchar **argv)
 			test_message_set_content_simple((CamelMimePart *)msg, 0, "text/plain", text, len);
 			pull ();
 
-			camel_mime_part_set_encoding ((CamelMimePart *)msg, i);
+			camel_mime_part_set_encoding ((CamelMimePart *) msg, i);
 
 			push("save message to test1.msg");
 			unlink("test1.msg");
@@ -180,7 +180,7 @@ main (gint argc, gchar **argv)
 			pull ();
 
 			push("compare read with original content");
-			test_message_compare_content (camel_medium_get_content ((CamelMedium *)msg2), text, len);
+			test_message_compare_content (camel_medium_get_content ((CamelMedium *) msg2), text, len);
 			check_unref (msg2, 1);
 			pull ();
 
diff --git a/camel/tests/message/test3.c b/camel/tests/message/test3.c
index 8e1e0ff..751a016 100644
--- a/camel/tests/message/test3.c
+++ b/camel/tests/message/test3.c
@@ -28,7 +28,7 @@ gint main (gint argc, gchar **argv)
 	camel_multipart_set_boundary(mp, "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D");
 	check(strcmp(camel_multipart_get_boundary(mp), "_=,.XYZ_Kangaroo_Meat_is_!_ABADF00D") == 0);
 
-	camel_medium_set_content ((CamelMedium *)msg, (CamelDataWrapper *)mp);
+	camel_medium_set_content ((CamelMedium *) msg, (CamelDataWrapper *) mp);
 	check (camel_multipart_get_number (mp) == 0);
 	check (camel_multipart_get_part (mp, 0) == NULL);
 	check (camel_multipart_get_part (mp, 1) == NULL);
@@ -100,7 +100,7 @@ gint main (gint argc, gchar **argv)
 	pull ();
 
 	push("compre content of multipart");
-	mp2 = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)msg2);
+	mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg2);
 	check (mp2 != NULL);
 	check (CAMEL_IS_MULTIPART (mp2));
 	check (camel_multipart_get_number (mp2) == 3);
@@ -127,7 +127,7 @@ gint main (gint argc, gchar **argv)
 	msg3 = test_message_read_file("test3-2.msg");
 
 	push("comparing again");
-	mp2 = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)msg3);
+	mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg3);
 	check (mp2 != NULL);
 	check (CAMEL_IS_MULTIPART (mp2));
 	check (camel_multipart_get_number (mp2) == 3);
@@ -161,7 +161,7 @@ gint main (gint argc, gchar **argv)
 	test_message_write_file(msg, "test3-3.msg");
 	msg2 = test_message_read_file("test3-3.msg");
 
-	mp2 = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)msg2);
+	mp2 = (CamelMultipart *) camel_medium_get_content ((CamelMedium *) msg2);
 	check (mp2 != NULL);
 	check (CAMEL_IS_MULTIPART (mp2));
 	check (camel_multipart_get_number (mp2) == 3);
diff --git a/camel/tests/mime-filter/test-tohtml.c b/camel/tests/mime-filter/test-tohtml.c
index 316fee7..7e8ad74 100644
--- a/camel/tests/mime-filter/test-tohtml.c
+++ b/camel/tests/mime-filter/test-tohtml.c
@@ -49,7 +49,7 @@ test_filter (CamelMimeFilter *f, const gchar *inname, const gchar *outname)
 
 	filter = camel_stream_filter_new (indisk);
 	check_count (indisk, 2);
-	id = camel_stream_filter_add ((CamelStreamFilter *)filter, f);
+	id = camel_stream_filter_add ((CamelStreamFilter *) filter, f);
 	check_count (f, 2);
 
 	check (camel_stream_write_to_stream (filter, in, NULL, NULL) > 0);
@@ -60,7 +60,7 @@ test_filter (CamelMimeFilter *f, const gchar *inname, const gchar *outname)
 
 	camel_test_pull ();
 
-	camel_stream_filter_remove ((CamelStreamFilter *)filter, id);
+	camel_stream_filter_remove ((CamelStreamFilter *) filter, id);
 	check_count (f, 1);
 	camel_mime_filter_reset (f);
 
@@ -77,7 +77,7 @@ test_filter (CamelMimeFilter *f, const gchar *inname, const gchar *outname)
 	in = camel_stream_mem_new_with_byte_array (byte_array_in);
 	filter = camel_stream_filter_new (in);
 	check_count (in, 2);
-	id = camel_stream_filter_add ((CamelStreamFilter *)filter, f);
+	id = camel_stream_filter_add ((CamelStreamFilter *) filter, f);
 	check_count (f, 2);
 
 	check (camel_stream_write_to_stream (indisk, filter, NULL, NULL) > 0);
@@ -87,7 +87,7 @@ test_filter (CamelMimeFilter *f, const gchar *inname, const gchar *outname)
 		  "Buffer content mismatch, %d != %d, in = '%.*s' != out = '%.*s'", byte_array_in->len, byte_array_out->len,
 		  byte_array_in->len, byte_array_in->data, byte_array_out->len, byte_array_out->data);
 
-	camel_stream_filter_remove ((CamelStreamFilter *)filter, id);
+	camel_stream_filter_remove ((CamelStreamFilter *) filter, id);
 	check_unref (filter, 1);
 	check_unref (in, 1);
 	check_unref (indisk, 1);
diff --git a/camel/tests/smime/pgp.c b/camel/tests/smime/pgp.c
index be60920..62ef64c 100644
--- a/camel/tests/smime/pgp.c
+++ b/camel/tests/smime/pgp.c
@@ -136,7 +136,7 @@ gint main (gint argc, gchar **argv)
 	dw = camel_data_wrapper_new ();
 	camel_data_wrapper_construct_from_stream_sync (
 		dw, stream1, NULL, NULL);
-	camel_medium_set_content ((CamelMedium *)conpart, dw);
+	camel_medium_set_content ((CamelMedium *) conpart, dw);
 	g_object_unref (stream1);
 	g_object_unref (dw);
 
@@ -176,7 +176,7 @@ gint main (gint argc, gchar **argv)
 	camel_stream_reset (stream1, NULL);
 	camel_data_wrapper_construct_from_stream_sync (
 		dw, stream1, NULL, NULL);
-	camel_medium_set_content ((CamelMedium *)conpart, dw);
+	camel_medium_set_content ((CamelMedium *) conpart, dw);
 	g_object_unref (stream1);
 	g_object_unref (dw);
 
diff --git a/libebackend/e-data-server-module.c b/libebackend/e-data-server-module.c
index 5495845..4630081 100644
--- a/libebackend/e-data-server-module.c
+++ b/libebackend/e-data-server-module.c
@@ -294,7 +294,7 @@ e_data_server_module_add_type (GType type)
 
 	object = g_object_new (type, NULL);
 	g_object_weak_ref (object,
-			   (GWeakNotify)module_object_weak_notify,
+			   (GWeakNotify) module_object_weak_notify,
 			   NULL);
 
 	module_objects = g_list_prepend (module_objects, object);
diff --git a/libebackend/e-dbhash.c b/libebackend/e-dbhash.c
index 7528caf..cb967c0 100644
--- a/libebackend/e-dbhash.c
+++ b/libebackend/e-dbhash.c
@@ -69,7 +69,7 @@ static void
 string_to_dbt (const gchar *str, DBT *dbt)
 {
 	memset (dbt, 0, sizeof (DBT));
-	dbt->data = (gpointer)str;
+	dbt->data = (gpointer) str;
 	dbt->size = strlen (str) + 1;
 }
 
@@ -77,7 +77,7 @@ static void
 md5_to_dbt (const guint8 str[16], DBT *dbt)
 {
 	memset (dbt, 0, sizeof (DBT));
-	dbt->data = (gpointer)str;
+	dbt->data = (gpointer) str;
 	dbt->size = 16;
 }
 
@@ -191,7 +191,7 @@ e_dbhash_foreach_key (EDbHash *edbh,
 	db_error = dbc->c_get (dbc, &dkey, &ddata, DB_FIRST);
 
 	while (db_error == 0) {
-		(*func) ((const gchar *)dkey.data, user_data);
+		(*func) ((const gchar *) dkey.data, user_data);
 
 		db_error = dbc->c_get (dbc, &dkey, &ddata, DB_NEXT);
 	}
diff --git a/libebackend/e-offline-listener.c b/libebackend/e-offline-listener.c
index f0e1575..2f5064f 100644
--- a/libebackend/e-offline-listener.c
+++ b/libebackend/e-offline-listener.c
@@ -100,7 +100,7 @@ setup_offline_listener (EOfflineListener *eol)
 	priv->default_client = gconf_client_get_default ();
 	gconf_client_add_dir (priv->default_client, "/apps/evolution/shell", GCONF_CLIENT_PRELOAD_RECURSIVE,NULL);
 	gconf_client_notify_add (priv->default_client, "/apps/evolution/shell/start_offline",
-				 (GConfClientNotifyFunc)online_status_changed,
+				 (GConfClientNotifyFunc) online_status_changed,
 				 eol, NULL, NULL);
 
 	priv->is_offline_now = gconf_client_get_bool (priv->default_client, "/apps/evolution/shell/start_offline", NULL);
diff --git a/libedataserver/e-account-list.c b/libedataserver/e-account-list.c
index 8427731..259f007 100644
--- a/libedataserver/e-account-list.c
+++ b/libedataserver/e-account-list.c
@@ -141,7 +141,7 @@ gconf_accounts_changed (GConfClient *client, guint cnxn_id,
 		for (iter = e_list_get_iterator (old_accounts);
 		     e_iterator_is_valid (iter);
 		     e_iterator_next (iter)) {
-			account = (EAccount *)e_iterator_get (iter);
+			account = (EAccount *) e_iterator_get (iter);
 			if (!strcmp (account->uid, uid)) {
 				/* The account still exists, so remove
 				 * it from "old_accounts" and update it.
@@ -185,7 +185,7 @@ gconf_accounts_changed (GConfClient *client, guint cnxn_id,
 	for (iter = e_list_get_iterator (old_accounts);
 	     e_iterator_is_valid (iter);
 	     e_iterator_next (iter)) {
-		account = (EAccount *)e_iterator_get (iter);
+		account = (EAccount *) e_iterator_get (iter);
 		e_list_remove (E_LIST (account_list), account);
 		g_signal_emit (account_list, signals[ACCOUNT_REMOVED], 0, account);
 	}
@@ -196,7 +196,7 @@ gconf_accounts_changed (GConfClient *client, guint cnxn_id,
 static gpointer
 copy_func (gconstpointer data, gpointer closure)
 {
-	GObject *object = (GObject *)data;
+	GObject *object = (GObject *) data;
 
 	g_object_ref (object);
 	return object;
@@ -276,7 +276,7 @@ e_account_list_save (EAccountList *account_list)
 	for (iter = e_list_get_iterator (E_LIST (account_list));
 	     e_iterator_is_valid (iter);
 	     e_iterator_next (iter)) {
-		account = (EAccount *)e_iterator_get (iter);
+		account = (EAccount *) e_iterator_get (iter);
 
 		xmlbuf = e_account_to_xml (account);
 		if (xmlbuf)
@@ -305,7 +305,7 @@ e_account_list_prune_proxies (EAccountList *account_list)
 	for (iter = e_list_get_iterator (E_LIST (account_list));
 	     e_iterator_is_valid (iter);
 	     e_iterator_next (iter)) {
-		account = (EAccount *)e_iterator_get (iter);
+		account = (EAccount *) e_iterator_get (iter);
 		if (account->parent_uid)
 			e_account_list_remove (account_list, account);
 	}
@@ -319,7 +319,7 @@ e_account_list_remove_account_proxies (EAccountList *accounts, EAccount *account
 {
 	EAccount *child_account;
 
-	while ( (child_account = (EAccount *)e_account_list_find (accounts, E_ACCOUNT_FIND_PARENT_UID, account->uid))) {
+	while ( (child_account = (EAccount *) e_account_list_find (accounts, E_ACCOUNT_FIND_PARENT_UID, account->uid))) {
 		e_account_list_remove (accounts, child_account);
 		child_account = NULL;
 	}
@@ -431,7 +431,7 @@ e_account_list_get_default (EAccountList *account_list)
 
 	if (uid) {
 		for (;e_iterator_is_valid (it);e_iterator_next (it)) {
-			account = (const EAccount *)e_iterator_get (it);
+			account = (const EAccount *) e_iterator_get (it);
 
 			if (!strcmp (uid, account->uid))
 				break;
@@ -504,12 +504,12 @@ e_account_list_find (EAccountList *account_list,
 	if (!key)
 		return NULL;
 
-	for (it = e_list_get_iterator ((EList *)account_list);
+	for (it = e_list_get_iterator ((EList *) account_list);
 	     e_iterator_is_valid (it);
 	     e_iterator_next (it)) {
 		gint found = 0;
 
-		account = (const EAccount *)e_iterator_get (it);
+		account = (const EAccount *) e_iterator_get (it);
 
 		switch (type) {
 		case E_ACCOUNT_FIND_NAME:
diff --git a/libedataserver/e-account.c b/libedataserver/e-account.c
index 49cda3b..fc3bee7 100644
--- a/libedataserver/e-account.c
+++ b/libedataserver/e-account.c
@@ -214,7 +214,7 @@ xml_set_bool (xmlNodePtr node, const gchar *name, gboolean *val)
 	gboolean bool;
 	xmlChar *buf;
 
-	if ((buf = xmlGetProp (node, (xmlChar*)name))) {
+	if ((buf = xmlGetProp (node, (xmlChar*) name))) {
 		bool = (!strcmp ((gchar *)buf, "true") || !strcmp ((gchar *)buf, "yes"));
 		xmlFree (buf);
 
@@ -233,8 +233,8 @@ xml_set_int (xmlNodePtr node, const gchar *name, gint *val)
 	gint number;
 	xmlChar *buf;
 
-	if ((buf = xmlGetProp (node, (xmlChar*)name))) {
-		number = strtol ((gchar *)buf, NULL, 10);
+	if ((buf = xmlGetProp (node, (xmlChar*) name))) {
+		number = strtol ((gchar *) buf, NULL, 10);
 		xmlFree (buf);
 
 		if (number != *val) {
@@ -252,7 +252,7 @@ xml_set_prop (xmlNodePtr node, const gchar *name, gchar **val)
 	xmlChar *buf;
 	gint res;
 
-	buf = xmlGetProp (node, (xmlChar*)name);
+	buf = xmlGetProp (node, (xmlChar*) name);
 	if (buf == NULL) {
 		res = (*val != NULL);
 		if (res) {
@@ -260,7 +260,7 @@ xml_set_prop (xmlNodePtr node, const gchar *name, gchar **val)
 			*val = NULL;
 		}
 	} else {
-		res = *val == NULL || strcmp (*val, (gchar *)buf) != 0;
+		res = *val == NULL || strcmp (*val, (gchar *) buf) != 0;
 		if (res) {
 			g_free (*val);
 			*val = g_strdup((gchar *)buf);
@@ -299,7 +299,7 @@ receipt_policy_to_str (EAccountReceiptPolicy val)
 		break;
 	}
 
-	return (xmlChar*)ret;
+	return (xmlChar*) ret;
 }
 
 static gboolean
@@ -308,7 +308,7 @@ xml_set_receipt_policy (xmlNodePtr node, const gchar *name, EAccountReceiptPolic
 	EAccountReceiptPolicy new_val;
 	xmlChar *buf;
 
-	if ((buf = xmlGetProp (node, (xmlChar*)name))) {
+	if ((buf = xmlGetProp (node, (xmlChar*) name))) {
 		new_val = str_to_receipt_policy (buf);
 		xmlFree (buf);
 
@@ -335,7 +335,7 @@ xml_set_content (xmlNodePtr node, gchar **val)
 			*val = NULL;
 		}
 	} else {
-		res = *val == NULL || strcmp (*val, (gchar *)buf) != 0;
+		res = *val == NULL || strcmp (*val, (gchar *) buf) != 0;
 		if (res) {
 			g_free (*val);
 			*val = g_strdup((gchar *)buf);
@@ -516,7 +516,7 @@ e_account_set_from_xml (EAccount *account, const gchar *xml)
 	xmlDocPtr doc;
 	gboolean changed = FALSE;
 
-	if (!(doc = xmlParseDoc ((xmlChar*)xml)))
+	if (!(doc = xmlParseDoc ((xmlChar*) xml)))
 		return FALSE;
 
 	node = doc->children;
@@ -799,7 +799,7 @@ e_account_uid_from_xml (const gchar *xml)
 	xmlDocPtr doc;
 	gchar *uid = NULL;
 
-	if (!(doc = xmlParseDoc ((xmlChar *)xml)))
+	if (!(doc = xmlParseDoc ((xmlChar *) xml)))
 		return NULL;
 
 	node = doc->children;
@@ -967,7 +967,7 @@ ea_setting_setup (void)
 
 	ea_system_table = g_hash_table_new (g_str_hash, g_str_equal);
 	for (i = 0; i < G_N_ELEMENTS (system_perms); i++) {
-		g_hash_table_insert (ea_system_table, (gchar *)system_perms[i].key, &system_perms[i]);
+		g_hash_table_insert (ea_system_table, (gchar *) system_perms[i].key, &system_perms[i]);
 		sprintf(key, LOCK_BASE "/%s", system_perms[i].key);
 		entry = gconf_client_get_entry (gconf, key, NULL, TRUE, &err);
 		if (entry) {
@@ -981,35 +981,35 @@ ea_setting_setup (void)
 		g_error_free (err);
 	}
 
-	gconf_client_notify_add (gconf, LOCK_BASE, (GConfClientNotifyFunc)ea_setting_notify, NULL, NULL, NULL);
+	gconf_client_notify_add (gconf, LOCK_BASE, (GConfClientNotifyFunc) ea_setting_notify, NULL, NULL, NULL);
 	g_object_unref (gconf);
 }
 
 /* look up the item in the structure or the substructure using our table of reflection data */
 #define addr(ea, type) \
 	((account_info[type].type & TYPE_STRUCT)? \
-	(((gchar **)(((gchar *)ea)+account_info[type].offset))[0] + account_info[type].struct_offset): \
-	(((gchar *)ea)+account_info[type].offset))
+	(((gchar **)(((gchar *) ea)+account_info[type].offset))[0] + account_info[type].struct_offset): \
+	(((gchar *) ea)+account_info[type].offset))
 
 const gchar *
 e_account_get_string (EAccount *ea, e_account_item_t type)
 {
 	g_return_val_if_fail (ea != NULL, NULL);
-	return *((const gchar **)addr (ea, type));
+	return *((const gchar **) addr (ea, type));
 }
 
 gint
 e_account_get_int (EAccount *ea, e_account_item_t type)
 {
 	g_return_val_if_fail (ea != NULL, 0);
-	return *((gint *)addr (ea, type));
+	return *((gint *) addr (ea, type));
 }
 
 gboolean
 e_account_get_bool (EAccount *ea, e_account_item_t type)
 {
 	g_return_val_if_fail (ea != NULL, FALSE);
-	return *((gboolean *)addr (ea, type));
+	return *((gboolean *) addr (ea, type));
 }
 
 #if d(!)0
@@ -1036,7 +1036,7 @@ e_account_set_string (EAccount *ea, e_account_item_t type, const gchar *val)
 	if (!e_account_writable (ea, type)) {
 		g_warning("Trying to set non-writable option account value");
 	} else {
-		p = (gchar **)addr (ea, type);
+		p = (gchar **) addr (ea, type);
 		d(printf("Setting string %d: old '%s' new '%s'\n", type, *p, val));
 		if (*p != val
 		    && (*p == NULL || val == NULL || strcmp (*p, val) != 0)) {
@@ -1056,7 +1056,7 @@ e_account_set_int (EAccount *ea, e_account_item_t type, gint val)
 	if (!e_account_writable (ea, type)) {
 		g_warning("Trying to set non-writable option account value");
 	} else {
-		gint *p = (gint *)addr (ea, type);
+		gint *p = (gint *) addr (ea, type);
 
 		if (*p != val) {
 			*p = val;
@@ -1074,7 +1074,7 @@ e_account_set_bool (EAccount *ea, e_account_item_t type, gboolean val)
 	if (!e_account_writable (ea, type)) {
 		g_warning("Trying to set non-writable option account value");
 	} else {
-		gboolean *p = (gboolean *)addr (ea, type);
+		gboolean *p = (gboolean *) addr (ea, type);
 
 		if (*p != val) {
 			*p = val;
diff --git a/libedataserver/e-data-server-util.c b/libedataserver/e-data-server-util.c
index 0c62df7..af7deac 100644
--- a/libedataserver/e-data-server-util.c
+++ b/libedataserver/e-data-server-util.c
@@ -411,7 +411,7 @@ e_util_utf8_remove_accents (const gchar *str)
 		return g_strdup (str);
 
 	for (i = 0, j = 0; res[i]; i++) {
-		if ((guchar)res[i] != 0xCC || res[i + 1] == 0) {
+		if ((guchar) res[i] != 0xCC || res[i + 1] == 0) {
 			res[j] = res[i];
 			j++;
 		} else {
diff --git a/libedataserver/e-list.c b/libedataserver/e-list.c
index b3504b7..53fc275 100644
--- a/libedataserver/e-list.c
+++ b/libedataserver/e-list.c
@@ -124,7 +124,7 @@ e_list_remove_link (EList *list, GList *link)
 {
 	GList *iterators = list->iterators;
 	for (; iterators; iterators = iterators->next) {
-		if (((EListIterator *)iterators->data)->iterator == link) {
+		if (((EListIterator *) iterators->data)->iterator == link) {
 			e_iterator_prev (iterators->data);
 		}
 	}
diff --git a/libedataserver/e-memory.c b/libedataserver/e-memory.c
index 1e2e914..3793dc2 100644
--- a/libedataserver/e-memory.c
+++ b/libedataserver/e-memory.c
@@ -113,7 +113,7 @@ e_memchunk_alloc (EMemChunk *memchunk)
 	if (f) {
 		f->atoms--;
 		if (f->atoms > 0) {
-			mem = ((gchar *)f) + (f->atoms * memchunk->atomsize);
+			mem = ((gchar *) f) + (f->atoms * memchunk->atomsize);
 		} else {
 			mem = f;
 			memchunk->free = memchunk->free->next;
@@ -257,7 +257,7 @@ e_memchunk_clean (EMemChunk *memchunk)
 		return;
 
 	/* first, setup the tree/list so we can map free block addresses to block addresses */
-	tree = g_tree_new ((GCompareFunc)tree_compare);
+	tree = g_tree_new ((GCompareFunc) tree_compare);
 	for (i = 0; i < memchunk->blocks->len; i++) {
 		ci = alloca (sizeof (*ci));
 		ci->count = 0;
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index 3df673b..322223e 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -247,8 +247,8 @@ ep_is_in_ignored (EProxy *proxy, const gchar *host)
 	hn = g_ascii_strdown (host, -1);
 
 	for (l = priv->ign_hosts; l; l = l->next) {
-		if (*((gchar *)l->data) == '*') {
-			if (g_str_has_suffix (hn, ((gchar *)l->data)+1)) {
+		if (*((gchar *) l->data) == '*') {
+			if (g_str_has_suffix (hn, ((gchar *) l->data)+1)) {
 				g_free (hn);
 				return TRUE;
 			}
@@ -292,12 +292,12 @@ ep_need_proxy_http (EProxy* proxy, const gchar * host)
 		if (so_addr->sa_family == AF_INET) {
 			struct in_addr in, *mask, *addr_in;
 
-			in = ((struct sockaddr_in *)so_addr)->sin_addr;
+			in = ((struct sockaddr_in *) so_addr)->sin_addr;
 			for (l = priv->ign_addrs; l; l = l->next) {
-				p_addr = (ProxyHostAddr *)l->data;
+				p_addr = (ProxyHostAddr *) l->data;
 				if (p_addr->type == PROXY_IPV4) {
-					addr_in =  ((struct in_addr *)p_addr->addr);
-					mask = ((struct in_addr *)p_addr->mask);
+					addr_in =  ((struct in_addr *) p_addr->addr);
+					mask = ((struct in_addr *) p_addr->mask);
 					d(g_print ("ep_need_proxy:ipv4: in: %ul\t mask: %ul\t addr: %ul\n",
 						   in.s_addr, mask->s_addr, addr_in->s_addr));
 					if ((in.s_addr & mask->s_addr) == addr_in->s_addr) {
@@ -310,12 +310,12 @@ ep_need_proxy_http (EProxy* proxy, const gchar * host)
 			struct in6_addr in6, net6;
 			struct in_addr *addr_in, *mask;
 
-			in6 = ((struct sockaddr_in6 *)so_addr)->sin6_addr;
+			in6 = ((struct sockaddr_in6 *) so_addr)->sin6_addr;
 			for (l = priv->ign_addrs; l; l = l->next) {
-				p_addr = (ProxyHostAddr *)l->data;
-				ipv6_network_addr (&in6, (struct in6_addr *)p_addr->mask, &net6);
+				p_addr = (ProxyHostAddr *) l->data;
+				ipv6_network_addr (&in6, (struct in6_addr *) p_addr->mask, &net6);
 				if (p_addr->type == PROXY_IPV6) {
-					if (IN6_ARE_ADDR_EQUAL (&net6, (struct in6_addr *)p_addr->addr)) {
+					if (IN6_ARE_ADDR_EQUAL (&net6, (struct in6_addr *) p_addr->addr)) {
 						d(g_print ("Host [%s] doesn't require proxy\n", host));
 						return FALSE;
 					}
@@ -323,8 +323,8 @@ ep_need_proxy_http (EProxy* proxy, const gchar * host)
 					   IN6_IS_ADDR_V4MAPPED (&net6)) {
 					guint32 v4addr;
 
-					addr_in =  ((struct in_addr *)p_addr->addr);
-					mask = ((struct in_addr *)p_addr->mask);
+					addr_in =  ((struct in_addr *) p_addr->addr);
+					mask = ((struct in_addr *) p_addr->mask);
 
 					v4addr = net6.s6_addr[12] << 24
 						| net6.s6_addr[13] << 16
@@ -449,7 +449,7 @@ ep_manipulate_ipv6 (ProxyHostAddr *host_addr,
 static void
 ep_parse_ignore_host (gpointer data, gpointer user_data)
 {
-	EProxy* proxy = (EProxy *)user_data;
+	EProxy* proxy = (EProxy *) user_data;
 	EProxyPrivate* priv = NULL;
 	SoupAddress *addr;
 	guint status;
@@ -461,7 +461,7 @@ ep_parse_ignore_host (gpointer data, gpointer user_data)
 		return;
 
 	priv = proxy->priv;
-	input = (gchar *)data;
+	input = (gchar *) data;
 
 	if ((netmask = strrchr (input, '/')) != NULL) {
 		hostname = g_strndup (input, netmask - input);
@@ -488,11 +488,11 @@ ep_parse_ignore_host (gpointer data, gpointer user_data)
 
 		if (so_addr->sa_family == AF_INET)
 			has_error = ep_manipulate_ipv4 (host_addr,
-							&((struct sockaddr_in *)so_addr)->sin_addr,
+							&((struct sockaddr_in *) so_addr)->sin_addr,
 							netmask);
 		else
 			has_error = ep_manipulate_ipv6 (host_addr,
-							&((struct sockaddr_in6 *)so_addr)->sin6_addr,
+							&((struct sockaddr_in6 *) so_addr)->sin6_addr,
 							netmask);
 
 		if (!has_error)
@@ -579,7 +579,7 @@ ep_set_proxy (GConfClient *client,
 {
 	gchar *proxy_server, *uri_http = NULL, *uri_https = NULL;
 	gint proxy_port, old_type;
-	EProxy* proxy = (EProxy *)user_data;
+	EProxy* proxy = (EProxy *) user_data;
 	EProxyPrivate* priv = proxy->priv;
 	GSList *ignore;
 	gboolean changed = FALSE, sys_manual = TRUE;
@@ -687,7 +687,7 @@ static void
 ep_setting_changed (GConfClient *client, guint32 cnxn_id, GConfEntry *entry, gpointer user_data)
 {
 	const gchar *key;
-	EProxy* proxy = (EProxy *)user_data;
+	EProxy* proxy = (EProxy *) user_data;
 	EProxyPrivate *priv;
 
 	if (!proxy || !proxy->priv)
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index cac3ce4..fad24f1 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -280,7 +280,7 @@ term_eval_and (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer d
 			gchar **a1;
 			gint l1, j;
 
-			a1 = (gchar **)r1->value.ptrarray->pdata;
+			a1 = (gchar **) r1->value.ptrarray->pdata;
 			l1 = r1->value.ptrarray->len;
 			for (j=0;j<l1;j++) {
 				gpointer ptr;
@@ -298,7 +298,7 @@ term_eval_and (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer d
 	if (type == ESEXP_RES_ARRAY_PTR) {
 		lambdafoo.count = argc;
 		lambdafoo.uids = g_ptr_array_new ();
-		g_hash_table_foreach (ht, (GHFunc)htand, &lambdafoo);
+		g_hash_table_foreach (ht, (GHFunc) htand, &lambdafoo);
 		r->type = ESEXP_RES_ARRAY_PTR;
 		r->value.ptrarray = lambdafoo.uids;
 	} else if (type == ESEXP_RES_BOOL) {
@@ -343,10 +343,10 @@ term_eval_or (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer da
 			gchar **a1;
 			gint l1, j;
 
-			a1 = (gchar **)r1->value.ptrarray->pdata;
+			a1 = (gchar **) r1->value.ptrarray->pdata;
 			l1 = r1->value.ptrarray->len;
 			for (j=0;j<l1;j++) {
-				g_hash_table_insert (ht, a1[j], (gpointer)1);
+				g_hash_table_insert (ht, a1[j], (gpointer) 1);
 			}
 		} else if (r1->type == ESEXP_RES_BOOL) {
 			bool |= r1->value.boolean;
@@ -357,7 +357,7 @@ term_eval_or (struct _ESExp *f, gint argc, struct _ESExpTerm **argv, gpointer da
 	if (type == ESEXP_RES_ARRAY_PTR) {
 		lambdafoo.count = argc;
 		lambdafoo.uids = g_ptr_array_new ();
-		g_hash_table_foreach (ht, (GHFunc)htor, &lambdafoo);
+		g_hash_table_foreach (ht, (GHFunc) htor, &lambdafoo);
 		r->type = ESEXP_RES_ARRAY_PTR;
 		r->value.ptrarray = lambdafoo.uids;
 	} else if (type == ESEXP_RES_BOOL) {
@@ -1367,7 +1367,7 @@ free_symbol (gpointer key, gpointer value, gpointer data)
 static void
 e_sexp_finalise (gpointer o)
 {
-	ESExp *s = (ESExp *)o;
+	ESExp *s = (ESExp *) o;
 
 	if (s->tree) {
 		parse_term_free (s, s->tree);
@@ -1397,7 +1397,7 @@ e_sexp_init (ESExp *s)
 	/* load in builtin symbols? */
 	for (i = 0; i < G_N_ELEMENTS (symbols); i++) {
 		if (symbols[i].type == 1) {
-			e_sexp_add_ifunction (s, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, (gpointer)&symbols[i]);
+			e_sexp_add_ifunction (s, 0, symbols[i].name, (ESExpIFunc *) symbols[i].func, (gpointer)&symbols[i]);
 		} else {
 			e_sexp_add_function (s, 0, symbols[i].name, symbols[i].func, (gpointer)&symbols[i]);
 		}
diff --git a/libedataserver/e-source-list.c b/libedataserver/e-source-list.c
index 33bd212..3979d4c 100644
--- a/libedataserver/e-source-list.c
+++ b/libedataserver/e-source-list.c
@@ -509,7 +509,7 @@ e_source_list_peek_group_by_properties (ESourceList *list, const gchar *property
 		if (!value)
 			break;
 
-		g_hash_table_insert (props, (gpointer)property_name, (gpointer)value);
+		g_hash_table_insert (props, (gpointer) property_name, (gpointer) value);
 		property_name = va_arg (ap, const gchar *);
 	}
 	va_end (ap);
@@ -905,8 +905,8 @@ e_source_list_is_gconf_updated (ESourceList *list)
 	/* From conf to list */
 
 	for (temp = conf_list; temp != NULL; temp = temp->next) {
-		gconf_xml = (gchar *)temp->data;
-		xmldoc = xmlParseDoc ((const xmlChar *)gconf_xml);
+		gconf_xml = (gchar *) temp->data;
+		xmldoc = xmlParseDoc ((const xmlChar *) gconf_xml);
 
 		if (xmldoc == NULL)
 			continue;
@@ -952,7 +952,7 @@ e_source_list_is_gconf_updated (ESourceList *list)
 		source_group_xml = e_source_group_to_xml (group);
 
 		for (temp = conf_list; temp != NULL; temp = temp->next) {
-			gconf_xml = (gchar *)temp->data;
+			gconf_xml = (gchar *) temp->data;
 			if (!e_source_group_xmlstr_equal (gconf_xml, source_group_xml))
 				continue;
 			else
diff --git a/libedataserver/e-source.c b/libedataserver/e-source.c
index f19cb05..6db0abe 100644
--- a/libedataserver/e-source.c
+++ b/libedataserver/e-source.c
@@ -227,7 +227,7 @@ e_source_new_from_xml_node (xmlNodePtr node)
 
 	source = g_object_new (E_TYPE_SOURCE, NULL);
 
-	source->priv->uid = g_strdup ((gchar *)uid);
+	source->priv->uid = g_strdup ((gchar *) uid);
 	xmlFree (uid);
 
 	if (e_source_update_from_xml_node (source, node, NULL))
@@ -254,7 +254,7 @@ import_properties (ESource *source,
 		value = xmlGetProp (prop_node, (xmlChar *)"value");
 
 		if (name && value)
-			g_hash_table_insert (priv->properties, g_strdup ((gchar *)name), g_strdup ((gchar *)value));
+			g_hash_table_insert (priv->properties, g_strdup ((gchar *) name), g_strdup ((gchar *) value));
 
 		if (name)
 			xmlFree (name);
@@ -331,14 +331,14 @@ e_source_update_from_xml_node (ESource *source,
 		goto done;
 
 	if (source->priv->name == NULL
-	    || strcmp ((gchar *)name, source->priv->name) != 0
+	    || strcmp ((gchar *) name, source->priv->name) != 0
 	    || (source->priv->relative_uri == NULL && relative_uri != NULL)
 	    || (source->priv->relative_uri != NULL && relative_uri == NULL)
-	    || (relative_uri && source->priv->relative_uri && strcmp ((gchar *)relative_uri, source->priv->relative_uri) != 0)) {
+	    || (relative_uri && source->priv->relative_uri && strcmp ((gchar *) relative_uri, source->priv->relative_uri) != 0)) {
 		gchar *abs_uri = NULL;
 
 		g_free (source->priv->name);
-		source->priv->name = g_strdup ((gchar *)name);
+		source->priv->name = g_strdup ((gchar *) name);
 
 		if (source->priv->group) {
 			abs_uri = e_source_build_absolute_uri (source);
@@ -355,7 +355,7 @@ e_source_update_from_xml_node (ESource *source,
 			gchar *tmp = source->priv->absolute_uri;
 
 			tmp[strlen (tmp) - strlen (source->priv->relative_uri)] = 0;
-			source->priv->absolute_uri = g_strconcat (tmp, (gchar *)relative_uri, NULL);
+			source->priv->absolute_uri = g_strconcat (tmp, (gchar *) relative_uri, NULL);
 
 			g_free (tmp);
 		}
@@ -363,7 +363,7 @@ e_source_update_from_xml_node (ESource *source,
 		g_free (abs_uri);
 
 		g_free (source->priv->relative_uri);
-		source->priv->relative_uri = g_strdup ((gchar *)relative_uri);
+		source->priv->relative_uri = g_strdup ((gchar *) relative_uri);
 
 		changed = TRUE;
 	}
@@ -375,13 +375,13 @@ e_source_update_from_xml_node (ESource *source,
 		    (g_str_has_prefix ((const gchar *) absolute_uri, "file:") || g_str_equal ((const gchar *) absolute_uri, "local:/system")))
 			source->priv->absolute_uri = g_strdup ("local:system");
 		else
-			source->priv->absolute_uri = g_strdup ((gchar *)absolute_uri);
+			source->priv->absolute_uri = g_strdup ((gchar *) absolute_uri);
 		changed = TRUE;
 	}
 
 	if (color == NULL) {
 		/* It is okay for color_spec to be NULL. */
-		changed |= set_color_spec (source, (gchar *)color_spec);
+		changed |= set_color_spec (source, (gchar *) color_spec);
 	} else {
 		gchar buffer[8];
 		g_snprintf (buffer, sizeof (buffer), "#%s", color);
@@ -1064,7 +1064,7 @@ e_source_new_from_standalone_xml (const gchar *xml)
 	xmlNodePtr root;
 	ESource *source;
 
-	doc = xmlParseDoc ((xmlChar *)xml);
+	doc = xmlParseDoc ((xmlChar *) xml);
 	if (doc == NULL)
 		return NULL;
 
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 0b342ec..e65dc59 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -1805,9 +1805,9 @@ e_time_parse_date_ex (const gchar *value,
 	}
 
 	if (two_digit_year)
-		g_free ((gchar *)format[0]);
+		g_free ((gchar *) format[0]);
 	else
-		g_free ((gchar *)format[1]);
+		g_free ((gchar *) format[1]);
 
 	return status;
 }
diff --git a/libedataserver/e-url.c b/libedataserver/e-url.c
index 3f7e529..3fe541a 100644
--- a/libedataserver/e-url.c
+++ b/libedataserver/e-url.c
@@ -114,7 +114,7 @@ uri_decode (gchar *part)
 {
 	guchar *s, *d;
 
-	s = d = (guchar *)part;
+	s = d = (guchar *) part;
 	while (*s) {
 		if (*s == '%') {
 			if (isxdigit (s[1]) && isxdigit (s[2])) {
diff --git a/libedataserver/e-xml-hash-utils.c b/libedataserver/e-xml-hash-utils.c
index 009c914..28b6d22 100644
--- a/libedataserver/e-xml-hash-utils.c
+++ b/libedataserver/e-xml-hash-utils.c
@@ -78,7 +78,7 @@ e_xml_to_hash (xmlDoc *doc, EXmlHashType type)
 			continue;
 		}
 
-		g_hash_table_insert (hash, g_strdup ((gchar *)key), g_strdup ((gchar *)value));
+		g_hash_table_insert (hash, g_strdup ((gchar *) key), g_strdup ((gchar *) value));
 		xmlFree (key);
 		xmlFree (value);
 	}
@@ -135,7 +135,7 @@ e_xml_from_hash (GHashTable *hash,
 	doc->encoding = xmlStrdup ((xmlChar*)"UTF-8");
 	sd.type = type;
 	sd.doc = doc;
-	sd.root = xmlNewDocNode (doc, NULL, (xmlChar*)root_name, NULL);
+	sd.root = xmlNewDocNode (doc, NULL, (xmlChar*) root_name, NULL);
 	xmlDocSetRootElement (doc, sd.root);
 
 	g_hash_table_foreach (hash, foreach_save_func, &sd);
@@ -344,7 +344,7 @@ e_xmlhash_foreach_key_remove (EXmlHash *hash,
 	g_return_if_fail (hash != NULL);
 	g_return_if_fail (func != NULL);
 
-	g_hash_table_foreach_remove (hash->objects, (GHRFunc)func, user_data);
+	g_hash_table_foreach_remove (hash->objects, (GHRFunc) func, user_data);
 }
 
 /**
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index 8376bcb..bd66153 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -430,7 +430,7 @@ e_name_selector_dialog_finalize (GObject *object)
 
 	priv = E_NAME_SELECTOR_DIALOG (object)->priv;
 
-	g_slist_foreach (priv->user_query_fields, (GFunc)g_free, NULL);
+	g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL);
 	g_slist_free (priv->user_query_fields);
 
 	g_array_free (priv->sections, TRUE);
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index ef40e00..57b2626 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -128,7 +128,7 @@ name_selector_entry_dispose (GObject *object)
 		priv->contact_store = NULL;
 	}
 
-	g_slist_foreach (priv->user_query_fields, (GFunc)g_free, NULL);
+	g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL);
 	g_slist_free (priv->user_query_fields);
 	priv->user_query_fields = NULL;
 
@@ -1826,7 +1826,7 @@ contact_layout_pixbuffer (GtkCellLayout *cell_layout, GtkCellRenderer *cell, Gtk
 		GdkPixbufLoader *loader;
 
 		loader = gdk_pixbuf_loader_new ();
-		if (gdk_pixbuf_loader_write (loader, (guchar *)photo->data.inlined.data, photo->data.inlined.length, NULL) &&
+		if (gdk_pixbuf_loader_write (loader, (guchar *) photo->data.inlined.data, photo->data.inlined.length, NULL) &&
 		    gdk_pixbuf_loader_close (loader, NULL)) {
 			pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
 			if (pixbuf)
@@ -2589,9 +2589,9 @@ populate_popup (ENameSelectorEntry *name_selector_entry, GtkMenu *menu)
 	if (is_list) {
 		const GList *dests = e_destination_list_get_dests (destination);
 		GList *iter;
-		gint length = g_list_length ((GList *)dests);
+		gint length = g_list_length ((GList *) dests);
 
-		for (iter = (GList *)dests; iter; iter = iter->next) {
+		for (iter = (GList *) dests; iter; iter = iter->next) {
 			EDestination *dest = (EDestination *) iter->data;
 			const gchar *email = e_destination_get_email (dest);
 
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index 348a54a..1cace04 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -108,7 +108,7 @@ enl_popup_grab (ENameSelectorList *list)
 			  NULL, NULL, GDK_CURRENT_TIME);
 
 	gdk_keyboard_grab (window, TRUE, GDK_CURRENT_TIME);
-	gtk_widget_grab_focus ((GtkWidget *)list);
+	gtk_widget_grab_focus ((GtkWidget *) list);
 
 	/* Build the listview from the model */
 	entry = E_NAME_SELECTOR_ENTRY (list);
@@ -152,7 +152,7 @@ enl_entry_focus_out (ENameSelectorList *list, GdkEventFocus *event, gpointer dum
 	if (gtk_widget_get_visible (GTK_WIDGET (list->priv->popup))
 	    && !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) {
 		enl_popup_ungrab (list);
-		gtk_widget_hide ((GtkWidget *)list->priv->popup);
+		gtk_widget_hide ((GtkWidget *) list->priv->popup);
 
 		return FALSE;
 	}
@@ -169,7 +169,7 @@ enl_popup_button_press (GtkWidget *widget,
 		return FALSE;
 
 	/* if we come here, it's usually time to popdown */
-	gtk_widget_hide ((GtkWidget *)list->priv->popup);
+	gtk_widget_hide ((GtkWidget *) list->priv->popup);
 
 	return TRUE;
 }
@@ -438,9 +438,9 @@ enl_tree_button_press_event (GtkWidget *widget,
 	if (is_list) {
 		const GList *dests = e_destination_list_get_dests (destination);
 		GList *iters;
-		gint length = g_list_length ((GList *)dests);
+		gint length = g_list_length ((GList *) dests);
 
-		for (iters = (GList *)dests; iters; iters = iters->next) {
+		for (iters = (GList *) dests; iters; iters = iters->next) {
 			EDestination *dest = (EDestination *) iters->data;
 			const gchar *email = e_destination_get_email (dest);
 
@@ -548,7 +548,7 @@ enl_tree_key_press_event (GtkWidget *w,
 		   && event->keyval != GDK_KEY_Control_R && event->keyval != GDK_KEY_Control_L) {
 		enl_popup_ungrab (list);
 		gtk_widget_hide ( GTK_WIDGET (list->priv->popup));
-		gtk_widget_event (GTK_WIDGET (list), (GdkEvent *)event);
+		gtk_widget_event (GTK_WIDGET (list), (GdkEvent *) event);
 		return TRUE;
 	}
 
diff --git a/libedataserverui/e-name-selector.c b/libedataserverui/e-name-selector.c
index b80cc35..5008844 100644
--- a/libedataserverui/e-name-selector.c
+++ b/libedataserverui/e-name-selector.c
@@ -525,6 +525,6 @@ e_name_selector_peek_section_list (ENameSelector *name_selector, const gchar *na
 		g_object_unref (contact_store);
 	}
 
-	return (ENameSelectorList *)section->entry;
+	return (ENameSelectorList *) section->entry;
 }
 
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 6688f31..4e332c6 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -624,7 +624,7 @@ pass_response (GtkDialog *dialog, gint response, gpointer data)
 	GList *iter, *trash = NULL;
 
 	if (response == GTK_RESPONSE_OK) {
-		msg->password = g_strdup (gtk_entry_get_text ((GtkEntry *)msg->entry));
+		msg->password = g_strdup (gtk_entry_get_text ((GtkEntry *) msg->entry));
 
 		if (type != E_PASSWORDS_REMEMBER_NEVER) {
 			gint noreply = msg->noreply;
@@ -644,7 +644,7 @@ pass_response (GtkDialog *dialog, gint response, gpointer data)
 		}
 	}
 
-	gtk_widget_destroy ((GtkWidget *)dialog);
+	gtk_widget_destroy ((GtkWidget *) dialog);
 	password_dialog = NULL;
 
 	/* ok, here things get interesting, we suck up any pending
diff --git a/tests/libebook/test-ebook-async.c b/tests/libebook/test-ebook-async.c
index 902892d..1e6d23d 100644
--- a/tests/libebook/test-ebook-async.c
+++ b/tests/libebook/test-ebook-async.c
@@ -19,7 +19,7 @@ print_email (EContact *contact)
 	for (e = emails; e; e = e->next) {
 		printf ("\t%s\n",  (gchar *)e->data);
 	}
-	g_list_foreach (emails, (GFunc)g_free, NULL);
+	g_list_foreach (emails, (GFunc) g_free, NULL);
 	g_list_free (emails);
 
 	printf ("\n");
diff --git a/tests/libebook/test-ebook-get-book-view.c b/tests/libebook/test-ebook-get-book-view.c
index 0065af4..9cd4a00 100644
--- a/tests/libebook/test-ebook-get-book-view.c
+++ b/tests/libebook/test-ebook-get-book-view.c
@@ -20,7 +20,7 @@ print_contact (EContact *contact)
 	for (e = emails; e; e = e->next) {
 		test_print ("\t%s\n",  (gchar *)e->data);
 	}
-	g_list_foreach (emails, (GFunc)g_free, NULL);
+	g_list_foreach (emails, (GFunc) g_free, NULL);
 	g_list_free (emails);
 
 	test_print ("\n");
@@ -31,7 +31,7 @@ contacts_added (EBookView *book_view, const GList *contacts)
 {
 	GList *l;
 
-	for (l = (GList*)contacts; l; l = l->next) {
+	for (l = (GList*) contacts; l; l = l->next) {
 		print_contact (l->data);
 	}
 }
@@ -41,7 +41,7 @@ contacts_removed (EBookView *book_view, const GList *ids)
 {
 	GList *l;
 
-	for (l = (GList*)ids; l; l = l->next) {
+	for (l = (GList*) ids; l; l = l->next) {
 		test_print ("Removed contact: %s\n", (gchar *)l->data);
 	}
 }
diff --git a/tests/libebook/test-ebook.c b/tests/libebook/test-ebook.c
index 27007ee..4211f20 100644
--- a/tests/libebook/test-ebook.c
+++ b/tests/libebook/test-ebook.c
@@ -19,7 +19,7 @@ print_email (EContact *contact)
 	for (e = emails; e; e = e->next) {
 		printf ("\t%s\n",  (gchar *)e->data);
 	}
-	g_list_foreach (emails, (GFunc)g_free, NULL);
+	g_list_foreach (emails, (GFunc) g_free, NULL);
 	g_list_free (emails);
 
 	printf ("\n");
diff --git a/tests/libebook/test-stress-bookviews.c b/tests/libebook/test-stress-bookviews.c
index 13b3833..fa81f26 100644
--- a/tests/libebook/test-stress-bookviews.c
+++ b/tests/libebook/test-stress-bookviews.c
@@ -16,7 +16,7 @@ print_contact (EContact *contact)
 	for (e = emails; e; e = e->next) {
 		printf ("\t%s\n",  (gchar *)e->data);
 	}
-	g_list_foreach (emails, (GFunc)g_free, NULL);
+	g_list_foreach (emails, (GFunc) g_free, NULL);
 	g_list_free (emails);
 
 	printf ("\n");
@@ -27,7 +27,7 @@ contacts_added (EBookView *book_view, const GList *contacts)
 {
   GList *l;
 
-  for (l = (GList*)contacts; l; l = l->next) {
+  for (l = (GList*) contacts; l; l = l->next) {
     print_contact (l->data);
   }
 }
@@ -37,7 +37,7 @@ contacts_removed (EBookView *book_view, const GList *ids)
 {
   GList *l;
 
-  for (l = (GList*)ids; l; l = l->next) {
+  for (l = (GList*) ids; l; l = l->next) {
     printf ("Removed contact: %s\n", (gchar *)l->data);
   }
 }
diff --git a/tests/libedata-cal/test-intervaltree.c b/tests/libedata-cal/test-intervaltree.c
index 0006337..589b561 100644
--- a/tests/libedata-cal/test-intervaltree.c
+++ b/tests/libedata-cal/test-intervaltree.c
@@ -299,8 +299,8 @@ random_test (void)
 		}
 
 		/* g_print ("OK\n"); */
-		g_list_foreach (l1, (GFunc)g_object_unref, NULL);
-		g_list_foreach (l2, (GFunc)unref_comp, NULL);
+		g_list_foreach (l1, (GFunc) g_object_unref, NULL);
+		g_list_foreach (l2, (GFunc) unref_comp, NULL);
 		g_list_free (l1);
 		g_list_free (l2);
 	}
@@ -327,8 +327,8 @@ random_test (void)
 		}
 
 		/* g_print ("OK\n"); */
-		g_list_foreach (l1, (GFunc)g_object_unref, NULL);
-		g_list_foreach (l2, (GFunc)unref_comp, NULL);
+		g_list_foreach (l1, (GFunc) g_object_unref, NULL);
+		g_list_foreach (l2, (GFunc) unref_comp, NULL);
 		g_list_free (l1);
 		g_list_free (l2);
 	}
@@ -401,8 +401,8 @@ random_test (void)
 			return;
 		}
 
-		g_list_foreach (l1, (GFunc)g_object_unref, NULL);
-		g_list_foreach (l2, (GFunc)unref_comp, NULL);
+		g_list_foreach (l1, (GFunc) g_object_unref, NULL);
+		g_list_foreach (l2, (GFunc) unref_comp, NULL);
 		g_list_free (l1);
 		g_list_free (l2);
 
@@ -410,7 +410,7 @@ random_test (void)
 	}
 
 	e_intervaltree_destroy (tree);
-	g_list_foreach (list, (GFunc)unref_comp, NULL);
+	g_list_foreach (list, (GFunc) unref_comp, NULL);
 	g_list_free (list);
 }
 



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