diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-27 22:29:19 +0800 |
commit | 948235c3d1076dbe6ed2e57a24c16a083bbd9f01 (patch) | |
tree | 4133b1adfd94d8f889ca7ad4ad851346518f4171 /addressbook | |
parent | cc3a98fc1ad5bb87aa7335f3de404ee7feee1541 (diff) | |
download | gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.gz gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.tar.zst gsoc2013-evolution-948235c3d1076dbe6ed2e57a24c16a083bbd9f01.zip |
Prefer GLib basic types over C types.
Diffstat (limited to 'addressbook')
47 files changed, 727 insertions, 727 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 8dd03b3e75..781bd8391a 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -95,7 +95,7 @@ static EContactField priority [] = { E_CONTACT_FIELD_LAST }; -static int priority_label [] = { +static gint priority_label [] = { LABEL_WORK, LABEL_HOME, LABEL_FAX, @@ -167,10 +167,10 @@ struct _EAddrConduitCfg { * this function (see e_pilot_utf8_to_pchar() in e-pilot-util.c) */ static int -e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *category) +e_pilot_add_category_if_possible(gchar *cat_to_add, struct CategoryAppInfo *category) { - int i, j; - int retval = 0; /* 0 is the Unfiled category */ + gint i, j; + gint retval = 0; /* 0 is the Unfiled category */ LOG(g_message("e_pilot_add_category_if_possible\n")); for(i=0; i<PILOT_MAX_CATEGORIES; i++){ @@ -178,14 +178,14 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ the PalmOS doesn't let 0-length strings for categories */ if(strlen(category->name[i]) == 0){ - int cat_to_add_len; - int desktopUniqueID; + gint cat_to_add_len; + gint desktopUniqueID; cat_to_add_len = strlen(cat_to_add); retval = i; if(cat_to_add_len > 15){ - char tmpstr[16]; + gchar tmpstr[16]; strncpy(tmpstr, cat_to_add,16); tmpstr[16] = '\0'; /* Have to truncate the category name */ @@ -213,7 +213,7 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ * we don't have much use for it at present. */ for (desktopUniqueID = 128; desktopUniqueID <= 255; desktopUniqueID++) { - int found = 0; + gint found = 0; for(j=0; j<PILOT_MAX_CATEGORIES; j++){ if (category->ID[j] == desktopUniqueID) { found = 1; @@ -251,22 +251,22 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ * is set to zero ("Unfiled"). */ static -void e_pilot_local_category_to_remote(int * pilotCategory, +void e_pilot_local_category_to_remote(gint * pilotCategory, EContact *contact, struct CategoryAppInfo *category) { GList *c_list = NULL, *l; - char * category_string, *first_category = NULL; - int i; + gchar * category_string, *first_category = NULL; + gint i; *pilotCategory = 0; /* default to "Unfiled" */ c_list = e_contact_get (contact, E_CONTACT_CATEGORY_LIST); if (c_list) { /* remember the first category */ - first_category = e_pilot_utf8_to_pchar((const char *)c_list->data); + first_category = e_pilot_utf8_to_pchar((const gchar *)c_list->data); } l = c_list; while(l && *pilotCategory == 0) { /* list != 0, so at least 1 category is assigned */ - category_string = e_pilot_utf8_to_pchar((const char *)l->data); + category_string = e_pilot_utf8_to_pchar((const gchar *)l->data); for (i=0; i < PILOT_MAX_CATEGORIES; i++) { /* only 15 chars + nul in palm category name */ if (strncmp(category_string,category->name[i], 15) == 0) { @@ -296,10 +296,10 @@ void e_pilot_local_category_to_remote(int * pilotCategory, * conversion from a palm category to an evolution category */ static -void e_pilot_remote_category_to_local(int pilotCategory, +void e_pilot_remote_category_to_local(gint pilotCategory, EContact *contact, struct CategoryAppInfo *category) { - char *category_string = NULL; + gchar *category_string = NULL; if (pilotCategory != 0) { /* pda has category assigned */ @@ -344,17 +344,17 @@ void e_pilot_remote_category_to_local(int pilotCategory, } } -static char * -build_setup_path (const char *path, const char *key) +static gchar * +build_setup_path (const gchar *path, const gchar *key) { return g_strconcat ("/apps/evolution/conduit", "/", path, "/", key, NULL); } static gboolean -e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) +e_pilot_setup_get_bool (const gchar *path, const gchar *key, gboolean def) { gboolean res = def; - char *full_path; + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -379,10 +379,10 @@ e_pilot_setup_get_bool (const char *path, const char *key, gboolean def) } static void -e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) +e_pilot_setup_set_bool (const gchar *path, const gchar *key, gboolean value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -402,11 +402,11 @@ e_pilot_setup_set_bool (const char *path, const char *key, gboolean value) } } -static char * -e_pilot_setup_get_string (const char *path, const char *key, const char *def) +static gchar * +e_pilot_setup_get_string (const gchar *path, const gchar *key, const gchar *def) { - char *res = g_strdup (def); - char *full_path; + gchar *res = g_strdup (def); + gchar *full_path; GConfValue *value; GConfClient *gconf; @@ -433,10 +433,10 @@ e_pilot_setup_get_string (const char *path, const char *key, const char *def) } static void -e_pilot_setup_set_string (const char *path, const char *key, const char *value) +e_pilot_setup_set_string (const gchar *path, const gchar *key, const gchar *value) { GError *error = NULL; - char *full_path; + gchar *full_path; GConfClient *gconf; g_return_if_fail (path != NULL); @@ -577,7 +577,7 @@ e_addr_gui_new (EPilotSettings *ps) EAddrConduitGui *gui; GtkWidget *lbl; gint rows, i; - static const char *items[] = {"Business", "Home", "Other", NULL}; + static const gchar *items[] = {"Business", "Home", "Other", NULL}; g_return_val_if_fail (ps != NULL, NULL); g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL); @@ -602,7 +602,7 @@ e_addr_gui_new (EPilotSettings *ps) return gui; } -static const int default_address_map[] = { +static const gint default_address_map[] = { E_CONTACT_ADDRESS_WORK, E_CONTACT_ADDRESS_HOME, E_CONTACT_ADDRESS_OTHER, @@ -720,7 +720,7 @@ e_addr_context_destroy (EAddrConduitContext *ctxt) static const gchar * print_local (EAddrLocalRecord *local) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; if (local == NULL) { sprintf (buff, "[NULL]"); @@ -741,9 +741,9 @@ print_local (EAddrLocalRecord *local) return ""; } -static char *print_remote (GnomePilotRecord *remote) +static gchar *print_remote (GnomePilotRecord *remote) { - static char buff[ 4096 ]; + static gchar buff[ 4096 ]; struct Address addr; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; @@ -785,10 +785,10 @@ static char *print_remote (GnomePilotRecord *remote) } /* Utility routines */ -static char * +static gchar * map_name (EAddrConduitContext *ctxt) { - char *filename = NULL; + gchar *filename = NULL; filename = g_strdup_printf ("%s/.evolution/addressbook/local/system/pilot-map-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); @@ -950,15 +950,15 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) EContactField next_mail, next_home, next_work, next_fax; EContactField next_other, next_main, next_pager, next_mobile; gboolean syncable = TRUE; - int i, l = 0; + gint i, l = 0; /* See if there are fields we can't sync or not in priority order */ get_next_init (&next_mail, &next_home, &next_work, &next_fax, &next_other, &next_main, &next_pager, &next_mobile); for (i = entryPhone1; i <= entryPhone5 && syncable; i++) { - int phonelabel = local->addr->phoneLabel[i - entryPhone1]; - const char *phone_str = local->addr->entry[i]; + gint phonelabel = local->addr->phoneLabel[i - entryPhone1]; + const gchar *phone_str = local->addr->entry[i]; gboolean empty = !(phone_str && *phone_str); if (empty) @@ -1028,9 +1028,9 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) } static void -set_contact_text (EContact *contact, EContactField field, struct Address address, int entry) +set_contact_text (EContact *contact, EContactField field, struct Address address, gint entry) { - char *text = NULL; + gchar *text = NULL; if (address.entry[entry]) text = e_pilot_utf8_from_pchar (address.entry[entry]); @@ -1040,8 +1040,8 @@ set_contact_text (EContact *contact, EContactField field, struct Address address g_free (text); } -static char * -get_entry_text (struct Address address, int entry) +static gchar * +get_entry_text (struct Address address, gint entry) { if (address.entry[entry]) return e_pilot_utf8_from_pchar (address.entry[entry]); @@ -1050,7 +1050,7 @@ get_entry_text (struct Address address, int entry) } static void -clear_entry_text (struct Address address, int field) +clear_entry_text (struct Address address, gint field) { if (address.entry[field]) { free (address.entry[field]); @@ -1059,7 +1059,7 @@ clear_entry_text (struct Address address, int field) } static void -compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const char *uid) +compute_status (EAddrConduitContext *ctxt, EAddrLocalRecord *local, const gchar *uid) { EBookChange *ebc; @@ -1094,7 +1094,7 @@ local_record_to_pilot_record (EAddrLocalRecord *local, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #else - static char record[0xffff]; + static gchar record[0xffff]; #endif g_assert (local->addr != NULL ); @@ -1126,7 +1126,7 @@ local_record_to_pilot_record (EAddrLocalRecord *local, pi_buffer_free(buffer); #else - p.record = (unsigned char *)record; + p.record = (guchar *)record; p.length = pack_Address (local->addr, p.record, 0xffff); #endif return p; @@ -1136,10 +1136,10 @@ static void local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrConduitContext *ctxt) { EContactAddress *address = NULL; - int phone = entryPhone1; + gint phone = entryPhone1; EContactField field; gboolean syncable; - int i; + gint i; g_return_if_fail (local != NULL); g_return_if_fail (contact != NULL); @@ -1156,7 +1156,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui */ if (local->local.ID != 0) { struct Address addr; - int cat = 0; + gint cat = 0; #ifdef PILOT_LINK_0_12 pi_buffer_t * record; record = pi_buffer_new(DLP_BUF_SIZE); @@ -1165,7 +1165,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui return; } #else - char record[0xffff]; + gchar record[0xffff]; #endif if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, @@ -1182,7 +1182,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui #ifdef PILOT_LINK_0_12 unpack_Address (&addr, record, address_v1); #else - unpack_Address (&addr, (unsigned char *)record, 0xffff); + unpack_Address (&addr, (guchar *)record, 0xffff); #endif for (i = 0; i < 5; i++) { if (addr.entry[entryPhone1 + i]) @@ -1223,7 +1223,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui } if (address) { - char *add; + gchar *add; /* If the address has 2 lines, make sure both get added */ if (address->ext != NULL && @@ -1257,7 +1257,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui /* Sync by priority */ for (i = 0, phone = entryPhone1; priority[i] != E_CONTACT_FIELD_LAST && phone <= entryPhone5; i++) { - const char *phone_str; + const gchar *phone_str; phone_str = e_contact_get_const (contact, priority[i]); if (phone_str && *phone_str) { @@ -1280,8 +1280,8 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui /* Not completely syncable, so do the best we can */ for (i = entryPhone1; i <= entryPhone5; i++) { - int phonelabel = local->addr->phoneLabel[i - entryPhone1]; - const char *phone_str = NULL; + gint phonelabel = local->addr->phoneLabel[i - entryPhone1]; + const gchar *phone_str = NULL; if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) { phone_str = e_contact_get_const (contact, next_mail); @@ -1322,11 +1322,11 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui static void local_record_from_uid (EAddrLocalRecord *local, - const char *uid, + const gchar *uid, EAddrConduitContext *ctxt) { EContact *contact = NULL; - const char *cuid; + const gchar *cuid; GList *l; g_assert (local != NULL); @@ -1361,10 +1361,10 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, EContactName *name; EContactAddress *eaddress; EContactField mailing_address; - char *txt, *find, *full_name; + gchar *txt, *find, *full_name; EContactField next_mail, next_home, next_work, next_fax; EContactField next_other, next_main, next_pager, next_mobile; - int i; + gint i; #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif @@ -1459,8 +1459,8 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, &next_other, &next_main, &next_pager, &next_mobile); for (i = entryPhone1; i <= entryPhone5; i++) { - int phonelabel = address.phoneLabel[i - entryPhone1]; - char *phonenum = get_entry_text (address, i); + gint phonelabel = address.phoneLabel[i - entryPhone1]; + gchar *phonenum = get_entry_text (address, i); if (phonelabel == LABEL_EMAIL && !is_next_done (next_mail)) { e_contact_set (contact, next_mail, phonenum); @@ -1503,8 +1503,8 @@ static void check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt) { GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); - int map_count; - const char *uri; + gint map_count; + const gchar *uri; map_count = g_hash_table_size (ctxt->map->pid_map); if (map_count == 0) @@ -1579,15 +1579,15 @@ pre_sync (GnomePilotConduit *conduit, GnomePilotConduitSyncAbs *abs_conduit; EBookQuery *query; GList *l; - int len; - char *filename; - char *change_id; - char *auth; + gint len; + gchar *filename; + gchar *change_id; + gchar *auth; gint num_records, add_records = 0, mod_records = 0, del_records = 0; #ifdef PILOT_LINK_0_12 pi_buffer_t *buffer; #else - unsigned char *buf; + guchar *buf; #endif abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit); @@ -1644,7 +1644,7 @@ pre_sync (GnomePilotConduit *conduit, for (l = ctxt->changed; l != NULL; l = l->next) { EBookChange *ebc = l->data; - const char *uid; + const gchar *uid; uid = e_contact_get_const (ebc->contact, E_CONTACT_UID); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -1683,9 +1683,9 @@ pre_sync (GnomePilotConduit *conduit, len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, DLP_BUF_SIZE, buffer); #else - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, - (unsigned char *)buf, 0xffff); + (guchar *)buf, 0xffff); #endif if (len < 0) { WARN (_("Could not read pilot's Address application block")); @@ -1716,18 +1716,18 @@ post_sync (GnomePilotConduit *conduit, { GList *changed; gchar *filename, *change_id; - unsigned char *buf; - int dlpRetVal, len; + guchar *buf; + gint dlpRetVal, len; LOG (g_message ( "post_sync: Address Conduit v.%s", CONDUIT_VERSION )); /* Write AppBlock to PDA - updates categories */ - buf = (unsigned char*)g_malloc (0xffff); + buf = (guchar *)g_malloc (0xffff); len = pack_AddressAppInfo (&(ctxt->ai), buf, 0xffff); dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, - (unsigned char *)buf, len); + (guchar *)buf, len); g_free (buf); @@ -1778,7 +1778,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord *local, EAddrConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ( "set_status_cleared: clearing status\n" )); @@ -1794,7 +1794,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { static GList *cards, *iterator; - static int count; + static gint count; g_return_val_if_fail (local != NULL, -1); @@ -1844,7 +1844,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { static GList *iterator; - static int count; + static gint count; g_return_val_if_fail (local != NULL, 0); @@ -1898,7 +1898,7 @@ compare (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { GnomePilotRecord local_pilot; - int retval = 0; + gint retval = 0; LOG (g_message ("compare: local=%s remote=%s...\n", print_local (local), print_remote (remote))); @@ -1926,7 +1926,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { EContact *contact; - int retval = 0; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1957,8 +1957,8 @@ replace_record (GnomePilotConduitSyncAbs *conduit, { EContact *new_contact; EBookChange *ebc; - char *old_id; - int retval = 0; + gchar *old_id; + gint retval = 0; g_return_val_if_fail (remote != NULL, -1); @@ -1989,7 +1989,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, /* Adding a record causes wombat to assign a new uid so we must tidy */ if (ebc && ebc->change_type == E_BOOK_CHANGE_CARD_DELETED) { - const char *uid = e_contact_get_const (local->contact, E_CONTACT_UID); + const gchar *uid = e_contact_get_const (local->contact, E_CONTACT_UID); gboolean arch; arch = e_pilot_map_uid_is_archived (ctxt->map, uid); @@ -2015,7 +2015,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { GError *error = NULL; - int retval = 0; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (local->contact != NULL, -1); @@ -2039,7 +2039,7 @@ archive_record (GnomePilotConduitSyncAbs *conduit, gboolean archive, EAddrConduitContext *ctxt) { - int retval = 0; + gint retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -2056,7 +2056,7 @@ match (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord **local, EAddrConduitContext *ctxt) { - const char *uid; + const gchar *uid; LOG (g_message ("match: looking for local copy of %s\n", print_remote (remote))); diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index c786a40a13..e753351755 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -70,8 +70,8 @@ #define GLADE_FILE_NAME "ldap-config.glade" -GtkWidget* supported_bases_create_table (char *name, char *string1, char *string2, - int num1, int num2); +GtkWidget* supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, + gint num1, gint num2); /* default objectclasses */ #define TOP "top" @@ -147,7 +147,7 @@ ldap_unparse_auth (AddressbookLDAPAuthType auth_type) } static AddressbookLDAPAuthType -ldap_parse_auth (const char *auth) +ldap_parse_auth (const gchar *auth) { if (!auth) return ADDRESSBOOK_LDAP_AUTH_NONE; @@ -191,7 +191,7 @@ ldap_unparse_ssl (AddressbookLDAPSSLType ssl_type) } static AddressbookLDAPSSLType -ldap_parse_ssl (const char *ssl) +ldap_parse_ssl (const gchar *ssl) { if (!ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; /* XXX good default? */ @@ -204,7 +204,7 @@ ldap_parse_ssl (const char *ssl) return ADDRESSBOOK_LDAP_SSL_WHENEVER_POSSIBLE; } -static const char * +static const gchar * ldap_get_ssl_tooltip (AddressbookLDAPSSLType ssl_type) { switch (ssl_type) { @@ -266,8 +266,8 @@ addressbook_ldap_init (GtkWidget *window, ESource *source) LDAP *ldap; gchar *host; gint port; - int ldap_error; - int protocol_version = LDAP_VERSION3; + gint ldap_error; + gint protocol_version = LDAP_VERSION3; if (!source_to_uri_parts (source, &host, NULL, NULL, NULL, &port)) return NULL; @@ -305,7 +305,7 @@ static int addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, const gchar **attrs, LDAPMessage **resp) { - int ldap_error; + gint ldap_error; struct timeval timeout; timeout.tv_sec = (gint) gtk_adjustment_get_value (GTK_RANGE(dialog->timeout_scale)->adjustment); @@ -323,7 +323,7 @@ addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, /* searching page */ GtkWidget* -supported_bases_create_table (char *name, char *string1, char *string2, int num1, int num2) +supported_bases_create_table (gchar *name, gchar *string1, gchar *string2, gint num1, gint num2) { GtkWidget *table, *scrolled; GtkTreeSelection *selection; @@ -354,10 +354,10 @@ do_ldap_root_dse_query (AddressbookSourceDialog *sdialog, GtkListStore *model, E { LDAP *ldap; const gchar *attrs[2]; - int ldap_error; - char **values; + gint ldap_error; + gchar **values; LDAPMessage *resp; - int i; + gint i; ldap = addressbook_ldap_init (sdialog->window, source); if (!ldap) @@ -414,7 +414,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) GtkWidget *supported_bases_table; GladeXML *gui; GtkTreeIter iter; - char *gladefile; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, @@ -445,7 +445,7 @@ query_for_supported_bases (GtkWidget *button, AddressbookSourceDialog *sdialog) if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK && gtk_tree_selection_get_selected (selection, &model, &iter)) { - char *dn; + gchar *dn; gtk_tree_model_get (model, &iter, 0, &dn, -1); gtk_entry_set_text((GtkEntry *)sdialog->rootdn, dn); @@ -469,7 +469,7 @@ addressbook_config_create_new_source (GtkWidget *parent) static void eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) { - int id = gtk_combo_box_get_active(dropdown); + gint id = gtk_combo_box_get_active(dropdown); GtkTreeModel *model; GtkTreeIter iter; @@ -489,7 +489,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "groupwise:", 10)) { GSList *l; ESource *source; - char *tmp; + gchar *tmp; l = e_source_group_peek_sources(sdialog->source_group); if (l && l->data ) { @@ -505,7 +505,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) g_free (tmp); #ifdef HAVE_LDAP } else if (!strncmp(e_source_group_peek_base_uri(sdialog->source_group), "ldap:", 5)) { - char *tmp; + gchar *tmp; tmp = g_strdup_printf ("%s:%s/%s?" /* trigraph prevention */ "?%s", "", LDAP_PORT_STRING, @@ -524,7 +524,7 @@ eabc_type_changed(GtkComboBox *dropdown, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkComboBox *dropdown; @@ -533,7 +533,7 @@ eabc_general_type(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str GtkTreeIter iter; GSList *l; GtkWidget *w, *label; - int i, row = 0; + gint i, row = 0; if (old) return old; @@ -590,13 +590,13 @@ offline_status_changed_cb (GtkWidget *widget, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *uri; + const gchar *uri; GtkWidget *w; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (old) return old; @@ -629,11 +629,11 @@ eabc_general_name(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static GtkWidget * -eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_offline(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *offline_setting; - const char *offline_sync; + const gchar *offline_sync; gboolean is_local_book; is_local_book = g_str_has_prefix (e_source_group_peek_base_uri (sdialog->source_group), "file:"); @@ -696,7 +696,7 @@ host_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void port_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *port = gtk_entry_get_text((GtkEntry *)w); + const gchar *port = gtk_entry_get_text((GtkEntry *)w); if (!strcmp (port, LDAPS_PORT_STRING)) { sdialog->ssl = ADDRESSBOOK_LDAP_SSL_ALWAYS; @@ -720,15 +720,15 @@ ssl_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static GtkWidget * -eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; - const char *tmp; + const gchar *tmp; GtkWidget *w; - char *uri, port[16]; + gchar *uri, port[16]; LDAPURLDesc *lud; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -778,7 +778,7 @@ eabc_general_host(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, str static void auth_entry_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - const char *principal = gtk_entry_get_text((GtkEntry *)w); + const gchar *principal = gtk_entry_get_text((GtkEntry *)w); /* seems messy ... but the api is */ switch (sdialog->auth) { @@ -809,13 +809,13 @@ auth_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_general_auth(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -878,14 +878,14 @@ scope_combobox_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) } static GtkWidget * -eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; LDAPURLDesc *lud; - char *uri; + gchar *uri; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -946,7 +946,7 @@ eabc_details_search(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, s static void timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char *timeout; + gchar *timeout; timeout = g_strdup_printf("%f", gtk_adjustment_get_value(((GtkRange *)sdialog->timeout_scale)->adjustment)); e_source_set_property(sdialog->source, "timeout", timeout); @@ -956,7 +956,7 @@ timeout_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) static void limit_changed_cb(GtkWidget *w, AddressbookSourceDialog *sdialog) { - char limit[16]; + gchar limit[16]; sprintf(limit, "%d", gtk_spin_button_get_value_as_int((GtkSpinButton *)sdialog->limit_spinbutton)); e_source_set_property(sdialog->source, "limit", limit); @@ -972,13 +972,13 @@ canbrowse_toggled_cb (GtkWidget *toggle_button, ESource *source) } static GtkWidget * -eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data) +eabc_details_limit(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, gpointer data) { AddressbookSourceDialog *sdialog = data; GtkWidget *w; - const char *tmp; + const gchar *tmp; GladeXML *gui; - char *gladefile; + gchar *gladefile; if (!source_group_is_remote(sdialog->source_group)) return NULL; @@ -1040,18 +1040,18 @@ static EConfigItem eabc_new_items[] = { }; static void -eabc_commit(EConfig *ec, GSList *items, void *data) +eabc_commit(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; xmlNodePtr xml; #if d(!)0 - char *txt; + gchar *txt; #endif if (sdialog->original_source) { d(printf("committing addressbook changes\n")); /* these api's kinda suck */ - xml = xmlNewNode(NULL, (const unsigned char *)"dummy"); + xml = xmlNewNode(NULL, (const guchar *)"dummy"); e_source_dump_to_xml_node(sdialog->source, xml); e_source_update_from_xml_node(sdialog->original_source, xml->children, NULL); xmlFreeNode(xml); @@ -1074,7 +1074,7 @@ eabc_commit(EConfig *ec, GSList *items, void *data) } static void -eabc_free(EConfig *ec, GSList *items, void *data) +eabc_free(EConfig *ec, GSList *items, gpointer data) { AddressbookSourceDialog *sdialog = data; @@ -1093,11 +1093,11 @@ eabc_free(EConfig *ec, GSList *items, void *data) } static gboolean -eabc_check_complete(EConfig *ec, const char *pageid, void *data) +eabc_check_complete(EConfig *ec, const gchar *pageid, gpointer data) { AddressbookSourceDialog *sdialog = data; - int valid = TRUE; - const char *tmp; + gint valid = TRUE; + const gchar *tmp; ESource *source; d(printf("check complete, pageid = '%s'\n", pageid?pageid:"<all>")); @@ -1109,7 +1109,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) #ifdef HAVE_LDAP if (valid && source_group_is_remote(sdialog->source_group)) { - char *uri = e_source_get_uri(sdialog->source); + gchar *uri = e_source_get_uri(sdialog->source); LDAPURLDesc *lud; /* check host and port set */ @@ -1153,7 +1153,7 @@ eabc_check_complete(EConfig *ec, const char *pageid, void *data) static void source_changed(ESource *source, AddressbookSourceDialog *sdialog) { - char *xml; + gchar *xml; xml = e_source_to_standalone_xml(source); printf("source changed:\n%s\n", xml); @@ -1166,11 +1166,11 @@ addressbook_config_edit_source (GtkWidget *parent, ESource *source) { AddressbookSourceDialog *sdialog = g_new0 (AddressbookSourceDialog, 1); EABConfig *ec; - int i; + gint i; GSList *items = NULL; EABConfigTargetSource *target; - char *xml; - char *gladefile; + gchar *xml; + gchar *gladefile; gladefile = g_build_filename (EVOLUTION_GLADEDIR, GLADE_FILE_NAME, diff --git a/addressbook/gui/component/autocompletion-config.c b/addressbook/gui/component/autocompletion-config.c index 548c0cbd7e..370c1a1e7e 100644 --- a/addressbook/gui/component/autocompletion-config.c +++ b/addressbook/gui/component/autocompletion-config.c @@ -82,7 +82,7 @@ initialize_selection (ESourceSelector *source_selector) for (sources = e_source_group_peek_sources (group); sources; sources = sources->next) { ESource *source = E_SOURCE (sources->data); - const char *completion; + const gchar *completion; completion = e_source_get_property (source, "completion"); if (completion && !g_ascii_strcasecmp (completion, "true")) diff --git a/addressbook/gui/component/e-book-shell-migrate.c b/addressbook/gui/component/e-book-shell-migrate.c index 2c9aa6afb0..4ac70309e7 100644 --- a/addressbook/gui/component/e-book-shell-migrate.c +++ b/addressbook/gui/component/e-book-shell-migrate.c @@ -108,7 +108,7 @@ dialog_close (MigrationContext *context) } static void -dialog_set_label (MigrationContext *context, const char *str) +dialog_set_label (MigrationContext *context, const gchar *str) { gtk_label_set_text (GTK_LABEL (context->label), str); @@ -121,9 +121,9 @@ dialog_set_label (MigrationContext *context, const char *str) } static void -dialog_set_folder_name (MigrationContext *context, const char *folder_name) +dialog_set_folder_name (MigrationContext *context, const gchar *folder_name) { - char *text; + gchar *text; text = g_strdup_printf (_("Migrating '%s':"), folder_name); gtk_label_set_text (GTK_LABEL (context->folder_label), text); @@ -142,7 +142,7 @@ dialog_set_folder_name (MigrationContext *context, const char *folder_name) static void dialog_set_progress (MigrationContext *context, double percent) { - char text[5]; + gchar text[5]; snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); @@ -158,7 +158,7 @@ dialog_set_progress (MigrationContext *context, double percent) } static gboolean -check_for_conflict (ESourceGroup *group, char *name) +check_for_conflict (ESourceGroup *group, gchar *name) { GSList *sources; GSList *s; @@ -175,16 +175,16 @@ check_for_conflict (ESourceGroup *group, char *name) return FALSE; } -static char * -get_source_name (ESourceGroup *group, const char *path) +static gchar * +get_source_name (ESourceGroup *group, const gchar *path) { #ifndef G_OS_WIN32 - char **p = g_strsplit (path, "/", 0); + gchar **p = g_strsplit (path, "/", 0); #else - char **p = g_strsplit_set (path, "\\/", 0); + gchar **p = g_strsplit_set (path, "\\/", 0); #endif - int i, j, starting_index; - int num_elements; + gint i, j, starting_index; + gint num_elements; gboolean conflict; GString *s = g_string_new (""); @@ -229,8 +229,8 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) { EBookQuery *query = e_book_query_any_field_contains (""); GList *l, *contacts; - int num_added = 0; - int num_contacts; + gint num_added = 0; + gint num_contacts; /* both books are loaded, start the actual migration */ e_book_get_contacts (old_book, query, &contacts, NULL); @@ -343,7 +343,7 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) "OTHER"); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { /* k, this is the nasty part. we glomb all the value strings back together again (if there is more than one), then work our magic */ @@ -383,9 +383,9 @@ migrate_contacts (MigrationContext *context, EBook *old_book, EBook *new_book) } static void -migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESource *new_source) +migrate_contact_folder_to_source (MigrationContext *context, gchar *old_path, ESource *new_source) { - char *old_uri = g_filename_to_uri (old_path, NULL, NULL); + gchar *old_uri = g_filename_to_uri (old_path, NULL, NULL); GError *e = NULL; EBook *old_book = NULL, *new_book = NULL; @@ -425,7 +425,7 @@ migrate_contact_folder_to_source (MigrationContext *context, char *old_path, ESo } static void -migrate_contact_folder (MigrationContext *context, char *old_path, ESourceGroup *dest_group, char *source_name) +migrate_contact_folder (MigrationContext *context, gchar *old_path, ESourceGroup *dest_group, gchar *source_name) { ESource *new_source; @@ -451,7 +451,7 @@ create_groups (MigrationContext *context, { GSList *groups; ESourceGroup *group; - char *base_uri, *base_uri_proto; + gchar *base_uri, *base_uri_proto; *on_this_computer = NULL; *on_ldap_servers = NULL; @@ -528,9 +528,9 @@ create_groups (MigrationContext *context, static gboolean migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer, ESource *personal_source) { - char *old_path = NULL; + gchar *old_path = NULL; GSList *dirs, *l; - char *local_contact_folder = NULL; + gchar *local_contact_folder = NULL; old_path = g_strdup_printf ("%s/evolution/local", g_get_home_dir ()); @@ -542,15 +542,15 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer NULL); for (l = dirs; l; l = l->next) { - char *source_name; + gchar *source_name; /* we handle the system folder differently */ - if (personal_source && !strcmp ((char*)l->data, local_contact_folder)) { + if (personal_source && !strcmp ((gchar *)l->data, local_contact_folder)) { g_hash_table_insert (context->folder_uid_map, g_strdup (l->data), g_strdup (e_source_peek_uid (personal_source))); migrate_contact_folder_to_source (context, local_contact_folder, personal_source); continue; } - source_name = get_source_name (on_this_computer, (char*)l->data); + source_name = get_source_name (on_this_computer, (gchar *)l->data); migrate_contact_folder (context, l->data, on_this_computer, source_name); g_free (source_name); } @@ -563,13 +563,13 @@ migrate_local_folders (MigrationContext *context, ESourceGroup *on_this_computer return TRUE; } -static char * +static gchar * get_string_child (xmlNode *node, - const char *name) + const gchar *name) { xmlNode *p; xmlChar *xml_string; - char *retval; + gchar *retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -580,7 +580,7 @@ get_string_child (xmlNode *node, return g_strdup(""); xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = g_strdup ((char *) xml_string); + retval = g_strdup ((gchar *) xml_string); xmlFree (xml_string); return retval; @@ -588,12 +588,12 @@ get_string_child (xmlNode *node, static int get_integer_child (xmlNode *node, - const char *name, - int defval) + const gchar *name, + gint defval) { xmlNode *p; xmlChar *xml_string; - int retval; + gint retval; p = e_xml_get_child_by_name (node, (xmlChar *) name); if (p == NULL) @@ -604,7 +604,7 @@ get_integer_child (xmlNode *node, return defval; xml_string = xmlNodeListGetString (node->doc, p, 1); - retval = atoi ((char *)xml_string); + retval = atoi ((gchar *)xml_string); xmlFree (xml_string); return retval; @@ -613,7 +613,7 @@ get_integer_child (xmlNode *node, static gboolean migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) { - char *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", + gchar *sources_xml = g_strdup_printf ("%s/evolution/addressbook-sources.xml", g_get_home_dir ()); printf ("trying to migrate from %s\n", sources_xml); @@ -622,14 +622,14 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) xmlDoc *doc = xmlParseFile (sources_xml); xmlNode *root; xmlNode *child; - int num_contactservers; - int servernum; + gint num_contactservers; + gint servernum; if (!doc) return FALSE; root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "addressbooks") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "addressbooks") != 0) { xmlFreeDoc (doc); return FALSE; } @@ -637,7 +637,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) /* count the number of servers, so we can give progress */ num_contactservers = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { + if (!strcmp ((const gchar *)child->name, "contactserver")) { num_contactservers++; } } @@ -647,11 +647,11 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) servernum = 0; for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "contactserver")) { - char *port, *host, *rootdn, *scope, *authmethod, *ssl; - char *emailaddr, *binddn, *limitstr; - int limit; - char *name, *description; + if (!strcmp ((const gchar *)child->name, "contactserver")) { + gchar *port, *host, *rootdn, *scope, *authmethod, *ssl; + gchar *emailaddr, *binddn, *limitstr; + gint limit; + gchar *name, *description; GString *uri = g_string_new (""); ESource *source; @@ -711,7 +711,7 @@ migrate_ldap_servers (MigrationContext *context, ESourceGroup *on_ldap_servers) } static ESource* -get_source_by_name (ESourceList *source_list, const char *name) +get_source_by_name (ESourceList *source_list, const gchar *name) { GSList *groups; GSList *g; @@ -731,7 +731,7 @@ get_source_by_name (ESourceList *source_list, const char *name) for (s = sources; s; s = s->next) { ESource *source = E_SOURCE (s->data); - const char *source_name = e_source_peek_name (source); + const gchar *source_name = e_source_peek_name (source); if (!strcmp (name, source_name)) return source; @@ -766,14 +766,14 @@ migrate_completion_folders (MigrationContext *context) dialog_set_folder_name (context, _("Autocompletion Settings")); root = xmlDocGetRootElement (doc); - if (root == NULL || strcmp ((const char *)root->name, "EvolutionFolderList") != 0) { + if (root == NULL || strcmp ((const gchar *)root->name, "EvolutionFolderList") != 0) { xmlFreeDoc (doc); return FALSE; } for (child = root->children; child; child = child->next) { - if (!strcmp ((const char *)child->name, "folder")) { - char *physical_uri = e_xml_get_string_prop_by_name (child, (const unsigned char *)"physical-uri"); + if (!strcmp ((const gchar *)child->name, "folder")) { + gchar *physical_uri = e_xml_get_string_prop_by_name (child, (const guchar *)"physical-uri"); ESource *source = NULL; /* if the physical uri is file://... @@ -788,8 +788,8 @@ migrate_completion_folders (MigrationContext *context) for the uri. */ if (!strncmp (physical_uri, "file://", 7)) { - char *filename = g_filename_from_uri (physical_uri, NULL, NULL); - char *uid = NULL; + gchar *filename = g_filename_from_uri (physical_uri, NULL, NULL); + gchar *uid = NULL; if (filename) uid = g_hash_table_lookup (context->folder_uid_map, @@ -799,7 +799,7 @@ migrate_completion_folders (MigrationContext *context) source = e_source_list_peek_source_by_uid (context->source_list, uid); } else { - char *name = e_xml_get_string_prop_by_name (child, (const unsigned char *)"display-name"); + gchar *name = e_xml_get_string_prop_by_name (child, (const guchar *)"display-name"); source = get_source_by_name (context->source_list, name); @@ -838,14 +838,14 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate contact lists for source %s", uri); g_free (uri); continue; @@ -869,8 +869,8 @@ migrate_contact_lists_for_local_folders (MigrationContext *context, ESourceGroup GList *v = e_vcard_attribute_get_values (a); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { - EDestination *dest = e_destination_import ((char*)v->data); + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { + EDestination *dest = e_destination_import ((gchar *)v->data); e_destination_export_to_vcard_attribute (dest, a); @@ -913,14 +913,14 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup EBook *book; EBookQuery *query; GList *l, *contacts; - int num_contacts, num_converted; + gint num_contacts, num_converted; dialog_set_folder_name (context, e_source_peek_name (source)); book = e_book_new (source, NULL); if (!book || !e_book_open (book, TRUE, NULL)) { - char *uri = e_source_get_uri (source); + gchar *uri = e_source_get_uri (source); g_warning ("failed to migrate company phone numbers for source %s", uri); g_free (uri); continue; @@ -937,7 +937,7 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup GError *e = NULL; GList *attrs, *attr; gboolean converted = FALSE; - int num_work_voice = 0; + gint num_work_voice = 0; attrs = e_vcard_get_attributes (E_VCARD (contact)); for (attr = attrs; attr;) { @@ -1006,11 +1006,11 @@ migrate_company_phone_for_local_folders (MigrationContext *context, ESourceGroup } static void -migrate_pilot_data (const char *old_path, const char *new_path) +migrate_pilot_data (const gchar *old_path, const gchar *new_path) { - const char *dent; - const char *ext; - char *filename; + const gchar *dent; + const gchar *ext; + gchar *filename; GDir *dir; if (!(dir = g_dir_open (old_path, 0, NULL))) @@ -1022,9 +1022,9 @@ migrate_pilot_data (const char *old_path, const char *new_path) (!strncmp (dent, "pilot-sync-evolution-addressbook-", 33) && ((ext = strrchr (dent, '.')) && !strcmp (ext, ".db")))) { /* src and dest file formats are identical for both map and changelog files */ - unsigned char inbuf[4096]; + guchar inbuf[4096]; size_t nread, nwritten; - int fd0, fd1; + gint fd0, fd1; ssize_t n; filename = g_build_filename (old_path, dent, NULL); @@ -1181,7 +1181,7 @@ e_book_shell_backend_migrate (EShellBackend *shell_backend, } if (minor < 5 || (minor == 5 && micro <= 10)) { - char *old_path, *new_path; + gchar *old_path, *new_path; dialog_set_label (context, _("Evolution's Palm Sync changelog and map files have changed.\n\n" "Please be patient while Evolution migrates your Pilot Sync data...")); diff --git a/addressbook/gui/component/eab-composer-util.c b/addressbook/gui/component/eab-composer-util.c index 46d28b0790..6d45f13a94 100644 --- a/addressbook/gui/component/eab-composer-util.c +++ b/addressbook/gui/component/eab-composer-util.c @@ -89,11 +89,11 @@ eab_send_as_to (GList *destinations) gtk_widget_show (GTK_WIDGET (composer)); } -static const char * +static const gchar * get_email (EContact *contact, EContactField field_id, gchar **to_free) { - char *name = NULL, *mail = NULL; - const char *value = e_contact_get_const (contact, field_id); + gchar *name = NULL, *mail = NULL; + const gchar *value = e_contact_get_const (contact, field_id); *to_free = NULL; diff --git a/addressbook/gui/component/openldap-extract.h b/addressbook/gui/component/openldap-extract.h index 010589da1e..083fc0d162 100644 --- a/addressbook/gui/component/openldap-extract.h +++ b/addressbook/gui/component/openldap-extract.h @@ -48,7 +48,7 @@ #define LDAP_CALLOC(n,s) calloc((n),(s)) #define LDAP_REALLOC(p,s) realloc((p),(s)) #define LDAP_FREE(p) free((p)) -#define LDAP_VFREE(p) vfree((void **)(p)) +#define LDAP_VFREE(p) vfree((gpointer *)(p)) #define LDAP_STRDUP(s) strdup((s)) #define LDAP_RANGE(n,x,y) (((x) <= (n)) && ((n) <= (y))) @@ -87,21 +87,21 @@ #define LDAP_SCHEMA_SKIP 0x80U /* Don't malloc any result */ typedef struct ldap_objectclass { - char *oc_oid; /* REQUIRED */ - char **oc_names; /* OPTIONAL */ - char *oc_desc; /* OPTIONAL */ - int oc_obsolete; /* 0=no, 1=yes */ - char **oc_sup_oids; /* OPTIONAL */ - int oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ - char **oc_at_oids_must; /* OPTIONAL */ - char **oc_at_oids_may; /* OPTIONAL */ + gchar *oc_oid; /* REQUIRED */ + gchar **oc_names; /* OPTIONAL */ + gchar *oc_desc; /* OPTIONAL */ + gint oc_obsolete; /* 0=no, 1=yes */ + gchar **oc_sup_oids; /* OPTIONAL */ + gint oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */ + gchar **oc_at_oids_must; /* OPTIONAL */ + gchar **oc_at_oids_may; /* OPTIONAL */ } LDAPObjectClass; static void -vfree(void **vec) +vfree(gpointer *vec) { - int i; + gint i; for (i = 0; vec[i] != NULL; i++) free(vec[i]); @@ -143,17 +143,17 @@ vfree(void **vec) #define TK_QDESCR TK_QDSTRING struct token { - int type; - char *sval; + gint type; + gchar *sval; }; static int -get_token( const char ** sp, char ** token_val ) +get_token( const gchar ** sp, gchar ** token_val ) { - int kind; - const char * p; - const char * q; - char * res; + gint kind; + const gchar * p; + const gchar * q; + gchar * res; *token_val = NULL; switch (**sp) { @@ -223,20 +223,20 @@ get_token( const char ** sp, char ** token_val ) /* Gobble optional whitespace */ static void -parse_whsp(const char **sp) +parse_whsp(const gchar **sp) { while (LDAP_SPACE(**sp)) (*sp)++; } /* Parse a sequence of dot-separated decimal strings */ -static char * -ldap_int_parse_numericoid(const char **sp, int *code, const int flags) +static gchar * +ldap_int_parse_numericoid(const gchar **sp, gint *code, const gint flags) { - char * res = NULL; - const char * start = *sp; - int len; - int quoted = 0; + gchar * res = NULL; + const gchar * start = *sp; + gint len; + gint quoted = 0; /* Netscape puts the SYNTAX value in quotes (incorrectly) */ if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && **sp == '\'' ) { @@ -248,7 +248,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) while (**sp) { if ( !LDAP_DIGIT(**sp) ) { /* - * Initial char is not a digit or char after dot is + * Initial gchar is not a digit or gchar after dot is * not a digit */ *code = LDAP_SCHERR_NODIGIT; @@ -262,7 +262,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) /* Otherwise, gobble the dot and loop again */ (*sp)++; } - /* Now *sp points at the char past the numericoid. Perfect. */ + /* Now *sp points at the gchar past the numericoid. Perfect. */ len = *sp - start; if ( flags & LDAP_SCHEMA_ALLOW_QUOTED && quoted ) { if ( **sp == '\'' ) { @@ -273,7 +273,7 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } } if (flags & LDAP_SCHEMA_SKIP) { - res = (char *)start; + res = (gchar *)start; } else { res = LDAP_MALLOC(len+1); if (!res) { @@ -287,22 +287,22 @@ ldap_int_parse_numericoid(const char **sp, int *code, const int flags) } /* Parse a qdescr or a list of them enclosed in () */ -static char ** -parse_qdescrs(const char **sp, int *code) +static gchar ** +parse_qdescrs(const gchar **sp, gint *code) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; parse_whsp(sp); kind = get_token(sp,&sval); if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -316,7 +316,7 @@ parse_qdescrs(const char **sp, int *code) if ( kind == TK_QDESCR ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_VFREE(res); LDAP_FREE(sval); @@ -338,7 +338,7 @@ parse_qdescrs(const char **sp, int *code) parse_whsp(sp); return(res); } else if ( kind == TK_QDESCR ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -355,15 +355,15 @@ parse_qdescrs(const char **sp, int *code) } /* Parse a woid or a $-separated list of them enclosed in () */ -static char ** -parse_oids(const char **sp, int *code, const int allow_quoted) +static gchar ** +parse_oids(const gchar **sp, gint *code, const gint allow_quoted) { - char ** res; - char ** res1; - int kind; - char * sval; - int size; - int pos; + gchar ** res; + gchar ** res1; + gint kind; + gchar * sval; + gint size; + gint pos; /* * Strictly speaking, doing this here accepts whsp before the @@ -376,7 +376,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) if ( kind == TK_LEFTPAREN ) { /* Let's presume there will be at least 2 entries */ size = 3; - res = LDAP_CALLOC(3,sizeof(char *)); + res = LDAP_CALLOC(3,sizeof(gchar *)); if ( !res ) { *code = LDAP_SCHERR_OUTOFMEM; return NULL; @@ -407,7 +407,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) kind == TK_QDSTRING ) ) { if ( pos == size-2 ) { size++; - res1 = LDAP_REALLOC(res,size*sizeof(char *)); + res1 = LDAP_REALLOC(res,size*sizeof(gchar *)); if ( !res1 ) { LDAP_FREE(sval); LDAP_VFREE(res); @@ -436,7 +436,7 @@ parse_oids(const char **sp, int *code, const int allow_quoted) return(res); } else if ( kind == TK_BAREWORD || ( allow_quoted && kind == TK_QDSTRING ) ) { - res = LDAP_CALLOC(2,sizeof(char *)); + res = LDAP_CALLOC(2,sizeof(gchar *)); if ( !res ) { LDAP_FREE(sval); *code = LDAP_SCHERR_OUTOFMEM; @@ -466,24 +466,24 @@ ldap_objectclass_free(LDAPObjectClass * oc) } static LDAPObjectClass * -ldap_str2objectclass( LDAP_CONST char * s, - int * code, - LDAP_CONST char ** errp, +ldap_str2objectclass( LDAP_CONST gchar * s, + gint * code, + LDAP_CONST gchar ** errp, LDAP_CONST unsigned flags ) { - int kind; - const char * ss = s; - char * sval; - int seen_name = 0; - int seen_desc = 0; - int seen_obsolete = 0; - int seen_sup = 0; - int seen_kind = 0; - int seen_must = 0; - int seen_may = 0; + gint kind; + const gchar * ss = s; + gchar * sval; + gint seen_name = 0; + gint seen_desc = 0; + gint seen_obsolete = 0; + gint seen_sup = 0; + gint seen_kind = 0; + gint seen_must = 0; + gint seen_may = 0; LDAPObjectClass * oc; - char ** ext_vals; - const char * savepos; + gchar ** ext_vals; + const gchar * savepos; if ( !s ) { *code = LDAP_SCHERR_EMPTY; @@ -539,7 +539,7 @@ ldap_str2objectclass( LDAP_CONST char * s, } else if ( flags & LDAP_SCHEMA_ALLOW_OID_MACRO ) { /* Non-numerical OID, ignore */ - int len = ss-savepos; + gint len = ss-savepos; oc->oc_oid = LDAP_MALLOC(len+1); strncpy(oc->oc_oid, savepos, len); oc->oc_oid[len] = 0; @@ -741,21 +741,21 @@ ldap_str2objectclass( LDAP_CONST char * s, #define LDAP_UTF8_INCR(p) ((p)=LDAP_UTF8_NEXT((p))) #define ldap_x_utf8_to_ucs4(str) g_utf8_get_char(str) -static char *ldap_utf8_strchr( const char *str, const char *chr ) +static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr ) { for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) { if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) { - return (char *) str; + return (gchar *) str; } } return NULL; } -static size_t ldap_utf8_strcspn( const char *str, const char *set ) +static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; *cset != '\0'; LDAP_UTF8_INCR(cset) ) { @@ -768,10 +768,10 @@ static size_t ldap_utf8_strcspn( const char *str, const char *set ) return cstr - str; } -static size_t ldap_utf8_strspn( const char *str, const char *set ) +static size_t ldap_utf8_strspn( const gchar *str, const gchar *set ) { - const char *cstr; - const char *cset; + const gchar *cstr; + const gchar *cset; for( cstr = str; *cstr != '\0'; LDAP_UTF8_INCR(cstr) ) { for( cset = set; ; LDAP_UTF8_INCR(cset) ) { @@ -788,10 +788,10 @@ static size_t ldap_utf8_strspn( const char *str, const char *set ) return cstr - str; } -static char *ldap_utf8_strtok(char *str, const char *sep, char **last) +static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last) { - char *begin; - char *end; + gchar *begin; + gchar *end; if( last == NULL ) return NULL; @@ -807,7 +807,7 @@ static char *ldap_utf8_strtok(char *str, const char *sep, char **last) end = &begin[ ldap_utf8_strcspn( begin, sep ) ]; if( *end != '\0' ) { - char *next = LDAP_UTF8_NEXT( end ); + gchar *next = LDAP_UTF8_NEXT( end ); *end = '\0'; end = next; } @@ -856,17 +856,17 @@ typedef struct ldap_url_desc { /* from url.c */ -static const char* +static const gchar * skip_url_prefix( - const char *url, - int *enclosedp, - const char **scheme ) + const gchar *url, + gint *enclosedp, + const gchar **scheme ) { /* * return non-zero if this looks like a LDAP URL; zero if not * if non-zero returned, *urlp will be moved past "ldap://" part of URL */ - const char *p; + const gchar *p; if ( url == NULL ) { return( NULL ); @@ -924,7 +924,7 @@ skip_url_prefix( return( NULL ); } -static int str2scope( const char *p ) +static gint str2scope( const gchar *p ) { if ( strcasecmp( p, "one" ) == 0 ) { return LDAP_SCOPE_ONELEVEL; @@ -980,7 +980,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp ) } static int -ldap_int_unhex( int c ) +ldap_int_unhex( gint c ) { return( c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 @@ -988,7 +988,7 @@ ldap_int_unhex( int c ) } static void -ldap_pvt_hex_unescape( char *s ) +ldap_pvt_hex_unescape( gchar *s ) { /* * Remove URL hex escapes from s... done in place. The basic concept for @@ -1014,8 +1014,8 @@ ldap_pvt_hex_unescape( char *s ) *p = '\0'; } -static char ** -ldap_str2charray( const char *str_in, const char *brkstr ) +static gchar ** +ldap_str2charray( const gchar *str_in, const gchar *brkstr ) { char **res; char *str, *s; @@ -1035,7 +1035,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } } - res = (char **) LDAP_MALLOC( (i + 1) * sizeof(char *) ); + res = (gchar **) LDAP_MALLOC( (i + 1) * sizeof(gchar *) ); if( res == NULL ) { LDAP_FREE( str ); @@ -1069,7 +1069,7 @@ ldap_str2charray( const char *str_in, const char *brkstr ) } static int -ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { /* * Pick apart the pieces of an LDAP URL. @@ -1078,9 +1078,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) LDAPURLDesc *ludp; char *p, *q, *r; int i, enclosed; - const char *scheme = NULL; - const char *url_tmp; - char *url; + const gchar *scheme = NULL; + const gchar *url_tmp; + gchar *url; if( url_in == NULL || ludpp == NULL ) { return LDAP_URL_ERR_PARAM; @@ -1393,9 +1393,9 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) } static int -ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp ) +ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { - int rc = ldap_url_parse_ext( url_in, ludpp ); + gint rc = ldap_url_parse_ext( url_in, ludpp ); if( rc != LDAP_URL_SUCCESS ) { return rc; diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 3897d605e3..5040b96570 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -99,7 +99,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam { GladeXML *gui; GtkWidget *widget; - char *gladefile; + gchar *gladefile; gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname)); gtk_dialog_set_has_separator (GTK_DIALOG (e_contact_editor_fullname), @@ -189,7 +189,7 @@ e_contact_editor_fullname_set_property (GObject *object, guint prop_id, } break; case PROP_EDITABLE: { - int i; + gint i; const gchar *widget_names[] = { "comboentry-title", "comboentry-suffix", @@ -283,7 +283,7 @@ fill_in_info(EContactEditorFullname *editor) } } -static char * +static gchar * extract_field (EContactEditorFullname *editor, const gchar *field) { diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 03272d4444..fd00b1e733 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -92,7 +92,7 @@ static GtkWindow* e_contact_editor_get_window (EABEditor *editor); static void save_contact (EContactEditor *ce, gboolean should_close); static void entry_activated (EContactEditor *editor); -static void set_entry_text(EContactEditor *editor, GtkEntry *entry, const char *string); +static void set_entry_text(EContactEditor *editor, GtkEntry *entry, const gchar *string); static void sensitize_ok (EContactEditor *ce); static EABEditorClass *parent_class = NULL; @@ -390,7 +390,7 @@ is_field_supported (EContactEditor *editor, EContactField field_id) /* This function tells you whether name_to_style will make sense. */ static gboolean -style_makes_sense (const EContactName *name, const gchar *company, int style) +style_makes_sense (const EContactName *name, const gchar *company, gint style) { switch (style) { case 0: /* Fall Through */ @@ -419,13 +419,13 @@ style_makes_sense (const EContactName *name, const gchar *company, int style) } } -static char * -name_to_style (const EContactName *name, const gchar *company, int style) +static gchar * +name_to_style (const EContactName *name, const gchar *company, gint style) { - char *string; - char *strings[4], **stringptr; - char *midstring[4], **midstrptr; - char *substring; + gchar *string; + gchar *strings[4], **stringptr; + gchar *midstring[4], **midstrptr; + gchar *substring; switch (style) { case 0: stringptr = strings; @@ -500,11 +500,11 @@ file_as_get_style (EContactEditor *editor) { GtkEntry *file_as = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (glade_xml_get_widget(editor->gui, "combo-file-as")))); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); - char *filestring; - char *trystring; + gchar *filestring; + gchar *trystring; EContactName *name = editor->name; const gchar *company; - int i; + gint i; if (!(file_as && GTK_IS_ENTRY(file_as))) return -1; @@ -526,10 +526,10 @@ file_as_get_style (EContactEditor *editor) } static void -file_as_set_style (EContactEditor *editor, int style) +file_as_set_style (EContactEditor *editor, gint style) { - char *string; - int i; + gchar *string; + gint i; GList *strings = NULL; GtkComboBox *combo_file_as = GTK_COMBO_BOX (glade_xml_get_widget (editor->gui, "combo-file-as")); GtkEntry *company_w = GTK_ENTRY (glade_xml_get_widget (editor->gui, "entry-company")); @@ -547,7 +547,7 @@ file_as_set_style (EContactEditor *editor, int style) for (i = 0; i < 6; i++) { if (style_makes_sense (editor->name, company, i)) { - char *u; + gchar *u; u = name_to_style (editor->name, company, i); if (!STRING_IS_EMPTY (u)) strings = g_list_append (strings, u); @@ -579,8 +579,8 @@ file_as_set_style (EContactEditor *editor, int style) static void name_entry_changed (GtkWidget *widget, EContactEditor *editor) { - int style = 0; - const char *string; + gint style = 0; + const gchar *string; style = file_as_get_style (editor); e_contact_name_free (editor->name); @@ -596,7 +596,7 @@ name_entry_changed (GtkWidget *widget, EContactEditor *editor) static void file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) { - char *string = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); + gchar *string = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); if (string && *string) { gchar *title; @@ -615,7 +615,7 @@ file_as_combo_changed (GtkWidget *widget, EContactEditor *editor) static void company_entry_changed (GtkWidget *widget, EContactEditor *editor) { - int style = 0; + gint style = 0; style = file_as_get_style (editor); file_as_set_style (editor, style); @@ -651,9 +651,9 @@ sensitize_ok (EContactEditor *ce) GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN (glade_xml_get_widget (ce->gui, "combo-file-as"))); GtkWidget *company_name = glade_xml_get_widget (ce->gui, "entry-company"); - const char *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); - const char *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); - const char *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); + const gchar *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); + const gchar *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); + const gchar *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); allow_save = ce->target_editable && ce->changed ? TRUE : FALSE; @@ -692,7 +692,7 @@ image_chooser_changed (GtkWidget *widget, EContactEditor *editor) static void set_entry_text (EContactEditor *editor, GtkEntry *entry, const gchar *string) { - const char *oldstring = gtk_entry_get_text (entry); + const gchar *oldstring = gtk_entry_get_text (entry); if (!string) string = ""; @@ -2248,7 +2248,7 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) EContactPhoto *photo = e_contact_get (contact, field_id); if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { e_image_chooser_set_image_data (E_IMAGE_CHOOSER (widget), - (char *)photo->data.inlined.data, + (gchar *)photo->data.inlined.data, photo->data.inlined.length); editor->image_set = TRUE; } @@ -2286,7 +2286,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) e_contact_set (contact, field_id, (gchar *) text); } else if (GTK_IS_COMBO_BOX_ENTRY (widget)) { - char *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); + gchar *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget)); e_contact_set (contact, field_id, text); @@ -2311,9 +2311,9 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) else if (E_IS_DATE_EDIT (widget)) { EContactDate date; if (e_date_edit_get_date (E_DATE_EDIT (widget), - (int *)&date.year, - (int *)&date.month, - (int *)&date.day)) + (gint *)&date.year, + (gint *)&date.month, + (gint *)&date.day)) e_contact_set (contact, field_id, &date); else e_contact_set (contact, field_id, NULL); @@ -2331,14 +2331,14 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) GdkPixbuf *pixbuf, *new; GdkPixbufLoader *loader = gdk_pixbuf_loader_new(); - photo.data.inlined.data = (unsigned char *)img_buff; + photo.data.inlined.data = (guchar *)img_buff; img_buff = NULL; gdk_pixbuf_loader_write (loader, photo.data.inlined.data, photo.data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); if (pixbuf) { - int width, height, prompt_response; + gint width, height, prompt_response; g_object_ref (pixbuf); @@ -2365,7 +2365,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gdk_pixbuf_save_to_buffer (new, &img_buff, &photo.data.inlined.length, format_name, NULL, NULL); - photo.data.inlined.data = (unsigned char *)img_buff; + photo.data.inlined.data = (guchar *)img_buff; img_buff = NULL; g_free (format_name); g_object_unref (new); @@ -2396,7 +2396,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) else if (GTK_IS_TOGGLE_BUTTON (widget)) { gboolean val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); - e_contact_set (contact, field_id, val?(void *)1:NULL); + e_contact_set (contact, field_id, val?(gpointer)1:NULL); } else { g_warning (G_STRLOC ": Unhandled widget class in mappings!"); @@ -2650,11 +2650,11 @@ source_changed (ESourceComboBox *source_combo_box, EContactEditor *editor) } static void -full_name_response (GtkDialog *dialog, int response, EContactEditor *editor) +full_name_response (GtkDialog *dialog, gint response, EContactEditor *editor) { EContactName *name; GtkWidget *fname_widget; - int style = 0; + gint style = 0; gboolean editable = FALSE; g_object_get (dialog, @@ -2670,8 +2670,8 @@ full_name_response (GtkDialog *dialog, int response, EContactEditor *editor) fname_widget = glade_xml_get_widget(editor->gui, "entry-fullname"); if (fname_widget && GTK_IS_ENTRY (fname_widget)) { - char *full_name = e_contact_name_to_string(name); - const char *old_full_name = gtk_entry_get_text (GTK_ENTRY(fname_widget)); + gchar *full_name = e_contact_name_to_string(name); + const gchar *old_full_name = gtk_entry_get_text (GTK_ENTRY(fname_widget)); if (strcmp (full_name, old_full_name)) gtk_entry_set_text (GTK_ENTRY (fname_widget), full_name); @@ -2728,9 +2728,9 @@ full_name_clicked (GtkWidget *button, EContactEditor *editor) static void -categories_response (GtkDialog *dialog, int response, EContactEditor *editor) +categories_response (GtkDialog *dialog, gint response, EContactEditor *editor) { - const char *categories; + const gchar *categories; GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); if (response == GTK_RESPONSE_OK) { @@ -2738,7 +2738,7 @@ categories_response (GtkDialog *dialog, int response, EContactEditor *editor) if (entry && GTK_IS_ENTRY(entry)) gtk_entry_set_text (GTK_ENTRY (entry), categories); else - e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (char *)categories); + e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (gchar *)categories); } gtk_widget_destroy(GTK_WIDGET(dialog)); editor->categories_dialog = NULL; @@ -2757,7 +2757,7 @@ categories_editor_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer static void categories_clicked (GtkWidget *button, EContactEditor *editor) { - char *categories = NULL; + gchar *categories = NULL; GtkDialog *dialog; GtkWidget *entry = glade_xml_get_widget(editor->gui, "entry-categories"); @@ -2854,7 +2854,7 @@ static void update_preview_cb (GtkFileChooser *file_chooser, gpointer data) { GtkWidget *preview; - char *filename = NULL; + gchar *filename = NULL; GdkPixbuf *pixbuf; gtk_file_chooser_set_preview_widget_active (file_chooser, TRUE); @@ -2956,7 +2956,7 @@ contact_moved_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs) } static void -contact_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruct *ecs) +contact_added_cb (EBook *book, EBookStatus status, const gchar *id, EditorCloseStruct *ecs) { EContactEditor *ce = ecs->ce; gboolean should_close = ecs->should_close; @@ -2972,7 +2972,7 @@ contact_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseSt gtk_widget_set_sensitive (ce->app, TRUE); ce->in_async_call = FALSE; - e_contact_set (ce->contact, E_CONTACT_UID, (char *) id); + e_contact_set (ce->contact, E_CONTACT_UID, (gchar *) id); eab_editor_contact_added (EAB_EDITOR (ce), status, ce->contact); @@ -3049,8 +3049,8 @@ real_save_contact (EContactEditor *ce, gboolean should_close) static void save_contact (EContactEditor *ce, gboolean should_close) { - char *uid; - const char *name_entry_string, *file_as_entry_string, *company_name_string; + gchar *uid; + const gchar *name_entry_string, *file_as_entry_string, *company_name_string; GtkWidget *entry_fullname, *entry_file_as, *company_name; if (!ce->target_book) @@ -3139,8 +3139,8 @@ static const EContactField non_string_fields [] = { static gboolean is_non_string_field (EContactField id) { - int count = sizeof (non_string_fields) / sizeof (EContactField); - int i; + gint count = sizeof (non_string_fields) / sizeof (EContactField); + gint i; for (i = 0; i < count; i++) if (id == non_string_fields[i]) return TRUE; @@ -3178,7 +3178,7 @@ e_contact_editor_is_valid (EABEditor *editor) for (e_iterator_last (iter); e_iterator_is_valid (iter); e_iterator_prev (iter)) { - const char *field_name = e_iterator_get (iter); + const gchar *field_name = e_iterator_get (iter); EContactField field_id = e_contact_field_id (field_name); if (is_non_string_field (field_id)) { @@ -3191,7 +3191,7 @@ e_contact_editor_is_valid (EABEditor *editor) } } else { - const char *text = e_contact_get_const (ce->contact, field_id); + const gchar *text = e_contact_get_const (ce->contact, field_id); if (STRING_IS_EMPTY (text)) { g_string_append_printf (errmsg, _("%s'%s' is empty"), @@ -3383,7 +3383,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) EShell *shell; GtkWidget *widget, *label; GtkEntryCompletion *completion; - char *gladefile; + gchar *gladefile; e_contact_editor->name = e_contact_name_new(); @@ -3551,7 +3551,7 @@ required_fields_cb (EBook *book, EBookStatus status, static void -contact_editor_destroy_notify (void *data, +contact_editor_destroy_notify (gpointer data, GObject *where_the_object_was) { eab_editor_remove (EAB_EDITOR (data)); @@ -3589,7 +3589,7 @@ e_contact_editor_new (EBook *book, static void writable_changed (EBook *book, gboolean writable, EContactEditor *ce) { - int new_target_editable; + gint new_target_editable; gboolean changed = FALSE; new_target_editable = e_book_is_writable (ce->target_book); diff --git a/addressbook/gui/contact-editor/e-contact-editor.h b/addressbook/gui/contact-editor/e-contact-editor.h index 041fcde479..1000cdc544 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.h +++ b/addressbook/gui/contact-editor/e-contact-editor.h @@ -96,7 +96,7 @@ struct _EContactEditor EBook *load_book; /* signal ids for "writable_status" */ - int target_editable_id; + gint target_editable_id; GtkWidget *fullname_dialog; GtkWidget *categories_dialog; diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 8aa2825fc8..9bd97f2b84 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -586,7 +586,7 @@ e_contact_quick_add_vcard (const gchar *vcard, EContactQuickAddCallback cb, gpoi if (contact) { GList *emails; - char *name; + gchar *name; EContactName *contact_name; g_object_unref (qa->contact); diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index f5d133283f..751bab4203 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -42,12 +42,12 @@ "END:VCARD" \ "" -static char * -read_file (char *name) +static gchar * +read_file (gchar *name) { - int len; - char buff[65536]; - char line[1024]; + gint len; + gchar buff[65536]; + gchar line[1024]; FILE *f; f = fopen (name, "r"); @@ -69,7 +69,7 @@ read_file (char *name) static void editor_closed_cb (EContactEditor *ce, gpointer data) { - static int count = 2; + static gint count = 2; count--; g_object_unref (ce); @@ -78,9 +78,9 @@ editor_closed_cb (EContactEditor *ce, gpointer data) exit (0); } -int main( int argc, char *argv[] ) +gint main( gint argc, gchar *argv[] ) { - char *cardstr; + gchar *cardstr; EContactEditor *ce; gtk_init (&argc, &argv); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 002cb08bbf..cc64cd5af3 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -1447,7 +1447,7 @@ contact_list_editor_add_destination (EVCardAttribute *attr, gint email_num = -1; GList *list, *iter; GList *values; - char *value; + gchar *value; destination = e_destination_new (); diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c index 6a3132f5a5..bdf385f0ba 100644 --- a/addressbook/gui/merging/eab-contact-compare.c +++ b/addressbook/gui/merging/eab-contact-compare.c @@ -476,11 +476,11 @@ eab_contact_compare_email (EContact *contact1, EContact *contact2) we find an exact match, there is no reason to keep checking. */ while (i1 && match != EAB_CONTACT_MATCH_EXACT) { - char *addr1 = (char *) i1->data; + gchar *addr1 = (gchar *) i1->data; i2 = contact2_email; while (i2 && match != EAB_CONTACT_MATCH_EXACT) { - char *addr2 = (char *) i2->data; + gchar *addr2 = (gchar *) i2->data; match = combine_comparisons (match, compare_email_addresses (addr1, addr2)); @@ -640,7 +640,7 @@ use_common_book_cb (EBook *book, gpointer closure) gint p=0; gchar *contact_file_as, *qj; EBookQuery *query = NULL; - int i; + gint i; if (book == NULL) { info->cb (info->contact, NULL, EAB_CONTACT_MATCH_NONE, info->closure); @@ -699,7 +699,7 @@ use_common_book_cb (EBook *book, gpointer closure) for(i = 0; query_parts[i] != NULL; i++) g_free(query_parts[i]); if (p > 1) { - char *s; + gchar *s; s = g_strdup_printf ("(or %s)", qj); query = e_book_query_from_string (s); g_free (s); diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 5a6ac2cdac..0bcee0be38 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -62,7 +62,7 @@ static void match_query_callback (EContact *contact, EContact *match, EABContact #define SIMULTANEOUS_MERGING_REQUESTS 20 static GList *merging_queue = NULL; -static int running_merge_requests = 0; +static gint running_merge_requests = 0; static void @@ -109,7 +109,7 @@ free_lookup (EContactMergingLookup *lookup) } static void -final_id_cb (EBook *book, EBookStatus status, const char *id, gpointer closure) +final_id_cb (EBook *book, EBookStatus status, const gchar *id, gpointer closure) { EContactMergingLookup *lookup = closure; @@ -156,7 +156,7 @@ cancelit (EContactMergingLookup *lookup) static void dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) { - int h, w; + gint h, w; /* Spacing around the table */ w = table->allocation.width + 30; @@ -173,7 +173,7 @@ dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) static void dropdown_changed (GtkWidget *dropdown, dropdown_data *data) { - char *str; + gchar *str; str = gtk_combo_box_get_active_text (GTK_COMBO_BOX (dropdown)); if (g_ascii_strcasecmp(str, "")) @@ -190,11 +190,11 @@ mergeit (EContactMergingLookup *lookup) GtkDialog *dialog; GtkTable *table; EContactField field; - char *str = NULL, *string = NULL, *string1 = NULL; - int num_of_email; + gchar *str = NULL, *string = NULL, *string1 = NULL; + gint num_of_email; GList *email_attr_list; - int row = -1; - int value = 0, result; + gint row = -1; + gint value = 0, result; dialog = (GtkDialog *)(gtk_dialog_new_with_buttons (_("Merge Contact"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL)); gtk_container_set_border_width (GTK_CONTAINER(dialog), 5); @@ -220,8 +220,8 @@ mergeit (EContactMergingLookup *lookup) /*we match all the string fields of the already existing contact and the new contact.*/ for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) ; field++) { dropdown_data *data = NULL; - string = (char *)e_contact_get_const (lookup->contact, field); - string1 = (char *)e_contact_get_const (lookup->match, field); + string = (gchar *)e_contact_get_const (lookup->contact, field); + string1 = (gchar *)e_contact_get_const (lookup->match, field); /*the field must exist in the new as well as the duplicate contact*/ if (string && *string) { @@ -230,7 +230,7 @@ mergeit (EContactMergingLookup *lookup) if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email < 4)) { row++; - str = (char *)e_contact_get_const (lookup->contact, field); + str = (gchar *)e_contact_get_const (lookup->contact, field); switch(num_of_email) { case 0: @@ -366,8 +366,8 @@ check_if_same (EContact *contact, EContact *match) { EContactField field; GList *email_attr_list; - int num_of_email; - char *str = NULL, *string = NULL, *string1 = NULL; + gint num_of_email; + gchar *str = NULL, *string = NULL, *string1 = NULL; for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1) ; field++) { email_attr_list = e_contact_get_attributes (match, E_CONTACT_EMAIL); @@ -375,7 +375,7 @@ check_if_same (EContact *contact, EContact *match) if ((field == E_CONTACT_EMAIL_1 || field == E_CONTACT_EMAIL_2 || field == E_CONTACT_EMAIL_3 || field == E_CONTACT_EMAIL_4) && (num_of_email<4)) { - str = (char *)e_contact_get_const (contact, field); + str = (gchar *)e_contact_get_const (contact, field); switch(num_of_email) { case 0: @@ -395,8 +395,8 @@ check_if_same (EContact *contact, EContact *match) } } else { - string = (char *)e_contact_get_const (contact, field); - string1 = (char *)e_contact_get_const (match, field); + string = (gchar *)e_contact_get_const (contact, field); + string1 = (gchar *)e_contact_get_const (match, field); if ((string && *string) && (string1 && *string1) && (g_ascii_strcasecmp(string1,string))) return FALSE; /*if the field entry exist in either of the contacts,we'll have to give the choice and thus merge button should be sensitive*/ @@ -409,9 +409,9 @@ check_if_same (EContact *contact, EContact *match) } static void -response (GtkWidget *dialog, int response, EContactMergingLookup *lookup) +response (GtkWidget *dialog, gint response, EContactMergingLookup *lookup) { - static int merge_response; + static gint merge_response; switch (response) { case 0: @@ -437,8 +437,8 @@ static void match_query_callback (EContact *contact, EContact *match, EABContactMatchType type, gpointer closure) { EContactMergingLookup *lookup = closure; - char *gladefile; - int flag; + gchar *gladefile; + gint flag; if ((gint) type <= (gint) EAB_CONTACT_MATCH_VAGUE) { doit (lookup); diff --git a/addressbook/gui/widgets/a11y/ea-addressbook-view.c b/addressbook/gui/widgets/a11y/ea-addressbook-view.c index 4150e10ff4..b2d7ebb171 100644 --- a/addressbook/gui/widgets/a11y/ea-addressbook-view.c +++ b/addressbook/gui/widgets/a11y/ea-addressbook-view.c @@ -25,8 +25,8 @@ #include <glib/gi18n.h> #include "ea-addressbook-view.h" -static G_CONST_RETURN gchar* ea_ab_view_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar* ea_ab_view_get_description (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_ab_view_get_name (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_ab_view_get_description (AtkObject *accessible); static void ea_ab_view_class_init (EAddressbookViewClass *class); @@ -85,7 +85,7 @@ ea_ab_view_class_init (EAddressbookViewClass *class) atk_object_class->get_description = ea_ab_view_get_description; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_ab_view_get_name (AtkObject *accessible) { g_return_val_if_fail (EA_IS_AB_VIEW(accessible), NULL); @@ -95,7 +95,7 @@ ea_ab_view_get_name (AtkObject *accessible) return _("evolution address book"); } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_ab_view_get_description (AtkObject *accessible) { if (accessible->description) diff --git a/addressbook/gui/widgets/a11y/ea-minicard-view.c b/addressbook/gui/widgets/a11y/ea-minicard-view.c index 052db4d1b1..09eef66ad2 100644 --- a/addressbook/gui/widgets/a11y/ea-minicard-view.c +++ b/addressbook/gui/widgets/a11y/ea-minicard-view.c @@ -29,14 +29,14 @@ #include "eab-gui-util.h" #include "e-addressbook-view.h" -static const char * action_name[] = { +static const gchar * action_name[] = { N_("New Contact"), N_("New Contact List") }; -static G_CONST_RETURN gchar* ea_minicard_view_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar* ea_minicard_view_get_description (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_minicard_view_get_name (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_minicard_view_get_description (AtkObject *accessible); static void ea_minicard_view_class_init (EaMinicardViewClass *klass); @@ -58,8 +58,8 @@ static gboolean selection_interface_is_child_selected (AtkSelection *selection, static void atk_action_interface_init (AtkActionIface *iface); static gboolean atk_action_interface_do_action (AtkAction *iface, gint i); static gint atk_action_interface_get_n_action (AtkAction *iface); -static G_CONST_RETURN gchar* atk_action_interface_get_description (AtkAction *iface, gint i); -static G_CONST_RETURN gchar* atk_action_interface_get_name (AtkAction *iface, gint i); +static G_CONST_RETURN gchar * atk_action_interface_get_description (AtkAction *iface, gint i); +static G_CONST_RETURN gchar * atk_action_interface_get_name (AtkAction *iface, gint i); static gpointer parent_class = NULL; @@ -135,7 +135,7 @@ ea_minicard_view_class_init (EaMinicardViewClass *klass) class->ref_child = ea_minicard_view_ref_child; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_minicard_view_get_name (AtkObject *accessible) { EReflow *reflow; @@ -169,7 +169,7 @@ ea_minicard_view_get_name (AtkObject *accessible) return accessible->name; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_minicard_view_get_description (AtkObject *accessible) { g_return_val_if_fail (EA_IS_MINICARD_VIEW(accessible), NULL); @@ -396,13 +396,13 @@ static gint atk_action_interface_get_n_action (AtkAction *iface) return G_N_ELEMENTS (action_name); } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * atk_action_interface_get_description (AtkAction *iface, gint i) { return atk_action_interface_get_name (iface, i); } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * atk_action_interface_get_name (AtkAction *iface, gint i) { if( i >= G_N_ELEMENTS (action_name) || i < 0) diff --git a/addressbook/gui/widgets/a11y/ea-minicard.c b/addressbook/gui/widgets/a11y/ea-minicard.c index d77d591fcc..b1b1ebbe33 100644 --- a/addressbook/gui/widgets/a11y/ea-minicard.c +++ b/addressbook/gui/widgets/a11y/ea-minicard.c @@ -27,12 +27,12 @@ #include "ea-minicard-view.h" #include "e-minicard.h" -static const char * action_name[] = { +static const gchar * action_name[] = { N_("Open") }; -static G_CONST_RETURN gchar* ea_minicard_get_name (AtkObject *accessible); -static G_CONST_RETURN gchar* ea_minicard_get_description (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_minicard_get_name (AtkObject *accessible); +static G_CONST_RETURN gchar * ea_minicard_get_description (AtkObject *accessible); static void ea_minicard_class_init (EaMinicardClass *klass); @@ -44,8 +44,8 @@ static AtkStateSet *ea_minicard_ref_state_set (AtkObject *obj); static void atk_action_interface_init (AtkActionIface *iface); static gboolean atk_action_interface_do_action (AtkAction *iface, gint i); static gint atk_action_interface_get_n_action (AtkAction *iface); -static G_CONST_RETURN gchar* atk_action_interface_get_description (AtkAction *iface, gint i); -static G_CONST_RETURN gchar* atk_action_interface_get_name (AtkAction *iface, gint i); +static G_CONST_RETURN gchar * atk_action_interface_get_description (AtkAction *iface, gint i); +static G_CONST_RETURN gchar * atk_action_interface_get_name (AtkAction *iface, gint i); static gpointer parent_class = NULL; @@ -117,7 +117,7 @@ ea_minicard_class_init (EaMinicardClass *klass) * we access the main content of current minicard, including * header text, label(field, field name) */ -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_minicard_get_name (AtkObject *accessible) { #define BUFFERSIZE 500 @@ -159,7 +159,7 @@ ea_minicard_get_name (AtkObject *accessible) return accessible->name; } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * ea_minicard_get_description (AtkObject *accessible) { if (accessible->description) @@ -256,13 +256,13 @@ static gint atk_action_interface_get_n_action (AtkAction *iface) return G_N_ELEMENTS (action_name); } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * atk_action_interface_get_description (AtkAction *iface, gint i) { return atk_action_interface_get_name (iface, i); } -static G_CONST_RETURN gchar* +static G_CONST_RETURN gchar * atk_action_interface_get_name (AtkAction *iface, gint i) { if( i >= G_N_ELEMENTS (action_name) || i < 0) diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index b016d4f9db..79d11627aa 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -134,7 +134,7 @@ static void update_folder_bar_message (EAddressbookModel *model) { guint count; - char *message; + gchar *message; count = model->priv->contacts->len; @@ -260,7 +260,7 @@ modify_contact(EBookView *book_view, static void status_message (EBookView *book_view, - char* status, + gchar * status, EAddressbookModel *model) { g_signal_emit (model, signals[STATUS_MESSAGE], 0, status); @@ -347,8 +347,8 @@ addressbook_model_idle_cb (EAddressbookModel *model) if (model->priv->book && model->priv->query) { ESource *source; - const char *limit_str; - int limit = -1; + const gchar *limit_str; + gint limit = -1; source = e_book_get_source (model->priv->book); diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index a867042de0..fd1681c5b1 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -35,8 +35,8 @@ struct _EAddressbookReflowAdapterPrivate { gboolean loading; - int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; - int search_started_id, search_result_id; + gint create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; + gint search_started_id, search_result_id; }; #define PARENT_TYPE e_reflow_model_get_type() @@ -101,7 +101,7 @@ unlink_model(EAddressbookReflowAdapter *adapter) static int text_height (PangoLayout *layout, const gchar *text) { - int height; + gint height; pango_layout_set_text (layout, text, -1); @@ -119,7 +119,7 @@ addressbook_dispose(GObject *object) } static void -addressbook_set_width (EReflowModel *erm, int width) +addressbook_set_width (EReflowModel *erm, gint width) { } @@ -135,16 +135,16 @@ addressbook_count (EReflowModel *erm) /* This function returns the height of the minicontact in question */ static int -addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) +addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; EContactField field; - int count = 0; - char *string; + gint count = 0; + gchar *string; EContact *contact = (EContact*)e_addressbook_model_contact_at (priv->model, i); PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (parent)->canvas), ""); - int height; + gint height; string = e_contact_get(contact, E_CONTACT_FILE_AS); height = text_height (layout, string ? string : "") + 10.0; @@ -157,8 +157,8 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) string = e_contact_get(contact, field); if (string && *string) { - int this_height; - int field_text_height; + gint this_height; + gint field_text_height; this_height = text_height (layout, e_contact_pretty_name(field)); @@ -181,7 +181,7 @@ addressbook_height (EReflowModel *erm, int i, GnomeCanvasGroup *parent) } static int -addressbook_compare (EReflowModel *erm, int n1, int n2) +addressbook_compare (EReflowModel *erm, gint n1, gint n2) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -195,8 +195,8 @@ addressbook_compare (EReflowModel *erm, int n1, int n2) contact2 = (EContact*)e_addressbook_model_contact_at (priv->model, n2); if (contact1 && contact2) { - const char *file_as1, *file_as2; - const char *uid1, *uid2; + const gchar *file_as1, *file_as2; + const gchar *uid1, *uid2; file_as1 = e_contact_get_const (contact1, E_CONTACT_FILE_AS); file_as2 = e_contact_get_const (contact2, E_CONTACT_FILE_AS); if (file_as1 && file_as2) @@ -243,7 +243,7 @@ adapter_open_contact (EMinicard *card, } static GnomeCanvasItem * -addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent) +addressbook_incarnate (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -270,7 +270,7 @@ addressbook_incarnate (EReflowModel *erm, int i, GnomeCanvasGroup *parent) } static void -addressbook_reincarnate (EReflowModel *erm, int i, GnomeCanvasItem *item) +addressbook_reincarnate (EReflowModel *erm, gint i, GnomeCanvasItem *item) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); EAddressbookReflowAdapterPrivate *priv = adapter->priv; @@ -296,7 +296,7 @@ remove_contacts (EAddressbookModel *model, EAddressbookReflowAdapter *adapter) { GArray *indices = (GArray *) data; - int count = indices->len; + gint count = indices->len; if (count == 1) e_reflow_model_item_removed (E_REFLOW_MODEL (adapter), g_array_index (indices, gint, 0)); @@ -557,7 +557,7 @@ e_addressbook_reflow_adapter_new (EAddressbookModel *model) EContact * e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - int index) + gint index) { EAddressbookReflowAdapterPrivate *priv = adapter->priv; diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h index b5feda6c4b..fc08dcd43c 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.h +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.h @@ -62,5 +62,5 @@ EReflowModel *e_addressbook_reflow_adapter_new (EAddressbookModel /* Returns object with ref count of 1. */ EContact *e_addressbook_reflow_adapter_get_contact (EAddressbookReflowAdapter *adapter, - int index); + gint index); #endif /* _E_ADDRESSBOOK_REFLOW_ADAPTER_H_ */ diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index c970b6f32d..cb63c67809 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -33,7 +33,7 @@ struct _EAddressbookTableAdapterPrivate { EAddressbookModel *model; - int create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; + gint create_contact_id, remove_contact_id, modify_contact_id, model_changed_id; GHashTable *emails; }; @@ -104,12 +104,12 @@ addressbook_row_count (ETableModel *etc) } /* This function returns the value at a particular point in our ETableModel. */ -static void * -addressbook_value_at (ETableModel *etc, int col, int row) +static gpointer +addressbook_value_at (ETableModel *etc, gint col, gint row) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; - const char *value; + const gchar *value; if ( col >= COLS || row >= e_addressbook_model_contact_count (priv->model) ) return NULL; @@ -117,13 +117,13 @@ addressbook_value_at (ETableModel *etc, int col, int row) value = e_contact_get_const((EContact*)e_addressbook_model_contact_at (priv->model, row), col); if (value && *value && (col == E_CONTACT_EMAIL_1 || col == E_CONTACT_EMAIL_2 || col == E_CONTACT_EMAIL_3)) { - char *val = g_hash_table_lookup (priv->emails, value); + gchar *val = g_hash_table_lookup (priv->emails, value); if (val) { /* we have this already cached, so use value from the cache */ value = val; } else { - char *name = NULL, *mail = NULL; + gchar *name = NULL, *mail = NULL; if (eab_parse_qp_email (value, &name, &mail)) val = g_strdup_printf ("%s <%s>", name, mail); @@ -138,7 +138,7 @@ addressbook_value_at (ETableModel *etc, int col, int row) } } - return (void *)(value ? value : ""); + return (gpointer)(value ? value : ""); } /* This function sets the value at a particular point in our ETableModel. */ @@ -151,7 +151,7 @@ contact_modified_cb (EBook* book, EBookStatus status, } static void -addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) +addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); EAddressbookTableAdapterPrivate *priv = adapter->priv; @@ -169,14 +169,14 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) e_table_model_pre_change(etc); if (col == E_CONTACT_EMAIL_1 || col == E_CONTACT_EMAIL_2 || col == E_CONTACT_EMAIL_3) { - const char *old_value = e_contact_get_const (contact, col); + const gchar *old_value = e_contact_get_const (contact, col); /* remove old value from cache and use new one */ if (old_value && *old_value) g_hash_table_remove (priv->emails, old_value); } - e_contact_set(contact, col, (void *) val); + e_contact_set(contact, col, (gpointer) val); eab_merging_book_commit_contact (e_addressbook_model_get_book (priv->model), contact, contact_modified_cb, etc); @@ -189,7 +189,7 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) /* This function returns whether a particular cell is editable. */ static gboolean -addressbook_is_cell_editable (ETableModel *etc, int col, int row) +addressbook_is_cell_editable (ETableModel *etc, gint col, gint row) { #if 0 EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); @@ -220,13 +220,13 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etm); EAddressbookTableAdapterPrivate *priv = adapter->priv; EContact *contact; - int col; + gint col; contact = e_contact_new (); for (col = 1; col < E_CONTACT_LAST_SIMPLE_STRING; col++) { - const void *val = e_table_model_value_at (source, col, row); - e_contact_set (contact, col, (void *) val); + gconstpointer val = e_table_model_value_at (source, col, row); + e_contact_set (contact, col, (gpointer) val); } eab_merging_book_add_contact (e_addressbook_model_get_book (priv->model), contact, NULL, NULL); @@ -235,33 +235,33 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row) } /* This function duplicates the value passed to it. */ -static void * -addressbook_duplicate_value (ETableModel *etc, int col, const void *value) +static gpointer +addressbook_duplicate_value (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } /* This function frees the value passed to it. */ static void -addressbook_free_value (ETableModel *etc, int col, void *value) +addressbook_free_value (ETableModel *etc, gint col, gpointer value) { g_free(value); } -static void * -addressbook_initialize_value (ETableModel *etc, int col) +static gpointer +addressbook_initialize_value (ETableModel *etc, gint col) { return g_strdup(""); } static gboolean -addressbook_value_is_empty (ETableModel *etc, int col, const void *value) +addressbook_value_is_empty (ETableModel *etc, gint col, gconstpointer value) { - return !(value && *(char *)value); + return !(value && *(gchar *)value); } -static char * -addressbook_value_to_string (ETableModel *etc, int col, const void *value) +static gchar * +addressbook_value_to_string (ETableModel *etc, gint col, gconstpointer value) { return g_strdup(value); } @@ -318,7 +318,7 @@ remove_contacts (EAddressbookModel *model, EAddressbookTableAdapter *adapter) { GArray *indices = (GArray *) data; - int count = indices->len; + gint count = indices->len; /* clear whole cache */ g_hash_table_remove_all (adapter->priv->emails); diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index e889d9b0c2..fe46882b2e 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1178,7 +1178,7 @@ e_addressbook_view_delete_selection(EAddressbookView *view, gboolean is_delete) ESelectionModel *selection_model = NULL; GalViewInstance *view_instance; GalView *gal_view; - char *name = NULL; + gchar *name = NULL; gint row = 0, select; model = e_addressbook_view_get_model (view); @@ -1226,7 +1226,7 @@ e_addressbook_view_delete_selection(EAddressbookView *view, gboolean is_delete) for (l=list;l;l=g_list_next(l)) { contact = l->data; - ids = g_list_prepend (ids, (char*)e_contact_get_const (contact, E_CONTACT_UID)); + ids = g_list_prepend (ids, (gchar *)e_contact_get_const (contact, E_CONTACT_UID)); } /* Remove the cards all at once. */ diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c index a6090291bd..52110bb169 100644 --- a/addressbook/gui/widgets/e-minicard-label.c +++ b/addressbook/gui/widgets/e-minicard-label.c @@ -40,7 +40,7 @@ static void e_minicard_label_get_property (GObject *object, guint prop_id, GVal static gboolean e_minicard_label_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_label_realize (GnomeCanvasItem *item); static void e_minicard_label_unrealize (GnomeCanvasItem *item); -static void e_minicard_label_reflow(GnomeCanvasItem *item, int flags); +static void e_minicard_label_reflow(GnomeCanvasItem *item, gint flags); static void e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style); static void e_minicard_label_resize_children( EMinicardLabel *e_minicard_label ); @@ -455,7 +455,7 @@ e_minicard_label_style_set (EMinicardLabel *label, GtkStyle *previous_style) } static void -e_minicard_label_reflow(GnomeCanvasItem *item, int flags) +e_minicard_label_reflow(GnomeCanvasItem *item, gint flags) { EMinicardLabel *e_minicard_label = E_MINICARD_LABEL(item); diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index ac1f35caa7..df4a4c894b 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -323,7 +323,7 @@ selection_change (ESelectionModel *esm, EMinicardViewWidget *widget) } static void -selection_row_change (ESelectionModel *esm, int row, EMinicardViewWidget *widget) +selection_row_change (ESelectionModel *esm, gint row, EMinicardViewWidget *widget) { selection_change (esm, widget); } @@ -485,7 +485,7 @@ e_minicard_view_widget_real_focus_in_event(GtkWidget *widget, GdkEventFocus *eve if (!canvas->focused_item) { EReflow *reflow = E_REFLOW (view->emv); if (reflow->count) { - int unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0); + gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), 0); if (unsorted != -1) canvas->focused_item = reflow->items [unsorted]; diff --git a/addressbook/gui/widgets/e-minicard-view-widget.h b/addressbook/gui/widgets/e-minicard-view-widget.h index 82962218fa..8af99aa20a 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.h +++ b/addressbook/gui/widgets/e-minicard-view-widget.h @@ -49,7 +49,7 @@ struct _EMinicardViewWidget EAddressbookReflowAdapter *adapter; EBook *book; - char *query; + gchar *query; guint editable : 1; double column_width; diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index e60d32cf10..c62a33463b 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -90,20 +90,20 @@ e_minicard_view_drag_data_get(GtkWidget *widget, switch (info) { case DND_TARGET_TYPE_VCARD_LIST: { - char *value; + gchar *value; value = eab_contact_list_to_string (view->drag_list); gtk_selection_data_set (selection_data, selection_data->target, 8, - (unsigned char *)value, strlen (value)); + (guchar *)value, strlen (value)); g_free (value); break; } case DND_TARGET_TYPE_SOURCE_VCARD_LIST: { EBook *book; - char *value; + gchar *value; g_object_get (view->adapter, "book", &book, NULL); value = eab_book_and_contact_list_to_string (book, view->drag_list); @@ -111,7 +111,7 @@ e_minicard_view_drag_data_get(GtkWidget *widget, gtk_selection_data_set (selection_data, selection_data->target, 8, - (unsigned char *)value, strlen (value)); + (guchar *)value, strlen (value)); g_free (value); break; } @@ -158,7 +158,7 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, static void set_empty_message (EMinicardView *view) { - char *empty_message; + gchar *empty_message; gboolean editable = FALSE, perform_initial_query = FALSE, searching = FALSE; EBook *book; @@ -415,7 +415,7 @@ static gint e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEvent *event) { EMinicardView *view; - int return_val = FALSE; + gint return_val = FALSE; view = E_MINICARD_VIEW (reflow); if (parent_class->selection_event) { @@ -425,7 +425,7 @@ e_minicard_view_selection_event (EReflow *reflow, GnomeCanvasItem *item, GdkEven switch (event->type) { case GDK_FOCUS_CHANGE: if (event->focus_change.in) { - int i; + gint i; for (i = 0; i < reflow->count; i++) { if (reflow->items[i] == item) { e_selection_model_maybe_do_something(reflow->selection, i, 0, 0); @@ -454,7 +454,7 @@ typedef struct { } ViewCbClosure; static void -do_remove (int i, gpointer user_data) +do_remove (gint i, gpointer user_data) { EBook *book; EContact *contact; @@ -476,7 +476,7 @@ do_remove (int i, gpointer user_data) #if 0 static int -compare_to_utf_str (EMinicard *card, const char *utf_str) +compare_to_utf_str (EMinicard *card, const gchar *utf_str) { g_return_val_if_fail(card != NULL, 0); g_return_val_if_fail(E_IS_MINICARD(card), 0); @@ -486,7 +486,7 @@ compare_to_utf_str (EMinicard *card, const char *utf_str) } if (card->card) { - char *file_as; + gchar *file_as; g_object_get(card->card, "file_as", &file_as, NULL); @@ -635,7 +635,7 @@ e_minicard_view_jump_to_letter (EMinicardView *view, gunichar letter) { #if 0 - char uft_str[6 + 1]; + gchar uft_str[6 + 1]; utf_str [g_unichar_to_utf8 (letter, utf_str)] = '\0'; e_reflow_sorted_jump (E_REFLOW_SORTED (view), @@ -650,7 +650,7 @@ typedef struct { } ModelAndList; static void -add_to_list (int index, gpointer closure) +add_to_list (gint index, gpointer closure) { ModelAndList *mal = closure; mal->list = g_list_prepend (mal->list, e_addressbook_reflow_adapter_get_contact (mal->adapter, index)); diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 3f89b8fdc6..fe907d583d 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -49,7 +49,7 @@ static void e_minicard_finalize (GObject *object); static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event); static void e_minicard_realize (GnomeCanvasItem *item); static void e_minicard_unrealize (GnomeCanvasItem *item); -static void e_minicard_reflow ( GnomeCanvasItem *item, int flags ); +static void e_minicard_reflow ( GnomeCanvasItem *item, gint flags ); static void e_minicard_style_set (EMinicard *minicard, GtkStyle *previous_style); static void e_minicard_resize_children( EMinicard *e_minicard ); @@ -570,7 +570,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) break; case GDK_BUTTON_PRESS: { if (1 <= event->button.button && event->button.button <= 2) { - int ret_val = e_minicard_selected(e_minicard, event); + gint ret_val = e_minicard_selected(e_minicard, event); GdkEventMask mask = ((1 << (4 + event->button.button)) | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | @@ -589,7 +589,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) e_minicard->drag_button_down = TRUE; return ret_val; } else if (event->button.button == 3) { - int ret_val = e_minicard_selected(e_minicard, event); + gint ret_val = e_minicard_selected(e_minicard, event); if (ret_val != 0) return ret_val; } @@ -646,9 +646,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) return FALSE; } else { - int row_count = e_selection_model_row_count (reflow->selection); - int model_index = e_selection_model_cursor_row (reflow->selection); - int view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); + gint row_count = e_selection_model_row_count (reflow->selection); + gint model_index = e_selection_model_cursor_row (reflow->selection); + gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == 0) view_index = row_count-1; @@ -672,9 +672,9 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) return FALSE; } else { - int row_count = e_selection_model_row_count(reflow->selection); - int model_index = e_selection_model_cursor_row (reflow->selection); - int view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); + gint row_count = e_selection_model_row_count(reflow->selection); + gint model_index = e_selection_model_cursor_row (reflow->selection); + gint view_index = e_sorter_model_to_sorted (reflow->selection->sorter, model_index); if (view_index == row_count-1) view_index = 0; @@ -740,8 +740,8 @@ add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) GnomeCanvasItem *new_item; GnomeCanvasGroup *group; EMinicardField *minicard_field; - char *name; - char *string; + gchar *name; + gchar *string; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); group = GNOME_CANVAS_GROUP( e_minicard ); @@ -789,7 +789,7 @@ add_field (EMinicard *e_minicard, EContactField field, gdouble left_width) } -static const char * +static const gchar * get_email_location (EVCardAttribute *attr) { gint i; @@ -803,28 +803,28 @@ get_email_location (EVCardAttribute *attr) } static void -add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, int limit, gboolean is_list) +add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, gint limit, gboolean is_list) { GnomeCanvasItem *new_item; GnomeCanvasGroup *group; EMinicardField *minicard_field; - char *name; + gchar *name; GList *l, *le; - int count =0; + gint count =0; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL); group = GNOME_CANVAS_GROUP( e_minicard ); for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) { const gchar *tmp; - char *email = NULL; - char *string = NULL; - char *parsed_name = NULL; + gchar *email = NULL; + gchar *string = NULL; + gchar *parsed_name = NULL; gboolean parser_check; /* do not use name for fields in the contact list */ if (is_list) { - name = (char *)""; + name = (gchar *)""; } else { tmp = get_email_location ((EVCardAttribute *) l->data); name = g_strdup_printf ("%s:", tmp); @@ -880,7 +880,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) { gchar *name; EContactField field; - int width = -1; + gint width = -1; PangoLayout *layout; if (is_list) @@ -888,7 +888,7 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) layout = gtk_widget_create_pango_layout (GTK_WIDGET (GNOME_CANVAS_ITEM (e_minicard)->canvas), ""); for(field = E_CONTACT_FULL_NAME; field != E_CONTACT_LAST_SIMPLE_STRING; field++) { - int this_width; + gint this_width; if (field == E_CONTACT_FAMILY_NAME || field == E_CONTACT_GIVEN_NAME) continue; @@ -907,14 +907,14 @@ get_left_width (EMinicard *e_minicard, gboolean is_list) static void remodel( EMinicard *e_minicard ) { - int count = 0; + gint count = 0; if ( !(GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED) ) return; if (e_minicard->contact) { EContactField field; GList *list; - char *file_as; - int left_width = -1; + gchar *file_as; + gint left_width = -1; gboolean is_list = FALSE; gboolean email_rendered = FALSE; @@ -957,7 +957,7 @@ remodel( EMinicard *e_minicard ) minicard_field = list->data; if (minicard_field && minicard_field->field == field) { GList *this_list = list; - char *string; + gchar *string; string = e_contact_get(e_minicard->contact, field); if (string && *string) { @@ -972,14 +972,14 @@ remodel( EMinicard *e_minicard ) list = g_list_delete_link(list, this_list); g_free(string); } else { - char *string; + gchar *string; if (left_width == -1) { left_width = get_left_width (e_minicard, is_list); } if (is_email) { GList *email; - int limit; + gint limit; limit = 5 - count; email = e_contact_get_attributes (e_minicard->contact, E_CONTACT_EMAIL); @@ -1007,7 +1007,7 @@ remodel( EMinicard *e_minicard ) } static void -e_minicard_reflow(GnomeCanvasItem *item, int flags) +e_minicard_reflow(GnomeCanvasItem *item, gint flags) { EMinicard *e_minicard = E_MINICARD(item); if (GTK_OBJECT_FLAGS (e_minicard) & GNOME_CANVAS_ITEM_REALIZED) { @@ -1052,7 +1052,7 @@ e_minicard_reflow(GnomeCanvasItem *item, int flags) } } -const char * +const gchar * e_minicard_get_card_id (EMinicard *minicard) { g_return_val_if_fail(minicard != NULL, NULL); @@ -1065,10 +1065,10 @@ e_minicard_get_card_id (EMinicard *minicard) } } -int +gint e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) { - int cmp = 0; + gint cmp = 0; g_return_val_if_fail(minicard1 != NULL, 0); g_return_val_if_fail(E_IS_MINICARD(minicard1), 0); @@ -1076,7 +1076,7 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) g_return_val_if_fail(E_IS_MINICARD(minicard2), 0); if (minicard1->contact && minicard2->contact) { - char *file_as1, *file_as2; + gchar *file_as1, *file_as2; g_object_get(minicard1->contact, "file_as", &file_as1, NULL); @@ -1100,7 +1100,7 @@ e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2) return cmp; } -int +gint e_minicard_selected (EMinicard *minicard, GdkEvent *event) { gint ret_val = 0; diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 520cc55cac..267e15128d 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -117,11 +117,11 @@ struct _EMinicardField { #define E_MINICARD_FIELD(field) ((EMinicardField *)(field)) GType e_minicard_get_type (void); -const char *e_minicard_get_card_id (EMinicard *minicard); -int e_minicard_compare (EMinicard *minicard1, +const gchar *e_minicard_get_card_id (EMinicard *minicard); +gint e_minicard_compare (EMinicard *minicard1, EMinicard *minicard2); -int e_minicard_selected (EMinicard *minicard, +gint e_minicard_selected (EMinicard *minicard, GdkEvent *event); void e_minicard_activate_editor (EMinicard *minicard); diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index 32ae07862f..91056e0544 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -126,7 +126,7 @@ eab_config_get_type (void) } EABConfig * -eab_config_new (int type, const char *menuid) +eab_config_new (gint type, const gchar *menuid) { EABConfig *ecp = g_object_new (eab_config_get_type(), NULL); e_config_construct (&ecp->config, type, menuid); @@ -156,7 +156,7 @@ static const EConfigHookTargetMap ecph_targets[] = { static void ecph_class_init (EPluginHookClass *klass) { - int i; + gint i; klass->id = "org.gnome.evolution.addressbook.config:1.0"; diff --git a/addressbook/gui/widgets/eab-config.h b/addressbook/gui/widgets/eab-config.h index 330df5141b..edc13bbb1b 100644 --- a/addressbook/gui/widgets/eab-config.h +++ b/addressbook/gui/widgets/eab-config.h @@ -59,7 +59,7 @@ struct _EABConfigTargetSource { typedef struct _EConfigItem EABConfigItem; GType eab_config_get_type (void); -EABConfig *eab_config_new (int type, const char *menuid); +EABConfig *eab_config_new (gint type, const gchar *menuid); EABConfigTargetSource *eab_config_target_new_source (EABConfig *ecp, struct _ESource *source); diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index fe87f3c72a..292edd4e18 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -252,7 +252,7 @@ contact_display_on_url_requested (GtkHTML *html, if (!photo) photo = e_contact_get (display->priv->contact, E_CONTACT_LOGO); - gtk_html_stream_write (handle, (char *)photo->data.inlined.data, photo->data.inlined.length); + gtk_html_stream_write (handle, (gchar *)photo->data.inlined.data, photo->data.inlined.length); gtk_html_end (html, handle, GTK_HTML_STREAM_OK); @@ -305,9 +305,9 @@ contact_display_on_link_clicked (GtkHTML *html, } static void -render_name_value (GtkHTMLStream *html_stream, const char *label, const char *str, const char *icon, unsigned int html_flags) +render_name_value (GtkHTMLStream *html_stream, const gchar *label, const gchar *str, const gchar *icon, guint html_flags) { - char *value = e_text_to_html (str, html_flags); + gchar *value = e_text_to_html (str, html_flags); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { gtk_html_stream_printf (html_stream, "<tr><td align=\"right\" valign=\"top\">%s</td> <td align=\"right\" valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td>", value, label); @@ -327,9 +327,9 @@ render_name_value (GtkHTMLStream *html_stream, const char *label, const char *st } static void -render_attribute (GtkHTMLStream *html_stream, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +render_attribute (GtkHTMLStream *html_stream, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { - const char *str; + const gchar *str; str = e_contact_get_const (contact, field); @@ -339,15 +339,15 @@ render_attribute (GtkHTMLStream *html_stream, EContact *contact, const char *htm } static void -accum_address (GString *gstr, EContact *contact, const char *html_label, EContactField adr_field, EContactField label_field) +accum_address (GString *gstr, EContact *contact, const gchar *html_label, EContactField adr_field, EContactField label_field) { EContactAddress *adr; - const char *label; + const gchar *label; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); label = e_contact_get_const (contact, label_field); if (label) { - char *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); + gchar *html = e_text_to_html (label, E_TEXT_TO_HTML_CONVERT_NL); #ifdef mapping_works if (is_rtl) @@ -392,9 +392,9 @@ accum_address (GString *gstr, EContact *contact, const char *html_label, EContac } static void -accum_name_value (GString *gstr, const char *label, const char *str, const char *icon, unsigned int html_flags) +accum_name_value (GString *gstr, const gchar *label, const gchar *str, const gchar *icon, guint html_flags) { - char *value = e_text_to_html (str, html_flags); + gchar *value = e_text_to_html (str, html_flags); if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL) { g_string_append_printf (gstr, "<tr><td valign=\"top\" align=\"right\">%s</td> <td align=\"right\" valign=\"top\" width=\"100\" nowrap><font color=" HEADER_COLOR ">%s:</font></td>", value, label); @@ -415,9 +415,9 @@ accum_name_value (GString *gstr, const char *label, const char *str, const char static void -accum_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { - const char *str; + const gchar *str; str = e_contact_get_const (contact, field); @@ -427,11 +427,11 @@ accum_attribute (GString *gstr, EContact *contact, const char *html_label, ECont } static void -accum_time_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_time_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { EContactDate *date; GDate *gdate = NULL; - char sdate[100]; + gchar sdate[100]; date = e_contact_get (contact, field); if (date) { @@ -446,13 +446,13 @@ accum_time_attribute (GString *gstr, EContact *contact, const char *html_label, } static void -accum_multival_attribute (GString *gstr, EContact *contact, const char *html_label, EContactField field, const char *icon, unsigned int html_flags) +accum_multival_attribute (GString *gstr, EContact *contact, const gchar *html_label, EContactField field, const gchar *icon, guint html_flags) { GList *val_list, *l; val_list = e_contact_get (contact, field); for (l = val_list; l; l = l->next) { - const char *str = (const char *) l->data; + const gchar *str = (const gchar *) l->data; accum_name_value (gstr, html_label, str, icon, html_flags); } g_list_foreach (val_list, (GFunc) g_free, NULL); @@ -488,7 +488,7 @@ render_contact_list (GtkHTMLStream *html_stream, EContact *contact) } static void -start_block (GtkHTMLStream *html_stream, const char *label) +start_block (GtkHTMLStream *html_stream, const gchar *label) { gtk_html_stream_printf (html_stream, "<tr><td height=\"20\" colspan=\"3\"><font color=" HEADER_COLOR "><b>%s</b></font></td></tr>", label); } @@ -499,7 +499,7 @@ end_block (GtkHTMLStream *html_stream) gtk_html_stream_printf (html_stream, "<tr><td height=\"20\"> </td></tr>"); } -static const char * +static const gchar * get_email_location (EVCardAttribute *attr) { gint i; @@ -519,10 +519,10 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) GList *email_list, *l, *email_attr_list, *al; gboolean is_rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL); #ifdef HANDLE_MAILTO_INTERNALLY - int email_num = 0; + gint email_num = 0; #endif const gchar *nl; - char *nick=NULL; + gchar *nick=NULL; gtk_html_stream_printf (html_stream, "<table border=\"0\">"); @@ -535,8 +535,8 @@ render_contact (GtkHTMLStream *html_stream, EContact *contact) email_attr_list = e_contact_get_attributes (contact, E_CONTACT_EMAIL); for (l = email_list, al=email_attr_list; l && al; l = l->next, al = al->next) { - char *html = NULL, *name = NULL, *mail = NULL; - char *attr_str = (char *)get_email_location ((EVCardAttribute *) al->data); + gchar *html = NULL, *name = NULL, *mail = NULL; + gchar *attr_str = (gchar *)get_email_location ((EVCardAttribute *) al->data); #ifdef HANDLE_MAILTO_INTERNALLY if (!eab_parse_qp_email (l->data, &name, &mail)) @@ -668,8 +668,8 @@ eab_contact_display_render_normal (EABContactDisplay *display, EContact *contact gtk_html_stream_printf (html_stream, "<body><table width=\"100%%\"><tr><td %s>\n", is_rtl ? " align=\"right\" " : ""); if (contact) { - const char *str; - char *html; + const gchar *str; + gchar *html; EContactPhoto *photo; gtk_html_stream_printf (html_stream, "<table cellspacing=\"20\" border=\"0\"><td %s valign=\"top\">", is_rtl ? " align=\"right\" " : ""); @@ -723,8 +723,8 @@ eab_contact_display_render_compact (EABContactDisplay *display, gtk_html_stream_write (html_stream, "<body>\n", 7); if (contact) { - const char *str; - char *html; + const gchar *str; + gchar *html; EContactPhoto *photo; guint bg_frame = 0x000000, bg_body = 0xEEEEEE; GtkStyle *style; @@ -758,7 +758,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, if (!photo) photo = e_contact_get (contact, E_CONTACT_LOGO); if (photo) { - int calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION; + gint calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION; GdkPixbufLoader *loader = gdk_pixbuf_loader_new (); GdkPixbuf *pixbuf; @@ -773,7 +773,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, g_object_ref (pixbuf); g_object_unref (loader); if (pixbuf) { - int max_dimension; + gint max_dimension; calced_width = gdk_pixbuf_get_width (pixbuf); calced_height = gdk_pixbuf_get_height (pixbuf); diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index d5ec322c3d..e8269100b7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -48,7 +48,7 @@ /* the NULL's in this table correspond to the status codes that should *never* be generated by a backend */ -static const char *status_to_string[] = { +static const gchar *status_to_string[] = { /* E_BOOK_ERROR_OK */ N_("Success"), /* E_BOOK_ERROR_INVALID_ARG */ NULL, /* E_BOOK_ERROR_BUSY */ N_("Backend busy"), @@ -75,9 +75,9 @@ static const char *status_to_string[] = { }; void -eab_error_dialog (const char *msg, EBookStatus status) +eab_error_dialog (const gchar *msg, EBookStatus status) { - const char *status_str; + const gchar *status_str; if (status >= G_N_ELEMENTS (status_to_string)) status_str = "Other error"; @@ -91,7 +91,7 @@ eab_error_dialog (const char *msg, EBookStatus status) void eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) { - char *label_string, *label = NULL, *uri; + gchar *label_string, *label = NULL, *uri; GtkWidget *dialog; gboolean can_detail_error = TRUE; @@ -108,7 +108,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) } else if (!strncmp (uri, "file:", 5)) { - char *path = g_filename_from_uri (uri, NULL, NULL); + gchar *path = g_filename_from_uri (uri, NULL, NULL); label = g_strdup_printf ( _("This address book cannot be opened. Please check that the " "path %s exists and that permissions are set to access it."), path); @@ -156,7 +156,7 @@ void eab_search_result_dialog (GtkWidget *parent, EBookViewStatus status) { - char *str = NULL; + gchar *str = NULL; switch (status) { case E_BOOK_VIEW_STATUS_OK: @@ -196,11 +196,11 @@ eab_prompt_save_dialog (GtkWindow *parent) } static gint -file_exists(GtkWindow *window, const char *filename) +file_exists(GtkWindow *window, const gchar *filename) { GtkWidget *dialog; gint response; - char * utf8_filename; + gchar * utf8_filename; utf8_filename = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL); dialog = gtk_message_dialog_new (window, @@ -222,15 +222,15 @@ file_exists(GtkWindow *window, const char *filename) typedef struct { GtkWidget *filesel; - char *vcard; + gchar *vcard; gboolean has_multiple_contacts; } SaveAsInfo; static void save_it(GtkWidget *widget, SaveAsInfo *info) { - const char *filename; - char *uri; + const gchar *filename; + gchar *uri; gint response = 0; @@ -248,7 +248,7 @@ save_it(GtkWidget *widget, SaveAsInfo *info) } if (!e_write_file_uri (uri, info->vcard)) { - char *err_str_ext; + gchar *err_str_ext; if (info->has_multiple_contacts) { /* more than one, finding the total number of contacts might * hit performance while saving large number of contacts @@ -279,7 +279,7 @@ close_it(GtkWidget *widget, SaveAsInfo *info) } static void -destroy_it(void *data, GObject *where_the_object_was) +destroy_it(gpointer data, GObject *where_the_object_was) { SaveAsInfo *info = data; g_free (info->vcard); @@ -295,10 +295,10 @@ filechooser_response (GtkWidget *widget, gint response_id, SaveAsInfo *info) close_it (widget, info); } -static char * -make_safe_filename (char *name) +static gchar * +make_safe_filename (gchar *name) { - char *safe; + gchar *safe; if (!name) { /* This is a filename. Translators take note. */ @@ -381,11 +381,11 @@ eab_select_source (const gchar *title, const gchar *message, const gchar *select } void -eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window) +eab_contact_save (gchar *title, EContact *contact, GtkWindow *parent_window) { GtkWidget *filesel; - char *file; - char *name; + gchar *file; + gchar *name; SaveAsInfo *info = g_new(SaveAsInfo, 1); name = e_contact_get (contact, E_CONTACT_FILE_AS); @@ -423,11 +423,11 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window) } void -eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window) +eab_contact_list_save (gchar *title, GList *list, GtkWindow *parent_window) { GtkWidget *filesel; SaveAsInfo *info = g_new(SaveAsInfo, 1); - char *file; + gchar *file; filesel = gtk_file_chooser_dialog_new (title, parent_window, @@ -446,7 +446,7 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window) /* This is a filename. Translators take note. */ if (list && list->data && list->next == NULL) { - char *name; + gchar *name; name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FILE_AS); if (!name) name = e_contact_get (E_CONTACT (list->data), E_CONTACT_FULL_NAME); @@ -481,7 +481,7 @@ typedef struct ContactCopyProcess_ ContactCopyProcess; typedef void (*ContactCopyDone) (ContactCopyProcess *process); struct ContactCopyProcess_ { - int count; + gint count; gboolean book_status; GList *contacts; EBook *source; @@ -494,7 +494,7 @@ do_delete (gpointer data, gpointer user_data) { EBook *book = user_data; EContact *contact = data; - const char *id; + const gchar *id; id = e_contact_get_const (contact, E_CONTACT_UID); e_book_remove_contact(book, id, NULL); @@ -528,7 +528,7 @@ process_unref (ContactCopyProcess *process) } static void -contact_added_cb (EBook* book, EBookStatus status, const char *id, gpointer user_data) +contact_added_cb (EBook* book, EBookStatus status, const gchar *id, gpointer user_data) { ContactCopyProcess *process = user_data; @@ -583,9 +583,9 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de { EBook *dest; ESource *destination_source; - static char *last_uid = NULL; + static gchar *last_uid = NULL; ContactCopyProcess *process; - char *desc; + gchar *desc; if (contacts == NULL) return; @@ -638,7 +638,7 @@ eab_create_image_chooser_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { - char *filename; + gchar *filename; GtkWidget *w = NULL; w = e_image_chooser_new (); @@ -686,12 +686,12 @@ eab_parse_qp_email (const gchar *string, gchar **name, gchar **email) then makes one string and returns it, otherwise returns NULL. Returned string is usable to place directly into GtkHtml stream. Returned value should be freed with g_free. */ -char * +gchar * eab_parse_qp_email_to_html (const gchar *string) { - char *name = NULL, *mail = NULL; - char *html_name, *html_mail; - char *value; + gchar *name = NULL, *mail = NULL; + gchar *html_name, *html_mail; + gchar *value; if (!eab_parse_qp_email (string, &name, &mail)) return NULL; diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h index 82fc172321..916aa7d555 100644 --- a/addressbook/gui/widgets/eab-gui-util.h +++ b/addressbook/gui/widgets/eab-gui-util.h @@ -43,11 +43,11 @@ void eab_transfer_contacts (EBook *source, gboolean delete_from_source, GtkWindow *parent_window); -void eab_contact_save (char *title, +void eab_contact_save (gchar *title, EContact *contact, GtkWindow *parent_window); -void eab_contact_list_save (char *title, +void eab_contact_list_save (gchar *title, GList *list, GtkWindow *parent_window); diff --git a/addressbook/gui/widgets/gal-view-factory-minicard.c b/addressbook/gui/widgets/gal-view-factory-minicard.c index 0240dddb60..2e9accaeac 100644 --- a/addressbook/gui/widgets/gal-view-factory-minicard.c +++ b/addressbook/gui/widgets/gal-view-factory-minicard.c @@ -31,7 +31,7 @@ G_DEFINE_TYPE (GalViewFactoryMinicard, gal_view_factory_minicard, GAL_VIEW_FACTORY_TYPE) -static const char * +static const gchar * gal_view_factory_minicard_get_title (GalViewFactory *factory) { return _("Card View"); @@ -39,12 +39,12 @@ gal_view_factory_minicard_get_title (GalViewFactory *factory) static GalView * gal_view_factory_minicard_new_view (GalViewFactory *factory, - const char *name) + const gchar *name) { return gal_view_minicard_new(name); } -static const char * +static const gchar * gal_view_factory_minicard_get_type_code (GalViewFactory *factory) { return "minicard"; diff --git a/addressbook/gui/widgets/gal-view-minicard.c b/addressbook/gui/widgets/gal-view-minicard.c index 0ebc928bad..c7b2a4a38f 100644 --- a/addressbook/gui/widgets/gal-view-minicard.c +++ b/addressbook/gui/widgets/gal-view-minicard.c @@ -137,7 +137,7 @@ view_minicard_get_title (GalView *view) static void view_minicard_set_title (GalView *view, - const char *title) + const gchar *title) { GalViewMinicard *view_minicard; diff --git a/addressbook/gui/widgets/gal-view-minicard.h b/addressbook/gui/widgets/gal-view-minicard.h index c7a8c912d4..c506fb1a2b 100644 --- a/addressbook/gui/widgets/gal-view-minicard.h +++ b/addressbook/gui/widgets/gal-view-minicard.h @@ -56,7 +56,7 @@ typedef struct _GalViewMinicardClass GalViewMinicardClass; struct _GalViewMinicard { GalView parent; - char *title; + gchar *title; double column_width; EMinicardViewWidget *emvw; diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 164f9f5fe2..0456f81b19 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -53,7 +53,7 @@ typedef struct { guint idle_id; - int state; + gint state; FILE *file; gulong size; gint count; @@ -63,7 +63,7 @@ typedef struct { } CSVImporter; static gint importer; -static char delimiter; +static gchar delimiter; static void csv_import_done(CSVImporter *gci); @@ -85,7 +85,7 @@ typedef struct { #define FLAG_BIRTH_MONTH 0x50 #define FLAG_DATE_ANNIVERSARY 0x30 #define FLAG_INVALID 0xff - int flags; + gint flags; }import_fields; static import_fields csv_fields_outlook[] = { @@ -263,7 +263,7 @@ static import_fields csv_fields_evolution[] = { }; static void -add_to_notes(EContact *contact, gint i, char *val) { +add_to_notes(EContact *contact, gint i, gchar *val) { const gchar *old_text; const gchar *field_text = NULL; GString *new_text; @@ -296,12 +296,12 @@ add_to_notes(EContact *contact, gint i, char *val) { /* @str: a date string in the format MM-DD-YYYY or MMDDYYYY */ static EContactDate* -date_from_string (const char *str) +date_from_string (const gchar *str) { EContactDate* date; - int length; - char *t; - int i = 0; + gint length; + gchar *t; + gint i = 0; g_return_val_if_fail (str != NULL, NULL); @@ -335,13 +335,13 @@ date_from_string (const char *str) } static gboolean -parseLine (CSVImporter *gci, EContact *contact, char *buf) { +parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { - char *ptr = buf, *do_free = NULL; + gchar *ptr = buf, *do_free = NULL; GString *value; gint i = 0; - int flags = 0; - int contact_field; + gint flags = 0; + gint contact_field; EContactAddress *home_address = NULL, *work_address = NULL, *other_address = NULL; EContactDate *bday = NULL; GString *home_street, *work_street, *other_street; @@ -554,8 +554,8 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { EContact *contact = NULL; GString *line; GString *str; - char *buf; - char c; + gchar *buf; + gchar c; /* if(!fgets(line, sizeof(line),f)) @@ -642,7 +642,7 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { } static gboolean -csv_import_contacts(void *d) { +csv_import_contacts(gpointer d) { CSVImporter *gci = d; EContact *contact = NULL; @@ -711,8 +711,8 @@ static const gchar *supported_extensions[4] = { static gboolean csv_supported(EImport *ei, EImportTarget *target, EImportImporter *im) { - char *ext; - int i; + gchar *ext; + gint i; EImportTargetURI *s; if (target->type != E_IMPORT_TARGET_URI) diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 75f30a2359..544bb485fb 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -58,7 +58,7 @@ typedef struct { GHashTable *dn_contact_hash; - int state; /* 0 - initial scan, 1 - list cards, 2 - cancelled/complete */ + gint state; /* 0 - initial scan, 1 - list cards, 2 - cancelled/complete */ FILE *file; gulong size; @@ -79,7 +79,7 @@ static struct { #define FLAG_WORK_ADDRESS 0x02 #define FLAG_LIST 0x04 #define FLAG_BOOLEAN 0x08 - int flags; + gint flags; } ldif_fields[] = { { "cn", E_CONTACT_FULL_NAME }, @@ -128,13 +128,13 @@ ldif_fields[] = { { "nsAIMid", E_CONTACT_IM_AIM, FLAG_LIST }, { "mozilla_AimScreenName", E_CONTACT_IM_AIM, FLAG_LIST } }; -static int num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]); +static gint num_ldif_fields = sizeof(ldif_fields) / sizeof (ldif_fields[0]); static GString * -getValue( char **src ) +getValue( gchar **src ) { GString *dest = g_string_new(""); - char *s = *src; + gchar *s = *src; gboolean need_base64 = (*s == ':'); copy_line: @@ -167,7 +167,7 @@ getValue( char **src ) } static void -populate_contact_address (EContactAddress *address, char *attr, char *value) +populate_contact_address (EContactAddress *address, gchar *attr, gchar *value) { if (!g_ascii_strcasecmp (attr, "locality") || !g_ascii_strcasecmp (attr, "l") || @@ -188,7 +188,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) else if (!g_ascii_strcasecmp (attr, "mozillaPostalAddress2") || !g_ascii_strcasecmp (attr, "mozillaHomePostalAddress2")) { if (address->ext && *address->ext) { - char *temp = g_strdup (address->ext); + gchar *temp = g_strdup (address->ext); g_free (address->ext); address->ext = g_strconcat (temp, ",\n", value, NULL); g_free (temp); @@ -199,7 +199,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) } else if (!g_ascii_strcasecmp (attr, "postalAddress") || !g_ascii_strcasecmp (attr, "homepostalAddress")) { - char *c, *i, *addr_field; + gchar *c, *i, *addr_field; addr_field = g_strdup (value); i = addr_field; @@ -210,7 +210,7 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) } } if (address->ext && *address->ext) { - char *temp = g_strdup (address->ext); + gchar *temp = g_strdup (address->ext); g_free (address->ext); address->ext = g_strconcat (addr_field, ",\n", temp, NULL); g_free (temp); @@ -225,10 +225,10 @@ populate_contact_address (EContactAddress *address, char *attr, char *value) static gboolean parseLine (LDIFImporter *gci, EContact *contact, EContactAddress *work_address, EContactAddress *home_address, - char **buf) + gchar **buf) { - char *ptr; - char *colon, *value; + gchar *ptr; + gchar *colon, *value; gboolean field_handled; GString *ldif_value; @@ -256,9 +256,9 @@ parseLine (LDIFImporter *gci, EContact *contact, return FALSE; } - colon = (char *)strchr( ptr, ':' ); + colon = (gchar *)strchr( ptr, ':' ); if (colon) { - int i; + gint i; *colon = 0; value = colon + 1; @@ -345,8 +345,8 @@ getNextLDIFEntry(LDIFImporter *gci, FILE *f ) EContact *contact; EContactAddress *work_address, *home_address; GString *str; - char line[1024]; - char *buf; + gchar line[1024]; + gchar *buf; str = g_string_new (""); /* read from the file until we get to a blank line (or eof) */ @@ -402,7 +402,7 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) { GList *email, *l; GList *email_attrs = NULL; - char *full_name; + gchar *full_name; /* set file_as to full_name so we don't later try and figure out a first/last name for the list. */ @@ -415,7 +415,7 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) email = e_contact_get (contact, E_CONTACT_EMAIL); for (l = email; l; l = l->next) { /* mozilla stuffs dn's in the EMAIL list for contact lists */ - char *dn = l->data; + gchar *dn = l->data; EContact *dn_contact = g_hash_table_lookup (gci->dn_contact_hash, dn); /* break list chains here, since we don't support them just yet */ @@ -467,12 +467,12 @@ add_to_notes (EContact *contact, EContactField field) } static gboolean -ldif_import_contacts(void *d) +ldif_import_contacts(gpointer d) { LDIFImporter *gci = d; EContact *contact; GSList *iter; - int count = 0; + gint count = 0; /* We process all normal cards immediately and keep the list ones till the end */ @@ -563,8 +563,8 @@ static const gchar *supported_extensions[2] = { static gboolean ldif_supported(EImport *ei, EImportTarget *target, EImportImporter *im) { - char *ext; - int i; + gchar *ext; + gint i; EImportTargetURI *s; if (target->type != E_IMPORT_TARGET_URI) diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 1ec623d098..169c6413d1 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -51,9 +51,9 @@ typedef struct { guint idle_id; - int state; /* 0 - importing, 1 - cancelled/complete */ - int total; - int count; + gint state; /* 0 - importing, 1 - cancelled/complete */ + gint total; + gint count; ESource *primary; @@ -115,8 +115,8 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) GList *v = e_vcard_attribute_get_values (a); if (v && v->data) { - if (!strncmp ((char*)v->data, "<?xml", 5)) { - EDestination *dest = e_destination_import ((char*)v->data); + if (!strncmp ((gchar *)v->data, "<?xml", 5)) { + EDestination *dest = e_destination_import ((gchar *)v->data); e_destination_export_to_vcard_attribute (dest, a); @@ -155,9 +155,9 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) vs = e_vcard_attribute_param_get_values (p); for (v = vs; v; v = v->next) { - if (!g_ascii_strcasecmp ((char*)v->data, "WORK") || - !g_ascii_strcasecmp ((char*)v->data, "HOME") || - !g_ascii_strcasecmp ((char*)v->data, "OTHER")) + if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") || + !g_ascii_strcasecmp ((gchar *)v->data, "HOME") || + !g_ascii_strcasecmp ((gchar *)v->data, "OTHER")) no_location = FALSE; else location_only = FALSE; @@ -204,8 +204,8 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) vs = e_vcard_attribute_param_get_values (p); for (v = vs; v; v = v->next) { - if (!g_ascii_strcasecmp ((char*)v->data, "WORK") || - !g_ascii_strcasecmp ((char*)v->data, "HOME")) + if (!g_ascii_strcasecmp ((gchar *)v->data, "WORK") || + !g_ascii_strcasecmp ((gchar *)v->data, "HOME")) no_location = FALSE; } } @@ -228,10 +228,10 @@ vcard_import_contact(VCardImporter *gci, EContact *contact) } static gboolean -vcard_import_contacts(void *data) +vcard_import_contacts(gpointer data) { VCardImporter *gci = data; - int count = 0; + gint count = 0; GList *iterator = gci->iterator; if (gci->state == 0) { @@ -319,11 +319,11 @@ typedef enum _VCardEncoding VCardEncoding; /* Actually check the contents of this file */ static VCardEncoding -guess_vcard_encoding (const char *filename) +guess_vcard_encoding (const gchar *filename) { FILE *handle; - char line[4096]; - char *line_utf8; + gchar line[4096]; + gchar *line_utf8; VCardEncoding encoding = VCARD_ENCODING_NONE; handle = g_fopen (filename, "r"); @@ -455,7 +455,7 @@ static void vcard_import(EImport *ei, EImportTarget *target, EImportImporter *im) { VCardImporter *gci; - char *contents; + gchar *contents; VCardEncoding encoding; EBook *book; EImportTargetURI *s = (EImportTargetURI *)target; diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index cc3affeb2c..e57e5d175e 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -225,9 +225,9 @@ e_contact_start_new_page (EContactPrintContext *ctxt) static void e_contact_print_contact (EContact *contact, EContactPrintContext *ctxt) { - char *file_as; + gchar *file_as; cairo_t *cr; - int field; + gint field; cr = gtk_print_context_get_cairo_context (ctxt->context); cairo_save(cr); @@ -444,70 +444,70 @@ e_contact_build_style (EContactPrintStyle *style) xmlNodePtr stylenode = xmlDocGetRootElement(styledoc); xmlNodePtr node; for (node = stylenode->children; node; node = node->next) { - char *data = (char *)xmlNodeGetContent ( node ); - if ( !strcmp( (char *)node->name, "title" ) ) { + gchar *data = (gchar *)xmlNodeGetContent ( node ); + if ( !strcmp( (gchar *)node->name, "title" ) ) { get_string(data, &(style->title)); - } else if ( !strcmp( (char *)node->name, "type" ) ) { + } else if ( !strcmp( (gchar *)node->name, "type" ) ) { if (g_ascii_strcasecmp (data, "cards") == 0) style->type = E_CONTACT_PRINT_TYPE_CARDS; else if (g_ascii_strcasecmp (data, "memo_style") == 0) style->type = E_CONTACT_PRINT_TYPE_MEMO_STYLE; else if (g_ascii_strcasecmp (data, "phone_list") == 0) style->type = E_CONTACT_PRINT_TYPE_PHONE_LIST; - } else if ( !strcmp( (char *)node->name, "sections_start_new_page" ) ) { + } else if ( !strcmp( (gchar *)node->name, "sections_start_new_page" ) ) { style->sections_start_new_page = get_bool(data); - } else if ( !strcmp( (char *)node->name, "num_columns" ) ) { + } else if ( !strcmp( (gchar *)node->name, "num_columns" ) ) { style->num_columns = get_integer(data); - } else if ( !strcmp( (char *)node->name, "blank_forms" ) ) { + } else if ( !strcmp( (gchar *)node->name, "blank_forms" ) ) { style->blank_forms = get_integer(data); - } else if ( !strcmp( (char *)node->name, "letter_headings" ) ) { + } else if ( !strcmp( (gchar *)node->name, "letter_headings" ) ) { style->letter_headings = get_bool(data); - } else if ( !strcmp( (char *)node->name, "headings_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "headings_font" ) ) { get_font( data, &(style->headings_font) ); - } else if ( !strcmp( (char *)node->name, "body_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "body_font" ) ) { get_font( data, &(style->body_font) ); - } else if ( !strcmp( (char *)node->name, "print_using_grey" ) ) { + } else if ( !strcmp( (gchar *)node->name, "print_using_grey" ) ) { style->print_using_grey = get_bool(data); - } else if ( !strcmp( (char *)node->name, "paper_width" ) ) { + } else if ( !strcmp( (gchar *)node->name, "paper_width" ) ) { style->paper_width = get_float(data); - } else if ( !strcmp( (char *)node->name, "paper_height" ) ) { + } else if ( !strcmp( (gchar *)node->name, "paper_height" ) ) { style->paper_height = get_float(data); - } else if ( !strcmp( (char *)node->name, "top_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "top_margin" ) ) { style->top_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "left_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_margin" ) ) { style->left_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "bottom_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "bottom_margin" ) ) { style->bottom_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "right_margin" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_margin" ) ) { style->right_margin = get_float(data); - } else if ( !strcmp( (char *)node->name, "page_width" ) ) { + } else if ( !strcmp( (gchar *)node->name, "page_width" ) ) { style->page_width = get_float(data); - } else if ( !strcmp( (char *)node->name, "page_height" ) ) { + } else if ( !strcmp( (gchar *)node->name, "page_height" ) ) { style->page_height = get_float(data); - } else if ( !strcmp( (char *)node->name, "orientation" ) ) { + } else if ( !strcmp( (gchar *)node->name, "orientation" ) ) { if ( data ) { style->orientation_portrait = (g_ascii_strcasecmp (data, "landscape") != 0); } else { style->orientation_portrait = TRUE; } - } else if ( !strcmp( (char *)node->name, "header_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "header_font" ) ) { get_font( data, &(style->header_font) ); - } else if ( !strcmp( (char *)node->name, "left_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_header" ) ) { get_string(data, &(style->left_header)); - } else if ( !strcmp( (char *)node->name, "center_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "center_header" ) ) { get_string(data, &(style->center_header)); - } else if ( !strcmp( (char *)node->name, "right_header" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_header" ) ) { get_string(data, &(style->right_header)); - } else if ( !strcmp( (char *)node->name, "footer_font" ) ) { + } else if ( !strcmp( (gchar *)node->name, "footer_font" ) ) { get_font( data, &(style->footer_font) ); - } else if ( !strcmp( (char *)node->name, "left_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "left_footer" ) ) { get_string(data, &(style->left_footer)); - } else if ( !strcmp( (char *)node->name, "center_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "center_footer" ) ) { get_string(data, &(style->center_footer)); - } else if ( !strcmp( (char *)node->name, "right_footer" ) ) { + } else if ( !strcmp( (gchar *)node->name, "right_footer" ) ) { get_string(data, &(style->right_footer)); - } else if ( !strcmp( (char *)node->name, "reverse_on_even_pages" ) ) { + } else if ( !strcmp( (gchar *)node->name, "reverse_on_even_pages" ) ) { style->reverse_on_even_pages = get_bool(data); } if ( data ) diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c index c38d2129a0..58ff940f03 100644 --- a/addressbook/printing/test-print.c +++ b/addressbook/printing/test-print.c @@ -27,8 +27,8 @@ #include <glade/glade.h> #include "e-contact-print.h" -int -main (int argc, char *argv[]) +gint +main (gint argc, gchar *argv[]) { GList *shown_fields = NULL; diff --git a/addressbook/tools/evolution-addressbook-export-list-cards.c b/addressbook/tools/evolution-addressbook-export-list-cards.c index 72fa8a07e3..2b418345ae 100644 --- a/addressbook/tools/evolution-addressbook-export-list-cards.c +++ b/addressbook/tools/evolution-addressbook-export-list-cards.c @@ -242,7 +242,7 @@ gchar *e_contact_get_csv (EContact * contact, GSList * csv_all_fields); gchar *delivery_address_get_sub_field (const EContactAddress * delivery_address, DeliveryAddressField sub_field); gchar *check_null_pointer (gchar * orig); gchar *escape_string (gchar * orig); -int output_n_cards_file (FILE * outputfile, GList *contacts, int size, int begin_no, CARD_FORMAT format); +gint output_n_cards_file (FILE * outputfile, GList *contacts, gint size, gint begin_no, CARD_FORMAT format); static void fork_to_background (void); void set_pre_defined_field (GSList ** pre_defined_fields); @@ -566,10 +566,10 @@ escape_string (gchar *orig) return dest; } -int -output_n_cards_file (FILE * outputfile, GList *contacts, int size, int begin_no, CARD_FORMAT format) +gint +output_n_cards_file (FILE * outputfile, GList *contacts, gint size, gint begin_no, CARD_FORMAT format) { - int i; + gint i; if (format == CARD_FORMAT_VCARD) { for (i = begin_no; i < size + begin_no; i++) { EContact *contact = g_list_nth_data (contacts, i); @@ -628,11 +628,11 @@ action_list_cards (GList *contacts, ActionContext * p_actctx) { FILE *outputfile; long length; - int IsFirstOne; - int series_no; + gint IsFirstOne; + gint series_no; gchar *file_series_name; CARD_FORMAT format; - int size; + gint size; length = g_list_length (contacts); diff --git a/addressbook/tools/evolution-addressbook-export-list-folders.c b/addressbook/tools/evolution-addressbook-export-list-folders.c index e93748861d..1f18686242 100644 --- a/addressbook/tools/evolution-addressbook-export-list-folders.c +++ b/addressbook/tools/evolution-addressbook-export-list-folders.c @@ -61,8 +61,8 @@ action_list_folders_init (ActionContext * p_actctx) EBook *book; EBookQuery *query; GList *contacts; - char *uri; - const char *name; + gchar *uri; + const gchar *name; book = e_book_new (s, NULL); if (!book diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index 1a7f86142b..c8ae956081 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -64,16 +64,16 @@ static GOptionEntry entries[] = { { NULL } }; -int -main (int argc, char **argv) +gint +main (gint argc, gchar **argv) { ActionContext actctx; GOptionContext *context; GError *error = NULL; - int current_action = ACTION_NOTHING; - int IsCSV = FALSE; - int IsVCard = FALSE; + gint current_action = ACTION_NOTHING; + gint IsCSV = FALSE; + gint IsVCard = FALSE; /*i18n-lize */ bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); @@ -162,7 +162,7 @@ main (int argc, char **argv) exit (-1); } - /*FIXME:should free actctx's some char* field, such as output_file! but since the program will end, so that will not cause mem leak. */ + /*FIXME:should free actctx's some gchar * field, such as output_file! but since the program will end, so that will not cause mem leak. */ exit (0); } diff --git a/addressbook/util/addressbook.c b/addressbook/util/addressbook.c index f36012ab94..45790e15c0 100644 --- a/addressbook/util/addressbook.c +++ b/addressbook/util/addressbook.c @@ -57,10 +57,10 @@ free_load_source_data (LoadSourceData *data) /*this function removes of anything present after semicolon in uri*/ -static gchar* +static gchar * remove_parameters_from_uri (const gchar *uri) { - char *euri_str; + gchar *euri_str; EUri *euri; euri = e_uri_new (uri); @@ -167,8 +167,8 @@ static void addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *source, EBookCallback cb, gpointer closure) { - const char *password = NULL; - char *pass_dup = NULL; + const gchar *password = NULL; + gchar *pass_dup = NULL; const gchar *auth; const gchar *user; gchar *uri = remove_parameters_from_uri(e_book_get_uri (book)); @@ -197,8 +197,8 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc user = ""; if (!password) { - char *prompt; - char *password_prompt; + gchar *prompt; + gchar *password_prompt; gboolean remember; const gchar *failed_auth; guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE; diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c index 8d08a3e88f..ec8fccb5ba 100644 --- a/addressbook/util/eab-book-util.c +++ b/addressbook/util/eab-book-util.c @@ -46,11 +46,11 @@ eab_get_config_database (void) * */ -static char* -escape (const char *str) +static gchar * +escape (const gchar *str) { GString *s = g_string_new (NULL); - const char *p = str; + const gchar *p = str; while (*p) { if (*p == '\\') @@ -76,7 +76,7 @@ eab_name_and_email_query (EBook *book, gchar *email_query=NULL, *name_query=NULL; EBookQuery *query; guint tag; - char *escaped_name, *escaped_email; + gchar *escaped_name, *escaped_email; g_return_val_if_fail (book && E_IS_BOOK (book), 0); g_return_val_if_fail (cb != NULL, 0); @@ -118,7 +118,7 @@ eab_name_and_email_query (EBook *book, /* Assemble our e-mail & name queries */ if (email_query && name_query) { - char *full_query = g_strdup_printf ("(and %s %s)", email_query, name_query); + gchar *full_query = g_strdup_printf ("(and %s %s)", email_query, name_query); query = e_book_query_from_string (full_query); g_free (full_query); } @@ -147,12 +147,12 @@ eab_name_and_email_query (EBook *book, */ guint eab_nickname_query (EBook *book, - const char *nickname, + const gchar *nickname, EBookListCallback cb, gpointer closure) { EBookQuery *query; - char *query_string; + gchar *query_string; guint retval; g_return_val_if_fail (E_IS_BOOK (book), 0); @@ -175,11 +175,11 @@ eab_nickname_query (EBook *book, } /* Copied from camel_strstrcase */ -static char * -eab_strstrcase (const char *haystack, const char *needle) +static gchar * +eab_strstrcase (const gchar *haystack, const gchar *needle) { /* find the needle in the haystack neglecting case */ - const char *ptr; + const gchar *ptr; guint len; g_return_val_if_fail (haystack != NULL, NULL); @@ -190,24 +190,24 @@ eab_strstrcase (const char *haystack, const char *needle) return NULL; if (len == 0) - return (char *) haystack; + return (gchar *) haystack; for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++) if (!g_ascii_strncasecmp (ptr, needle, len)) - return (char *) ptr; + return (gchar *) ptr; return NULL; } GList* -eab_contact_list_from_string (const char *str) +eab_contact_list_from_string (const gchar *str) { GList *contacts = NULL; GString *gstr = g_string_new (NULL); - char *str_stripped; - char *p = (char*)str; - char *q; + gchar *str_stripped; + gchar *p = (gchar *)str; + gchar *q; if (!p) return NULL; @@ -270,7 +270,7 @@ eab_contact_list_from_string (const char *str) return contacts; } -char* +gchar * eab_contact_list_to_string (GList *contacts) { GString *str = g_string_new (""); @@ -278,7 +278,7 @@ eab_contact_list_to_string (GList *contacts) for (l = contacts; l; l = l->next) { EContact *contact = l->data; - char *vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); + gchar *vcard_str = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30); g_string_append (str, vcard_str); if (l->next) @@ -289,10 +289,10 @@ eab_contact_list_to_string (GList *contacts) } gboolean -eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **contacts) +eab_book_and_contact_list_from_string (const gchar *str, EBook **book, GList **contacts) { - const char *s0, *s1; - char *uri; + const gchar *s0, *s1; + gchar *uri; g_return_val_if_fail (str != NULL, FALSE); g_return_val_if_fail (book != NULL, FALSE); @@ -323,10 +323,10 @@ eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **co return *book ? TRUE : FALSE; } -char * +gchar * eab_book_and_contact_list_to_string (EBook *book, GList *contacts) { - char *s0, *s1; + gchar *s0, *s1; s0 = eab_contact_list_to_string (contacts); if (!s0) @@ -406,12 +406,12 @@ eab_query_address_default (const gchar *email, #endif /* bad place for this i know. */ -int -e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len) +gint +e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len) { gchar *s1 = g_utf8_casefold(str1, len); gchar *s2 = g_utf8_casefold(str2, len); - int rv; + gint rv; rv = g_utf8_collate (s1, s2); @@ -421,7 +421,7 @@ e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len) return rv; } -int +gint e_utf8_casefold_collate (const gchar *str1, const gchar *str2) { return e_utf8_casefold_collate_len (str1, str2, -1); diff --git a/addressbook/util/eab-book-util.h b/addressbook/util/eab-book-util.h index cb59dc9085..a06ef43929 100644 --- a/addressbook/util/eab-book-util.h +++ b/addressbook/util/eab-book-util.h @@ -36,20 +36,20 @@ EConfigListener *eab_get_config_database (void); /* Specialized Name/Email Queries */ guint eab_name_and_email_query (EBook *book, - const char *name, - const char *email, + const gchar *name, + const gchar *email, EBookListCallback cb, gpointer closure); guint eab_nickname_query (EBook *book, - const char *nickname, + const gchar *nickname, EBookListCallback cb, gpointer closure); -GList *eab_contact_list_from_string (const char *str); -char *eab_contact_list_to_string (GList *contacts); +GList *eab_contact_list_from_string (const gchar *str); +gchar *eab_contact_list_to_string (GList *contacts); -gboolean eab_book_and_contact_list_from_string (const char *str, EBook **book, GList **contacts); -char *eab_book_and_contact_list_to_string (EBook *book, GList *contacts); +gboolean eab_book_and_contact_list_from_string (const gchar *str, EBook **book, GList **contacts); +gchar *eab_book_and_contact_list_to_string (EBook *book, GList *contacts); /* Returns the EContact associated to email in the callback, or NULL if no match is found in the default address book. */ @@ -57,8 +57,8 @@ void eab_query_address_default (const gchar * EABHaveAddressCallback cb, gpointer closure); -int e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len); -int e_utf8_casefold_collate (const gchar *str1, const gchar *str2); +gint e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, gint len); +gint e_utf8_casefold_collate (const gchar *str1, const gchar *str2); G_END_DECLS |