diff options
author | Kjartan Maraas <kmaraas@gnome.org> | 2007-10-24 22:11:25 +0800 |
---|---|---|
committer | Kjartan Maraas <kmaraas@src.gnome.org> | 2007-10-24 22:11:25 +0800 |
commit | faae84477af9ba732358930d7d6ba57f16c4a6df (patch) | |
tree | 236ae64f47381d5e713fcaf81a981944f1a5d150 /addressbook/gui | |
parent | a1fb36c15210deac4ca989703587060c549c6e51 (diff) | |
download | gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.gz gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.bz2 gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.lz gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.xz gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.tar.zst gsoc2013-evolution-faae84477af9ba732358930d7d6ba57f16c4a6df.zip |
Warning fixes: - mixing code and declarations - NULL vs 0 vs FALSE/TRUE -
2007-10-23 Kjartan Maraas <kmaraas@gnome.org>
* gui/contact-editor/e-contact-editor-address.c:
* gui/contact-editor/e-contact-editor-fullname.c:
* gui/contact-editor/e-contact-editor-im.c:
* gui/contact-editor/e-contact-editor.c: (save_contact),
(app_delete_event_cb), (e_contact_editor_set_property),
(e_contact_editor_create_date):
* gui/contact-list-editor/e-contact-list-model.c:
(e_contact_list_model_new):
* gui/merging/eab-contact-merging.c: (mergeit), (response):
* gui/widgets/e-minicard.c: (e_minicard_event), (add_field),
(get_email_location), (add_email_field), (remodel),
(e_minicard_reflow), (e_minicard_compare):
* gui/widgets/eab-config.c: (eab_config_new):
* gui/widgets/eab-gui-util.c: (eab_load_error_dialog),
(file_exists), (save_it), (contact_added_cb),
(eab_send_to_contact_and_email_num_list):
* gui/widgets/eab-menu.c: (eab_menu_new):
* gui/widgets/eab-popup.c: (eab_popup_new):
* importers/evolution-csv-importer.c: (parseLine),
(getNextCSVEntry):
* printing/e-contact-print-style-editor.c:
* printing/test-contact-print-style-editor.c:
* printing/test-print.c:
* util/eab-book-util.c: (eab_get_config_database):
Warning fixes:
- mixing code and declarations
- NULL vs 0 vs FALSE/TRUE
- mark code static
- some coding style fixes
- if vs ifdef
- Remove some unused bits
- ANSIfication of declarations
svn path=/trunk/; revision=34421
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor-address.c | 2 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor-fullname.c | 2 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor-im.c | 2 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 18 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-model.c | 2 | ||||
-rw-r--r-- | addressbook/gui/merging/eab-contact-merging.c | 4 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 23 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-config.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-gui-util.c | 2 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-menu.c | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-popup.c | 12 |
11 files changed, 41 insertions, 38 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c index b3cd0880e0..06e79d61d6 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-address.c +++ b/addressbook/gui/contact-editor/e-contact-editor-address.c @@ -463,7 +463,7 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address) } } -void +static void e_contact_editor_address_dispose (GObject *object) { EContactEditorAddress *e_contact_editor_address = E_CONTACT_EDITOR_ADDRESS(object); diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 25aa8a6f14..daaffd01de 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -148,7 +148,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam } } -void +static void e_contact_editor_fullname_dispose (GObject *object) { EContactEditorFullname *e_contact_editor_fullname = E_CONTACT_EDITOR_FULLNAME(object); diff --git a/addressbook/gui/contact-editor/e-contact-editor-im.c b/addressbook/gui/contact-editor/e-contact-editor-im.c index c6bc9d951b..93e6da7cae 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-im.c +++ b/addressbook/gui/contact-editor/e-contact-editor-im.c @@ -297,7 +297,7 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im) } } -void +static void e_contact_editor_im_dispose (GObject *object) { EContactEditorIm *e_contact_editor_im = E_CONTACT_EDITOR_IM(object); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 20a48a511d..d5dc2bae53 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2980,7 +2980,9 @@ static void save_contact (EContactEditor *ce, gboolean should_close) { char *uid; - + const char *name_entry_string, *file_as_entry_string, *company_name_string; + GtkWidget *entry_fullname, *entry_file_as, *company_name; + if (!ce->target_book) return; @@ -2990,12 +2992,12 @@ save_contact (EContactEditor *ce, gboolean should_close) return; } - GtkWidget *entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); - GtkWidget *entry_file_as = glade_xml_get_widget (ce->gui, "entry-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)); + entry_fullname = glade_xml_get_widget (ce->gui, "entry-fullname" ); + entry_file_as = glade_xml_get_widget (ce->gui, "entry-file-as"); + company_name = glade_xml_get_widget (ce->gui, "entry-company"); + name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); + file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); + company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); if (strcmp (company_name_string , "")) { if (!strcmp (name_entry_string, "")) @@ -3388,7 +3390,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) gtk_widget_show (e_contact_editor->app); } -void +static void e_contact_editor_dispose (GObject *object) { EContactEditor *e_contact_editor = E_CONTACT_EDITOR(object); diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c index c75bbb95d7..d0597e9eea 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-model.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c @@ -162,7 +162,7 @@ e_contact_list_model_construct (EContactListModel *model) } ETableModel * -e_contact_list_model_new () +e_contact_list_model_new (void) { EContactListModel *model; diff --git a/addressbook/gui/merging/eab-contact-merging.c b/addressbook/gui/merging/eab-contact-merging.c index 446868643c..a37f877fd8 100644 --- a/addressbook/gui/merging/eab-contact-merging.c +++ b/addressbook/gui/merging/eab-contact-merging.c @@ -185,7 +185,7 @@ mergeit (EContactMergingLookup *lookup) int num_of_email; GList *email_attr_list; int row = -1; - int value = 0; + int value = 0, result; dialog = (GtkDialog *)(gtk_dialog_new_with_buttons (_("Merge Contact"), NULL, GTK_DIALOG_NO_SEPARATOR, NULL)); gtk_container_border_width (GTK_CONTAINER(dialog), 5); @@ -332,7 +332,7 @@ mergeit (EContactMergingLookup *lookup) gtk_widget_show (scrolled_window); g_signal_connect (dialog, "map-event", G_CALLBACK (dialog_map), table); gtk_widget_show_all ((GtkWidget *)table); - gint result = gtk_dialog_run (dialog); + result = gtk_dialog_run (dialog); switch (result) { diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 216401a69f..7132389379 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -738,7 +738,7 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event) return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event); else - return 0; + return FALSE; } static void @@ -1021,28 +1021,29 @@ remodel( EMinicard *e_minicard ) } static void -e_minicard_reflow( GnomeCanvasItem *item, int flags ) +e_minicard_reflow(GnomeCanvasItem *item, int flags) { EMinicard *e_minicard = E_MINICARD(item); - if ( GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED ) { + if (GTK_OBJECT_FLAGS (e_minicard) & GNOME_CANVAS_ITEM_REALIZED) { GList *list; gdouble text_height; gint old_height; old_height = e_minicard->height; - g_object_get( e_minicard->header_text, + g_object_get(e_minicard->header_text, "text_height", &text_height, - NULL ); + NULL); e_minicard->height = text_height + 10.0; - gnome_canvas_item_set( e_minicard->header_rect, + gnome_canvas_item_set(e_minicard->header_rect, "y2", text_height + 9.0, - NULL ); + NULL); for(list = e_minicard->fields; list; list = g_list_next(list)) { EMinicardField *field = E_MINICARD_FIELD(list->data); + /* Why not use the item that is passed in? */ GnomeCanvasItem *item = field->label; g_object_get (item, "height", &text_height, @@ -1052,13 +1053,13 @@ e_minicard_reflow( GnomeCanvasItem *item, int flags ) } e_minicard->height += 2; - gnome_canvas_item_set( e_minicard->rect, + gnome_canvas_item_set(e_minicard->rect, "x2", (double) e_minicard->width - 1.0, "y2", (double) e_minicard->height - 1.0, - NULL ); - gnome_canvas_item_set( e_minicard->header_rect, + NULL); + gnome_canvas_item_set(e_minicard->header_rect, "x2", (double) e_minicard->width - 3.0, - NULL ); + NULL); if (old_height != e_minicard->height) e_canvas_item_request_parent_reflow(item); diff --git a/addressbook/gui/widgets/eab-config.c b/addressbook/gui/widgets/eab-config.c index ee95ea3582..967ef370b7 100644 --- a/addressbook/gui/widgets/eab-config.c +++ b/addressbook/gui/widgets/eab-config.c @@ -127,7 +127,7 @@ eab_config_get_type (void) EABConfig * eab_config_new (int type, const char *menuid) { - EABConfig *ecp = g_object_new (eab_config_get_type(), 0); + EABConfig *ecp = g_object_new (eab_config_get_type(), NULL); e_config_construct (&ecp->config, type, menuid); return ecp; } @@ -144,12 +144,12 @@ eab_config_target_new_source (EABConfig *ecp, struct _ESource *source) } static const EConfigHookTargetMask ecph_no_masks[] = { - { 0 } + { NULL } }; static const EConfigHookTargetMap ecph_targets[] = { { "source", EAB_CONFIG_TARGET_SOURCE, ecph_no_masks }, - { 0 }, + { NULL }, }; static void diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index dba4653f87..f7ed275698 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -108,7 +108,7 @@ eab_load_error_dialog (GtkWidget *parent, ESource *source, EBookStatus status) } else if (!strncmp (uri, "ldap:", 5)) { /* special case for ldap: contact folders so we can tell the user about openldap */ -#if HAVE_LDAP +#ifdef HAVE_LDAP label_string = _("We were unable to open this addressbook. This either " "means you have entered an incorrect URI, or the LDAP server " diff --git a/addressbook/gui/widgets/eab-menu.c b/addressbook/gui/widgets/eab-menu.c index 9b8e912642..c35cd6ba61 100644 --- a/addressbook/gui/widgets/eab-menu.c +++ b/addressbook/gui/widgets/eab-menu.c @@ -100,7 +100,7 @@ eab_menu_get_type(void) EABMenu *eab_menu_new(const char *menuid) { - EABMenu *emp = g_object_new(eab_menu_get_type(), 0); + EABMenu *emp = g_object_new(eab_menu_get_type(), NULL); e_menu_construct(&emp->menu, menuid); @@ -208,12 +208,12 @@ static const EMenuHookTargetMask eabmph_select_masks[] = { { "any", EAB_MENU_SELECT_ANY }, { "editable", EAB_MENU_SELECT_EDITABLE }, { "email", EAB_MENU_SELECT_EMAIL }, - { 0 } + { NULL } }; static const EMenuHookTargetMap eabmph_targets[] = { { "select", EAB_MENU_TARGET_SELECT, eabmph_select_masks }, - { 0 } + { NULL } }; static void diff --git a/addressbook/gui/widgets/eab-popup.c b/addressbook/gui/widgets/eab-popup.c index 59a64cd549..d37c1b7b73 100644 --- a/addressbook/gui/widgets/eab-popup.c +++ b/addressbook/gui/widgets/eab-popup.c @@ -116,7 +116,7 @@ eab_popup_get_type(void) EABPopup *eab_popup_new(const char *menuid) { - EABPopup *eabp = g_object_new(eab_popup_get_type(), 0); + EABPopup *eabp = g_object_new(eab_popup_get_type(), NULL); e_popup_construct(&eabp->popup, menuid); @@ -298,24 +298,24 @@ static const EPopupHookTargetMask eabph_select_masks[] = { { "any", EAB_POPUP_SELECT_ANY }, { "editable", EAB_POPUP_SELECT_EDITABLE }, { "email", EAB_POPUP_SELECT_EMAIL }, - { 0 } + { NULL } }; static const EPopupHookTargetMask eabph_source_masks[] = { { "primary", EAB_POPUP_SOURCE_PRIMARY }, { "system", EAB_POPUP_SOURCE_SYSTEM }, - { 0 } + { NULL } }; static const EPopupHookTargetMask eabph_uri_masks[] = { { "http", EAB_POPUP_URI_HTTP }, { "internal-mailto", EAB_POPUP_URI_MAILTO }, { "notmailto", EAB_POPUP_URI_NOT_MAILTO }, - { 0 } + { NULL } }; static const EPopupHookTargetMask eabph_select_names_masks[] = { - { 0 } + { NULL } }; static const EPopupHookTargetMap eabph_targets[] = { @@ -323,7 +323,7 @@ static const EPopupHookTargetMap eabph_targets[] = { { "uri", EAB_POPUP_TARGET_URI, eabph_uri_masks }, { "source", EAB_POPUP_TARGET_SOURCE, eabph_source_masks }, { "select-names", EAB_POPUP_TARGET_SELECT_NAMES, eabph_select_names_masks }, - { 0 } + { NULL } }; static void |