[evolution-data-server] Coding style and whitespace cleanup.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Coding style and whitespace cleanup.
- Date: Sat, 13 Aug 2011 03:07:42 +0000 (UTC)
commit 71072a8991ce5165f8211ed1a149cf9d844aa139
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Aug 12 23:04:52 2011 -0400
Coding style and whitespace cleanup.
addressbook/backends/file/e-book-backend-file.c | 21 ++++++-------
.../backends/google/e-book-backend-google.c | 32 ++++++++++----------
.../libedata-book/e-book-backend-sqlitedb.c | 16 ++++-----
addressbook/libedata-book/e-book-backend.c | 1 -
camel/providers/imapx/camel-imapx-server.c | 4 +-
tests/libebook/client/test-client-revision-view.c | 9 ++----
tests/libebook/client/test-client-uid-only-view.c | 12 ++-----
7 files changed, 41 insertions(+), 54 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index d976de8..17eff14 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -67,7 +67,6 @@
#define SQLITEDB_FOLDER_ID "folder_id"
#define SQLITEDB_FOLDER_NAME "folder"
-
#define EDB_ERROR(_code) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, NULL)
#define EDB_ERROR_EX(_code, _msg) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, _msg)
#define EDB_NOT_OPENED_ERROR EDB_ERROR(NOT_OPENED)
@@ -133,7 +132,7 @@ remove_file (const gchar *filename, GError **error)
g_propagate_error (error, EDB_ERROR (PERMISSION_DENIED));
} else {
g_propagate_error (error, e_data_book_create_error_fmt
- (E_DATA_BOOK_STATUS_OTHER_ERROR,
+ (E_DATA_BOOK_STATUS_OTHER_ERROR,
"Failed to remove file '%s': %s",
filename, g_strerror (errno)));
}
@@ -155,7 +154,7 @@ create_directory (const gchar *dirname,
if (errno == EACCES || errno == EPERM)
g_propagate_error (error, EDB_ERROR (PERMISSION_DENIED));
else
- g_propagate_error (error,
+ g_propagate_error (error,
e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
"Failed to make directory %s: %s",
dirname, g_strerror (errno)));
@@ -188,7 +187,7 @@ load_vcard (EBookBackendFile *bf,
string_to_dbt (uid, &id_dbt);
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
vcard_dbt.flags = DB_DBT_MALLOC;
-
+
db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
if (db_error == 0) {
@@ -254,7 +253,7 @@ build_sqlitedb (EBookBackendFilePrivate *bfpriv)
return FALSE;
}
- g_slist_foreach (contacts, (GFunc)g_object_unref, NULL);
+ g_slist_foreach (contacts, (GFunc) g_object_unref, NULL);
g_slist_free (contacts);
if (!e_book_backend_sqlitedb_set_is_populated (bfpriv->sqlitedb, SQLITEDB_FOLDER_ID, TRUE, &error)) {
@@ -578,7 +577,7 @@ e_book_backend_file_get_contact_list (EBookBackendSync *backend,
}
}
- g_slist_foreach (summary_list, (GFunc)e_book_backend_sqlitedb_search_data_free, NULL);
+ g_slist_foreach (summary_list, (GFunc) e_book_backend_sqlitedb_search_data_free, NULL);
g_slist_free (summary_list);
} else {
@@ -833,7 +832,7 @@ book_view_thread (gpointer data)
summary_list = e_book_backend_sqlitedb_search (bf->priv->sqlitedb,
SQLITEDB_FOLDER_ID,
- query, fields_of_interest,
+ query, fields_of_interest,
&searched, &with_all_required_fields, NULL);
if (searched) {
@@ -866,7 +865,7 @@ book_view_thread (gpointer data)
notify_update_vcard (book_view, TRUE, data->uid, vcard);
}
- g_slist_foreach (summary_list, (GFunc)e_book_backend_sqlitedb_search_data_free, NULL);
+ g_slist_foreach (summary_list, (GFunc) e_book_backend_sqlitedb_search_data_free, NULL);
g_slist_free (summary_list);
} else {
/* iterate over the db and do the query there */
@@ -887,7 +886,7 @@ book_view_thread (gpointer data)
/* don't include the version in the list of cards */
if (strcmp (id_dbt.data, E_BOOK_BACKEND_FILE_VERSION_NAME)) {
- notify_update_vcard (book_view, allcontacts,
+ notify_update_vcard (book_view, allcontacts,
id_dbt.data, vcard_dbt.data);
} else {
g_free (vcard_dbt.data);
@@ -1380,7 +1379,7 @@ e_book_backend_file_open (EBookBackendSync *backend,
} else if (!build_sqlitedb (bf->priv)) {
g_propagate_error (perror, e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
"Failed to build summary for an address book %s",
- bf->priv->filename));
+ bf->priv->filename));
}
}
@@ -1550,7 +1549,7 @@ view_notify_update (EDataBookView *view, gpointer data)
static void
e_book_backend_file_notify_update (EBookBackend *backend, const EContact *contact)
{
- NotifyData data = { (EContact *)contact, E_BOOK_BACKEND_FILE (backend) };
+ NotifyData data = { (EContact *) contact, E_BOOK_BACKEND_FILE (backend) };
e_book_backend_foreach_view (backend, view_notify_update, &data);
}
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index 88efb4e..6689a2c 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -638,8 +638,8 @@ process_contact_cb (GDataEntry *entry, guint entry_key, guint entry_count, EBook
(old_photo_etag != NULL && new_photo_etag != NULL && strcmp (old_photo_etag, new_photo_etag) != 0)) {
/* Download the photo. */
gdata_contacts_contact_get_photo_async (GDATA_CONTACTS_CONTACT (entry),
- GDATA_CONTACTS_SERVICE (E_BOOK_BACKEND_GOOGLE (backend)->priv->service), NULL,
- (GAsyncReadyCallback) process_contact_photo_cb, backend);
+ GDATA_CONTACTS_SERVICE (E_BOOK_BACKEND_GOOGLE (backend)->priv->service), NULL,
+ (GAsyncReadyCallback) process_contact_photo_cb, backend);
g_free (old_photo_etag);
return;
@@ -1151,9 +1151,9 @@ create_contact_photo_cb (GDataContactsContact *contact, GAsyncResult *async_resu
/* We now have to re-query for the contact, since setting its photo changes the contact's ETag. */
gdata_service_query_single_entry_async (E_BOOK_BACKEND_GOOGLE (data->backend)->priv->service,
- gdata_contacts_service_get_primary_authorization_domain (),
- gdata_entry_get_id (GDATA_ENTRY (contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT,
- data->cancellable, (GAsyncReadyCallback) create_contact_photo_query_cb, data);
+ gdata_contacts_service_get_primary_authorization_domain (),
+ gdata_entry_get_id (GDATA_ENTRY (contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT,
+ data->cancellable, (GAsyncReadyCallback) create_contact_photo_query_cb, data);
return;
} else {
/* Error. */
@@ -1189,9 +1189,9 @@ create_contact_cb (GDataService *service, GAsyncResult *result, CreateContactDat
* we can update the EContact with the photo data and ETag. */
if (data->photo != NULL) {
gdata_contacts_contact_set_photo_async (GDATA_CONTACTS_CONTACT (new_contact), GDATA_CONTACTS_SERVICE (service),
- (const guint8 *) data->photo->data.inlined.data, data->photo->data.inlined.length,
- data->photo->data.inlined.mime_type, data->cancellable,
- (GAsyncReadyCallback) create_contact_photo_cb, data);
+ (const guint8 *) data->photo->data.inlined.data, data->photo->data.inlined.length,
+ data->photo->data.inlined.mime_type, data->cancellable,
+ (GAsyncReadyCallback) create_contact_photo_cb, data);
return;
}
#endif /* HAVE_LIBGDATA_0_9 */
@@ -1481,9 +1481,9 @@ modify_contact_photo_cb (GDataContactsContact *contact, GAsyncResult *async_resu
/* We now have to re-query for the contact, since setting its photo changes the contact's ETag. */
gdata_service_query_single_entry_async (E_BOOK_BACKEND_GOOGLE (data->backend)->priv->service,
- gdata_contacts_service_get_primary_authorization_domain (),
- gdata_entry_get_id (GDATA_ENTRY (contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT,
- data->cancellable, (GAsyncReadyCallback) modify_contact_photo_query_cb, data);
+ gdata_contacts_service_get_primary_authorization_domain (),
+ gdata_entry_get_id (GDATA_ENTRY (contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT,
+ data->cancellable, (GAsyncReadyCallback) modify_contact_photo_query_cb, data);
return;
} else {
/* Error. */
@@ -1533,15 +1533,15 @@ modify_contact_cb (GDataService *service, GAsyncResult *result, ModifyContactDat
/* Set the photo. */
g_return_if_fail (data->photo != NULL);
gdata_contacts_contact_set_photo_async (GDATA_CONTACTS_CONTACT (new_contact), GDATA_CONTACTS_SERVICE (service),
- (const guint8 *) data->photo->data.inlined.data, data->photo->data.inlined.length,
- data->photo->data.inlined.mime_type, data->cancellable,
- (GAsyncReadyCallback) modify_contact_photo_cb, data);
+ (const guint8 *) data->photo->data.inlined.data, data->photo->data.inlined.length,
+ data->photo->data.inlined.mime_type, data->cancellable,
+ (GAsyncReadyCallback) modify_contact_photo_cb, data);
return;
case REMOVE_PHOTO:
/* Unset the photo. */
g_return_if_fail (data->photo == NULL);
gdata_contacts_contact_set_photo_async (GDATA_CONTACTS_CONTACT (new_contact), GDATA_CONTACTS_SERVICE (service),
- NULL, 0, NULL, data->cancellable, (GAsyncReadyCallback) modify_contact_photo_cb, data);
+ NULL, 0, NULL, data->cancellable, (GAsyncReadyCallback) modify_contact_photo_cb, data);
return;
default:
g_assert_not_reached ();
@@ -1642,7 +1642,7 @@ e_book_backend_google_modify_contact (EBookBackend *backend, EDataBook *book, gu
/* Removing a photo */
data->photo_operation = REMOVE_PHOTO;
} else if (old_photo->data.inlined.length != new_photo->data.inlined.length ||
- memcmp (old_photo->data.inlined.data, new_photo->data.inlined.data, old_photo->data.inlined.length) != 0) {
+ memcmp (old_photo->data.inlined.data, new_photo->data.inlined.data, old_photo->data.inlined.length) != 0) {
/* Modifying the photo */
data->photo_operation = UPDATE_PHOTO;
} else {
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 6879bb6..faccce8 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -63,7 +63,7 @@ static GStaticMutex dbcon_lock = G_STATIC_MUTEX_INIT;
typedef struct {
EContactField field; /* The EContact field */
- GType fundamental_type; /* The fundamental type (string or int) */
+ GType fundamental_type; /* The fundamental type (string or gint) */
const gchar *dbname; /* The key for this field in the sqlite3 table */
} SummeryField;
@@ -818,7 +818,7 @@ e_book_backend_sqlitedb_get_contact (EBookBackendSqliteDB *ebsdb,
{
GError *err = NULL;
EContact *contact = NULL;
- gchar *vcard = e_book_backend_sqlitedb_get_vcard_string (ebsdb, folderid, uid,
+ gchar *vcard = e_book_backend_sqlitedb_get_vcard_string (ebsdb, folderid, uid,
fields_of_interest, with_all_required_fields, &err);
if (!err) {
contact = e_contact_new_from_vcard (vcard);
@@ -829,7 +829,6 @@ e_book_backend_sqlitedb_get_contact (EBookBackendSqliteDB *ebsdb,
return contact;
}
-
static void
accumulate_fields_select_stmt (const gchar *field_name,
gpointer is_present,
@@ -873,7 +872,7 @@ e_book_backend_sqlitedb_is_summary_fields (GHashTable *fields_of_interest)
if (!fields_of_interest)
return FALSE;
- g_hash_table_foreach (fields_of_interest, (GHFunc)check_field_foreach, &summary_fields);
+ g_hash_table_foreach (fields_of_interest, (GHFunc) check_field_foreach, &summary_fields);
return summary_fields;
}
@@ -893,7 +892,7 @@ summary_select_stmt (const gchar *folderid,
*
*/
if (fields_of_interest && e_book_backend_sqlitedb_is_summary_fields (fields_of_interest)) {
- g_hash_table_foreach (fields_of_interest, (GHFunc)accumulate_fields_select_stmt, string);
+ g_hash_table_foreach (fields_of_interest, (GHFunc) accumulate_fields_select_stmt, string);
/* The query should return all the required information */
if (with_all_required_fields)
@@ -912,7 +911,6 @@ summary_select_stmt (const gchar *folderid,
return g_string_free (string, FALSE);
}
-
/**
* e_book_backend_sqlitedb_get_vcard_string:
* @ebsdb: An #EBookBackendSqliteDB
@@ -1350,7 +1348,7 @@ book_backend_sqlitedb_search_query (EBookBackendSqliteDB *ebsdb,
book_backend_sql_exec (ebsdb->priv->db, stmt, store_data_to_vcard, &vcard_data, &err);
sqlite3_free (stmt);
} else
- book_backend_sql_exec (ebsdb->priv->db, select_stmt,
+ book_backend_sql_exec (ebsdb->priv->db, select_stmt,
store_data_to_vcard, &vcard_data, &err);
g_free (select_stmt);
@@ -1469,8 +1467,8 @@ e_book_backend_sqlitedb_search (EBookBackendSqliteDB *ebsdb,
gchar *sql_query;
sql_query = sexp ? sexp_to_sql_query (sexp) : NULL;
- search_contacts = book_backend_sqlitedb_search_query (ebsdb, sql_query, folderid,
- fields_of_interest,
+ search_contacts = book_backend_sqlitedb_search_query (ebsdb, sql_query, folderid,
+ fields_of_interest,
&local_with_all_required_fields, error);
g_free (sql_query);
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 79505d3..749b139 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -1054,7 +1054,6 @@ e_book_backend_sync (EBookBackend *backend)
g_object_unref (backend);
}
-
/**
* e_book_backend_notify_update:
* @backend: an #EBookBackend
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 1563bb3..2d2b5d8 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -497,7 +497,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_write_string (
- (CamelStream *)ic->mem,
+ (CamelStream *) ic->mem,
camel_sasl_get_mechanism (CAMEL_SASL (ob)),
NULL, NULL);
if (!camel_sasl_get_authenticated ((CamelSasl *) ob))
@@ -537,7 +537,7 @@ imapx_command_add_part (CamelIMAPXCommand *ic, camel_imapx_command_part_t type,
string = g_strdup_printf ("{%u}", ob_size);
}
- camel_stream_write_string ((CamelStream *)ic->mem, string, NULL, NULL);
+ camel_stream_write_string ((CamelStream *) ic->mem, string, NULL, NULL);
g_free (string);
}
diff --git a/tests/libebook/client/test-client-revision-view.c b/tests/libebook/client/test-client-revision-view.c
index b2234bd..afca643 100644
--- a/tests/libebook/client/test-client-revision-view.c
+++ b/tests/libebook/client/test-client-revision-view.c
@@ -7,7 +7,6 @@
#define N_TEST_CONTACTS 4
-
static gboolean loading_view = FALSE;
/****************************************************************
@@ -95,7 +94,7 @@ objects_added (EBookClientView *view, const GSList *contacts)
if (e_contact_get_const (contact, E_CONTACT_FULL_NAME) != NULL)
g_error ("received contact name `%s' when only the uid and revision was requested",
- (gchar *)e_contact_get_const (contact, E_CONTACT_FULL_NAME));
+ (gchar *) e_contact_get_const (contact, E_CONTACT_FULL_NAME));
}
if (!loading_view)
@@ -131,9 +130,8 @@ setup_and_start_view (EBookClientView *view)
g_signal_connect (view, "objects-removed", G_CALLBACK (objects_removed), NULL);
g_signal_connect (view, "complete", G_CALLBACK (complete), NULL);
-
- field_list = g_slist_prepend (NULL, (gpointer)e_contact_field_name (E_CONTACT_UID));
- field_list = g_slist_prepend (field_list, (gpointer)e_contact_field_name (E_CONTACT_REV));
+ field_list = g_slist_prepend (NULL, (gpointer) e_contact_field_name (E_CONTACT_UID));
+ field_list = g_slist_prepend (field_list, (gpointer) e_contact_field_name (E_CONTACT_REV));
e_book_client_view_set_fields_of_interest (view, field_list, &error);
g_slist_free (field_list);
@@ -165,7 +163,6 @@ get_view_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
setup_and_start_view (view);
}
-
static gpointer
call_get_view (gpointer user_data)
{
diff --git a/tests/libebook/client/test-client-uid-only-view.c b/tests/libebook/client/test-client-uid-only-view.c
index 003b2b2..1dc2783 100644
--- a/tests/libebook/client/test-client-uid-only-view.c
+++ b/tests/libebook/client/test-client-uid-only-view.c
@@ -11,7 +11,6 @@
#define COMPARE_PERFORMANCE 0
#define BEEFY_VCARDS 1
-
#if COMPARE_PERFORMANCE
# define SETUP_TIMER(timer) GTimer *timer = g_timer_new ();
# define START_TIMER(timer) g_timer_start (timer);
@@ -131,7 +130,7 @@ print_contact (EContact *contact)
for (e = emails; e; e = e->next) {
g_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);
g_print ("\n");
@@ -161,7 +160,7 @@ objects_added (EBookClientView *view, const GSList *contacts)
if (uids_only && e_contact_get_const (contact, E_CONTACT_FULL_NAME) != NULL)
g_error ("received contact name `%s' when only the uid was requested",
- (gchar *)e_contact_get_const (contact, E_CONTACT_FULL_NAME));
+ (gchar *) e_contact_get_const (contact, E_CONTACT_FULL_NAME));
else if (!uids_only && e_contact_get_const (contact, E_CONTACT_FULL_NAME) == NULL)
g_error ("expected contact name missing");
}
@@ -199,7 +198,7 @@ setup_and_start_view (EBookClientView *view)
g_signal_connect (view, "objects-removed", G_CALLBACK (objects_removed), NULL);
g_signal_connect (view, "complete", G_CALLBACK (complete), NULL);
- uid_field_list.data = (gpointer)e_contact_field_name (E_CONTACT_UID);
+ uid_field_list.data = (gpointer) e_contact_field_name (E_CONTACT_UID);
if (uids_only)
e_book_client_view_set_fields_of_interest (view, &uid_field_list, &error);
@@ -233,7 +232,6 @@ get_view_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
setup_and_start_view (view);
}
-
static gpointer
call_get_view (gpointer user_data)
{
@@ -302,7 +300,6 @@ main (gint argc, gchar **argv)
}
g_object_unref (book_client);
-
/*
* Sync version uids only
*/
@@ -338,7 +335,6 @@ main (gint argc, gchar **argv)
}
g_object_unref (book_client);
-
/*
* Async version all data
*/
@@ -347,7 +343,6 @@ main (gint argc, gchar **argv)
if (!setup_book (&book_client))
return 1;
-
START_TIMER (timer);
start_in_idle_with_main_loop (call_get_view, book_client);
STOP_TIMER (timer);
@@ -362,7 +357,6 @@ main (gint argc, gchar **argv)
g_object_unref (book_client);
-
/*
* Async version uids only
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]