diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-06-02 07:09:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-06-02 22:35:03 +0800 |
commit | 433eac7844481b8ceda0bae8bf08f6bb623185b0 (patch) | |
tree | d66a04ad4fa676b4bfce762dee09a82f4434d374 /addressbook | |
parent | e6c6cbdfb5fd5723ff840b24b29690235be0d74d (diff) | |
download | gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar.gz gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar.bz2 gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar.lz gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar.xz gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.tar.zst gsoc2013-evolution-433eac7844481b8ceda0bae8bf08f6bb623185b0.zip |
More code cleanup.
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 6 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-config.c | 2 | ||||
-rw-r--r-- | addressbook/gui/component/e-book-shell-migrate.c | 12 | ||||
-rw-r--r-- | addressbook/gui/component/openldap-extract.h | 50 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 4 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-reflow-adapter.c | 10 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-table-adapter.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 6 | ||||
-rw-r--r-- | addressbook/importers/evolution-csv-importer.c | 8 | ||||
-rw-r--r-- | addressbook/printing/e-contact-print.c | 2 | ||||
-rw-r--r-- | addressbook/util/eab-book-util.c | 2 |
14 files changed, 59 insertions, 59 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 0ae9210bc6..b338bb51ad 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -166,7 +166,7 @@ struct _EAddrConduitCfg { * in UTF-8 format. A conversion must take place before calling * this function (see e_pilot_utf8_to_pchar() in e-pilot-util.c) */ -static int +static gint e_pilot_add_category_if_possible(gchar *cat_to_add, struct CategoryAppInfo *category) { gint i, j; @@ -964,7 +964,7 @@ is_syncable (EAddrConduitContext *ctxt, EAddrLocalRecord *local) if (empty) continue; - for ( ; priority_label[l] != -1; l++) + for (; priority_label[l] != -1; l++) if (phonelabel == priority_label[l]) break; @@ -1267,7 +1267,7 @@ local_record_from_ecard (EAddrLocalRecord *local, EContact *contact, EAddrCondui phone++; } } - for ( ; phone <= entryPhone5; phone++) + for (; phone <= entryPhone5; phone++) local->addr->phoneLabel[phone - entryPhone1] = phone - entryPhone1; local->addr->showPhone = 0; } else { diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c index e753351755..6f62d0ab13 100644 --- a/addressbook/gui/component/addressbook-config.c +++ b/addressbook/gui/component/addressbook-config.c @@ -301,7 +301,7 @@ addressbook_ldap_auth (GtkWidget *window, LDAP *ldap) return ldap_error; } -static int +static gint addressbook_root_dse_query (AddressbookSourceDialog *dialog, LDAP *ldap, const gchar **attrs, LDAPMessage **resp) { diff --git a/addressbook/gui/component/e-book-shell-migrate.c b/addressbook/gui/component/e-book-shell-migrate.c index 4b0b61d186..fce6e0a634 100644 --- a/addressbook/gui/component/e-book-shell-migrate.c +++ b/addressbook/gui/component/e-book-shell-migrate.c @@ -144,7 +144,7 @@ dialog_set_progress (MigrationContext *context, double percent) { gchar text[5]; - snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); + snprintf (text, sizeof (text), "%d%%", (gint) (percent * 100.0f)); gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (context->progress), percent); gtk_progress_bar_set_text (GTK_PROGRESS_BAR (context->progress), text); @@ -188,7 +188,7 @@ get_source_name (ESourceGroup *group, const gchar *path) gboolean conflict; GString *s = g_string_new (""); - for (i = 0; p[i]; i ++) ; + for (i = 0; p[i]; i ++); num_elements = i; i--; @@ -586,7 +586,7 @@ get_string_child (xmlNode *node, return retval; } -static int +static gint get_integer_child (xmlNode *node, const gchar *name, gint defval) @@ -784,7 +784,7 @@ migrate_completion_folders (MigrationContext *context) if the physical_uri is anything else, we strip off the args - (anything after ;) before searching + (anything after;) before searching for the uri. */ if (!strncmp (physical_uri, "file://", 7)) { @@ -1023,9 +1023,9 @@ migrate_pilot_data (const gchar *old_path, const gchar *new_path) ((ext = strrchr (dent, '.')) && !strcmp (ext, ".db")))) { /* src and dest file formats are identical for both map and changelog files */ guchar inbuf[4096]; - size_t nread, nwritten; + gsize nread, nwritten; gint fd0, fd1; - ssize_t n; + gssize n; filename = g_build_filename (old_path, dent, NULL); if ((fd0 = g_open (filename, O_RDONLY | O_BINARY, 0)) == -1) { diff --git a/addressbook/gui/component/openldap-extract.h b/addressbook/gui/component/openldap-extract.h index 630e12e4f6..996bf370a8 100644 --- a/addressbook/gui/component/openldap-extract.h +++ b/addressbook/gui/component/openldap-extract.h @@ -147,7 +147,7 @@ struct token { gchar *sval; }; -static int +static gint get_token( const gchar ** sp, gchar ** token_val ) { gint kind; @@ -743,7 +743,7 @@ ldap_str2objectclass( LDAP_CONST gchar * s, static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr ) { - for( ; *str != '\0'; LDAP_UTF8_INCR(str) ) { + for(; *str != '\0'; LDAP_UTF8_INCR(str) ) { if( ldap_x_utf8_to_ucs4( str ) == ldap_x_utf8_to_ucs4( chr ) ) { return (gchar *) str; } @@ -752,7 +752,7 @@ static gchar *ldap_utf8_strchr( const gchar *str, const gchar *chr ) return NULL; } -static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set ) +static gsize ldap_utf8_strcspn( const gchar *str, const gchar *set ) { const gchar *cstr; const gchar *cset; @@ -768,7 +768,7 @@ static size_t ldap_utf8_strcspn( const gchar *str, const gchar *set ) return cstr - str; } -static size_t ldap_utf8_strspn( const gchar *str, const gchar *set ) +static gsize ldap_utf8_strspn( const gchar *str, const gchar *set ) { const gchar *cstr; const gchar *cset; @@ -843,15 +843,15 @@ static gchar *ldap_utf8_strtok(gchar *str, const gchar *sep, gchar **last) typedef struct ldap_url_desc { struct ldap_url_desc *lud_next; - char *lud_scheme; - char *lud_host; - int lud_port; - char *lud_dn; - char **lud_attrs; - int lud_scope; - char *lud_filter; - char **lud_exts; - int lud_crit_exts; + gchar *lud_scheme; + gchar *lud_host; + gint lud_port; + gchar *lud_dn; + gchar **lud_attrs; + gint lud_scope; + gchar *lud_filter; + gchar **lud_exts; + gint lud_crit_exts; } LDAPURLDesc; /* from url.c */ @@ -979,7 +979,7 @@ ldap_free_urldesc( LDAPURLDesc *ludp ) LDAP_FREE( ludp ); } -static int +static gint ldap_int_unhex( gint c ) { return( c >= '0' && c <= '9' ? c - '0' @@ -994,7 +994,7 @@ ldap_pvt_hex_unescape( gchar *s ) * Remove URL hex escapes from s... done in place. The basic concept for * this routine is borrowed from the WWW library HTUnEscape() routine. */ - char *p; + gchar *p; for ( p = s; *s != '\0'; ++s ) { if ( *s == '%' ) { @@ -1017,10 +1017,10 @@ ldap_pvt_hex_unescape( gchar *s ) static gchar ** ldap_str2charray( const gchar *str_in, const gchar *brkstr ) { - char **res; - char *str, *s; - char *lasts; - int i; + gchar **res; + gchar *str, *s; + gchar *lasts; + gint i; /* protect the input string from strtok */ str = LDAP_STRDUP( str_in ); @@ -1051,7 +1051,7 @@ ldap_str2charray( const gchar *str_in, const gchar *brkstr ) res[i] = LDAP_STRDUP( s ); if(res[i] == NULL) { - for( --i ; i >= 0 ; i-- ) { + for( --i; i >= 0; i-- ) { LDAP_FREE( res[i] ); } LDAP_FREE( res ); @@ -1068,7 +1068,7 @@ ldap_str2charray( const gchar *str_in, const gchar *brkstr ) return( res ); } -static int +static gint ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { /* @@ -1076,8 +1076,8 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) */ LDAPURLDesc *ludp; - char *p, *q, *r; - int i, enclosed; + gchar *p, *q, *r; + gint i, enclosed; const gchar *scheme = NULL; const gchar *url_tmp; gchar *url; @@ -1162,7 +1162,7 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) } if ( q != NULL ) { - char *next; + gchar *next; *q++ = '\0'; ldap_pvt_hex_unescape( q ); @@ -1392,7 +1392,7 @@ ldap_url_parse_ext( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) return LDAP_URL_SUCCESS; } -static int +static gint ldap_url_parse( LDAP_CONST gchar *url_in, LDAPURLDesc **ludpp ) { gint rc = ldap_url_parse_ext( url_in, ludpp ); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 7f3699f834..69d11b0e3c 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -495,7 +495,7 @@ name_to_style (const EContactName *name, const gchar *company, gint style) return string; } -static int +static gint 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")))); @@ -1533,7 +1533,7 @@ fill_in_im (EContactEditor *editor) /* Clear */ - for (record_n = 1 ; record_n <= IM_SLOTS; record_n++) { + for (record_n = 1; record_n <= IM_SLOTS; record_n++) { fill_in_im_record (editor, record_n, -1, NULL, -1); } diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index c8d795b2e8..1be9758627 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -183,7 +183,7 @@ dropdown_changed (GtkWidget *dropdown, dropdown_data *data) return; } -static int +static gint mergeit (EContactMergingLookup *lookup) { GtkWidget *scrolled_window, *label, *hbox, *dropdown; @@ -218,7 +218,7 @@ mergeit (EContactMergingLookup *lookup) num_of_email = g_list_length (email_attr_list); /*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++) { + for(field = E_CONTACT_FULL_NAME; field != (E_CONTACT_LAST_SIMPLE_STRING -1); field++) { dropdown_data *data = NULL; string = (gchar *)e_contact_get_const (lookup->contact, field); string1 = (gchar *)e_contact_get_const (lookup->match, field); @@ -369,7 +369,7 @@ check_if_same (EContact *contact, EContact *match) 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++) { + 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); num_of_email = g_list_length (email_attr_list); diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index fd1681c5b1..dbcc1c1ed2 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -98,7 +98,7 @@ unlink_model(EAddressbookReflowAdapter *adapter) } -static int +static gint text_height (PangoLayout *layout, const gchar *text) { gint height; @@ -124,7 +124,7 @@ addressbook_set_width (EReflowModel *erm, gint width) } /* This function returns the number of items in our EReflowModel. */ -static int +static gint addressbook_count (EReflowModel *erm) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); @@ -134,7 +134,7 @@ addressbook_count (EReflowModel *erm) } /* This function returns the height of the minicontact in question */ -static int +static gint addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); @@ -180,7 +180,7 @@ addressbook_height (EReflowModel *erm, gint i, GnomeCanvasGroup *parent) return height; } -static int +static gint addressbook_compare (EReflowModel *erm, gint n1, gint n2) { EAddressbookReflowAdapter *adapter = E_ADDRESSBOOK_REFLOW_ADAPTER(erm); @@ -222,7 +222,7 @@ addressbook_compare (EReflowModel *erm, gint n1, gint n2) } } -static int +static gint adapter_drag_begin (EMinicard *card, GdkEvent *event, EAddressbookReflowAdapter *adapter) { gint ret_val = 0; diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index cb63c67809..fabf87f24f 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -87,14 +87,14 @@ addressbook_dispose(GObject *object) } /* This function returns the number of columns in our ETableModel. */ -static int +static gint addressbook_col_count (ETableModel *etc) { return COLS; } /* This function returns the number of rows in our ETableModel. */ -static int +static gint addressbook_row_count (ETableModel *etc) { EAddressbookTableAdapter *adapter = EAB_TABLE_ADAPTER(etc); diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index e8b9c5db5a..ece8d84654 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -126,7 +126,7 @@ clear_drag_data (EMinicardView *view) view->drag_list = NULL; } -static int +static gint e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, GdkEvent *event, EMinicardView *view) { GdkDragContext *context; @@ -475,7 +475,7 @@ do_remove (gint i, gpointer user_data) } #if 0 -static int +static gint compare_to_utf_str (EMinicard *card, const gchar *utf_str) { g_return_val_if_fail(card != NULL, 0); diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index c446e1affa..2d9deeecbc 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -875,7 +875,7 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, g g_list_free (emails); } -static int +static gint get_left_width (EMinicard *e_minicard, gboolean is_list) { gchar *name; diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 0b3e122846..a75c06daff 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -783,8 +783,8 @@ eab_contact_display_render_compact (EABContactDisplay *display, max_dimension = calced_height; if (max_dimension > MAX_COMPACT_IMAGE_DIMENSION) { - calced_width *= ((float)MAX_COMPACT_IMAGE_DIMENSION / max_dimension); - calced_height *= ((float)MAX_COMPACT_IMAGE_DIMENSION / max_dimension); + calced_width *= ((gfloat)MAX_COMPACT_IMAGE_DIMENSION / max_dimension); + calced_height *= ((gfloat)MAX_COMPACT_IMAGE_DIMENSION / max_dimension); } } @@ -891,7 +891,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, gtk_html_end (GTK_HTML (display), html_stream, GTK_HTML_STREAM_OK); } -static int +static gint contact_display_button_press_event (GtkWidget *widget, GdkEvent *event, EABContactDisplay *display) diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 0456f81b19..9cce21d548 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -570,12 +570,12 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { line = g_string_new(""); while (1) { - c = fgetc (f) ; + c = fgetc (f); if (c == EOF) return NULL; if (c == '\n') { g_string_append_c (line, c); - break ; + break; } if (c == '"') { g_string_append_c (line, c); @@ -594,12 +594,12 @@ getNextCSVEntry(CSVImporter *gci, FILE *f) { g_string_free (line, TRUE); line = g_string_new(""); while (1) { - c = fgetc (f) ; + c = fgetc (f); if (c == EOF) return NULL; if (c == '\n') { g_string_append_c (line, c); - break ; + break; } if (c == '"') { g_string_append_c (line, c); diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 6c6710a479..cc55b97769 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -298,7 +298,7 @@ e_contact_start_new_column (EContactPrintContext *ctxt) } } -static int +static gint contact_compare (EContact *contact1, EContact *contact2) { const gchar *field1, *field2; diff --git a/addressbook/util/eab-book-util.c b/addressbook/util/eab-book-util.c index ec8fccb5ba..b3450a29cf 100644 --- a/addressbook/util/eab-book-util.c +++ b/addressbook/util/eab-book-util.c @@ -104,7 +104,7 @@ eab_name_and_email_query (EBook *book, while (*t && *t != '@') ++t; if (*t == '@' && escaped_name) { - email_query = g_strdup_printf ("(beginswith \"email\" \"%.*s@\")", (int)(t-escaped_email), escaped_email); + email_query = g_strdup_printf ("(beginswith \"email\" \"%.*s@\")", (gint)(t-escaped_email), escaped_email); } else { email_query = g_strdup_printf ("(beginswith \"email\" \"%s\")", escaped_email); |