From 19993ca2f036d7dbea66f6ed02e2d4740f0659f9 Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Mon, 29 Oct 2007 13:05:42 +0000 Subject: Warning fixes: - NULL vs. 0 vs FALSE - ANSIfication of function 2007-10-26 Kjartan Maraas * e-searching-tokenizer.c: (build_trie), (searcher_new), (output_token), (output_match), (merge_subpending), (searcher_next_token): * em-account-editor.c: (em_account_editor_new), (emae_load_text), (emae_check_license), (emae_auto_detect), (smime_sign_key_select), (smime_encrypt_key_select), (emae_service_url_path_changed), (emae_ssl_changed), (emae_service_provider_changed), (emae_refresh_providers), (emae_refresh_authtype), (emae_setup_service), (emae_identity_page): * em-composer-utils.c: (em_utils_send_receipt), (generate_account_hash), (em_utils_camel_address_to_destination), (reply_get_composer): * em-config.c: (em_config_new): * em-event.c: (em_event_peek): * em-filter-rule.c: (get_widget): * em-folder-browser.c: (generate_viewoption_menu), (em_folder_browser_show_preview), (get_view_query), (vfolder_setup_do), (emfb_search_search_activated), (emfb_list_key_press), (emfb_list_built): * em-folder-view.c: (em_folder_view_new), (emfv_setup_view_instance), (emfv_popup_forward), (emp_uri_popup_vfolder_sender), (emp_uri_popup_vfolder_recipient), (emfv_enable_menus): * em-format-hook.c: * em-format-html-display.c: (efhd_attachment_optional): * em-format-html.c: (em_format_html_new), (em_format_html_add_pobject), (em_format_html_find_pobject), (em_format_html_find_pobject_func), (efh_text_enriched), (efh_multipart_related), (efh_format_address), (efh_format_header): * em-icon-stream.h: * em-inline-filter.c: (emif_add_part), (emif_scan): * em-junk-hook.c: (emjh_construct_group): * em-mailer-prefs.c: (junk_plugin_setup): * em-menu.c: (em_menu_new), (em_menu_target_new_select): * em-message-browser.c: (em_message_browser_new): * em-popup.c: (em_popup_new), (em_popup_target_new_select): * em-sync-stream.c: * em-utils.c: (em_utils_save_part_to_file), (tag_editor_response), (em_utils_read_messages_from_stream), (em_utils_get_proxy_uri), (em_utils_in_addressbook): * em-vfolder-rule.c: (validate): * importers/elm-importer.c: * importers/mail-importer.c: (import_mbox_import), (import_folders_rec): * importers/pine-importer.c: * mail-component.c: (setline_done): * mail-folder-cache.c: (flush_updates): * mail-mt.c: (mail_msg_new), (checkmem), (mail_msg_check_error), (mail_msg_cancel), (mail_msg_wait), (mail_msg_init), (do_op_status): * mail-send-recv.c: (receive_status), (receive_done), (refresh_folders_get): * mail-vfolder.c: (mail_vfolder_get_sources_local), (mail_vfolder_get_sources_remote), (context_rule_added), (store_folder_renamed): * message-list.c: (e_mail_address_new), (e_mail_address_compare), (get_normalised_string), (ml_search_forward), (ml_search_backward), (ml_search_path), (message_list_select_uid), (thread_select_foreach), (message_list_copy), (ml_duplicate_value), (ml_free_value), (ml_initialize_value), (ml_value_is_empty), (ml_value_to_string), (subtree_latest), (sanitize_recipients), (ml_tree_value_at), (ml_tree_sort_value_at), (message_list_init_images), (filter_date), (build_tree), (build_flat_diff), (regen_list_regen): Warning fixes: - NULL vs. 0 vs FALSE - ANSIfication of function declarations - Remove unused bits - use unsigned ints for 1-bit bitfields - invalid pointer type - mark a global var static - mixing code and declarations svn path=/trunk/; revision=34449 --- mail/ChangeLog | 76 ++++++++++++++++++++++++++++++++++++++++++ mail/e-searching-tokenizer.c | 4 +-- mail/em-account-editor.c | 2 +- mail/em-composer-utils.c | 2 +- mail/em-config.c | 6 ++-- mail/em-event.c | 12 +++---- mail/em-filter-rule.c | 3 +- mail/em-folder-browser.c | 2 +- mail/em-folder-view.c | 2 +- mail/em-format-hook.c | 2 +- mail/em-format-html-display.c | 34 +++++++++---------- mail/em-format-html.c | 2 +- mail/em-icon-stream.h | 2 +- mail/em-inline-filter.c | 2 +- mail/em-junk-hook.c | 2 +- mail/em-menu.c | 8 ++--- mail/em-message-browser.c | 2 +- mail/em-popup.c | 16 ++++----- mail/em-sync-stream.c | 2 +- mail/em-utils.c | 12 +++---- mail/em-vfolder-rule.c | 4 +-- mail/importers/elm-importer.c | 2 +- mail/importers/mail-importer.c | 4 +-- mail/importers/pine-importer.c | 2 +- mail/mail-component.c | 2 +- mail/mail-folder-cache.c | 2 +- mail/mail-mt.c | 14 ++++---- mail/mail-send-recv.c | 2 +- mail/mail-session.c | 2 +- mail/mail-vfolder.c | 4 +-- mail/message-list.c | 10 +++--- 31 files changed, 158 insertions(+), 83 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 46f79d43f5..bd82fd79b8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,79 @@ +2007-10-26 Kjartan Maraas + + * e-searching-tokenizer.c: (build_trie), (searcher_new), + (output_token), (output_match), (merge_subpending), + (searcher_next_token): + * em-account-editor.c: (em_account_editor_new), (emae_load_text), + (emae_check_license), (emae_auto_detect), (smime_sign_key_select), + (smime_encrypt_key_select), (emae_service_url_path_changed), + (emae_ssl_changed), (emae_service_provider_changed), + (emae_refresh_providers), (emae_refresh_authtype), + (emae_setup_service), (emae_identity_page): + * em-composer-utils.c: (em_utils_send_receipt), + (generate_account_hash), (em_utils_camel_address_to_destination), + (reply_get_composer): + * em-config.c: (em_config_new): + * em-event.c: (em_event_peek): + * em-filter-rule.c: (get_widget): + * em-folder-browser.c: (generate_viewoption_menu), + (em_folder_browser_show_preview), (get_view_query), + (vfolder_setup_do), (emfb_search_search_activated), + (emfb_list_key_press), (emfb_list_built): + * em-folder-view.c: (em_folder_view_new), + (emfv_setup_view_instance), (emfv_popup_forward), + (emp_uri_popup_vfolder_sender), (emp_uri_popup_vfolder_recipient), + (emfv_enable_menus): + * em-format-hook.c: + * em-format-html-display.c: (efhd_attachment_optional): + * em-format-html.c: (em_format_html_new), + (em_format_html_add_pobject), (em_format_html_find_pobject), + (em_format_html_find_pobject_func), (efh_text_enriched), + (efh_multipart_related), (efh_format_address), (efh_format_header): + * em-icon-stream.h: + * em-inline-filter.c: (emif_add_part), (emif_scan): + * em-junk-hook.c: (emjh_construct_group): + * em-mailer-prefs.c: (junk_plugin_setup): + * em-menu.c: (em_menu_new), (em_menu_target_new_select): + * em-message-browser.c: (em_message_browser_new): + * em-popup.c: (em_popup_new), (em_popup_target_new_select): + * em-sync-stream.c: + * em-utils.c: (em_utils_save_part_to_file), (tag_editor_response), + (em_utils_read_messages_from_stream), (em_utils_get_proxy_uri), + (em_utils_in_addressbook): + * em-vfolder-rule.c: (validate): + * importers/elm-importer.c: + * importers/mail-importer.c: (import_mbox_import), + (import_folders_rec): + * importers/pine-importer.c: + * mail-component.c: (setline_done): + * mail-folder-cache.c: (flush_updates): + * mail-mt.c: (mail_msg_new), (checkmem), (mail_msg_check_error), + (mail_msg_cancel), (mail_msg_wait), (mail_msg_init), + (do_op_status): + * mail-send-recv.c: (receive_status), (receive_done), + (refresh_folders_get): + * mail-vfolder.c: (mail_vfolder_get_sources_local), + (mail_vfolder_get_sources_remote), (context_rule_added), + (store_folder_renamed): + * message-list.c: (e_mail_address_new), (e_mail_address_compare), + (get_normalised_string), (ml_search_forward), (ml_search_backward), + (ml_search_path), (message_list_select_uid), + (thread_select_foreach), (message_list_copy), (ml_duplicate_value), + (ml_free_value), (ml_initialize_value), (ml_value_is_empty), + (ml_value_to_string), (subtree_latest), (sanitize_recipients), + (ml_tree_value_at), (ml_tree_sort_value_at), + (message_list_init_images), (filter_date), (build_tree), + (build_flat_diff), (regen_list_regen): + + Warning fixes: + - NULL vs. 0 vs FALSE + - ANSIfication of function declarations + - Remove unused bits + - use unsigned ints for 1-bit bitfields + - invalid pointer type + - mark a global var static + - mixing code and declarations + 2007-10-26 Milan Crha ** Fix for bug #489027 diff --git a/mail/e-searching-tokenizer.c b/mail/e-searching-tokenizer.c index 9cbb71a09d..9b508280e2 100644 --- a/mail/e-searching-tokenizer.c +++ b/mail/e-searching-tokenizer.c @@ -312,7 +312,7 @@ build_trie(int nocase, int len, unsigned char **words) state_depth = g_realloc(state_depth, sizeof(*state_depth[0])*state_depth_max); } if (state_depth_size < depth) { - state_depth[depth] = 0; + state_depth[depth] = NULL; state_depth_size = depth; } q->next = state_depth[depth]; @@ -456,7 +456,7 @@ searcher_new (int flags, int argc, unsigned char **argv, const char *tags, const e_dlist_init(&s->input); e_dlist_init(&s->output); - s->current = 0; + s->current = NULL; s->offset = 0; s->offout = 0; diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 5570c26989..d748750bde 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -286,7 +286,7 @@ em_account_editor_get_type(void) **/ EMAccountEditor *em_account_editor_new(EAccount *account, em_account_editor_t type, char *id) { - EMAccountEditor *emae = g_object_new(em_account_editor_get_type(), 0); + EMAccountEditor *emae = g_object_new(em_account_editor_get_type(), NULL); em_account_editor_construct(emae, account, type, id); diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index c9519d9fdb..ab3e6c7812 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1300,7 +1300,7 @@ em_utils_send_receipt (CamelFolder *folder, CamelMimeMessage *message) out_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_OUTBOX); info = camel_message_info_new (NULL); camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); - mail_append_mail (out_folder, receipt, info, em_utils_receipt_done, 0); + mail_append_mail (out_folder, receipt, info, em_utils_receipt_done, NULL); } /* Replying to messages... */ diff --git a/mail/em-config.c b/mail/em-config.c index a1f25a5a3a..ef3f793563 100644 --- a/mail/em-config.c +++ b/mail/em-config.c @@ -195,7 +195,7 @@ em_config_get_type(void) EMConfig *em_config_new(int type, const char *menuid) { - EMConfig *emp = g_object_new(em_config_get_type(), 0); + EMConfig *emp = g_object_new(em_config_get_type(), NULL); e_config_construct(&emp->config, type, menuid); @@ -270,14 +270,14 @@ static void *emph_parent_class; #define emph ((EMConfigHook *)eph) static const EConfigHookTargetMask emph_no_masks[] = { - { 0 } + { NULL } }; static const EConfigHookTargetMap emph_targets[] = { { "folder", EM_CONFIG_TARGET_FOLDER, emph_no_masks }, { "prefs", EM_CONFIG_TARGET_PREFS, emph_no_masks }, { "account", EM_CONFIG_TARGET_ACCOUNT, emph_no_masks }, - { 0 } + { NULL } }; static void diff --git a/mail/em-event.c b/mail/em-event.c index 148db1cf9b..a690c25763 100644 --- a/mail/em-event.c +++ b/mail/em-event.c @@ -128,7 +128,7 @@ em_event_get_type(void) EMEvent *em_event_peek(void) { if (em_event == NULL) { - em_event = g_object_new(em_event_get_type(), 0); + em_event = g_object_new(em_event_get_type(), NULL); e_event_construct(&em_event->popup, "org.gnome.evolution.mail.events"); } @@ -196,23 +196,23 @@ static void *emeh_parent_class; static const EEventHookTargetMask emeh_folder_masks[] = { { "newmail", EM_EVENT_FOLDER_NEWMAIL }, - { 0 } + { NULL } }; static const EEventHookTargetMask emeh_composer_masks[] = { { "sendoption", EM_EVENT_COMPOSER_SEND_OPTION }, - { 0 } + { NULL } }; static const EEventHookTargetMask emeh_message_masks[] = { { "replyall", EM_EVENT_MESSAGE_REPLY_ALL }, - { 0 } + { NULL } }; static const EEventHookTargetMask emeh_send_receive_masks[] = { { "sendreceive", EM_EVENT_SEND_RECEIVE }, - { 0 } + { NULL } }; static const EEventHookTargetMap emeh_targets[] = { @@ -220,7 +220,7 @@ static const EEventHookTargetMap emeh_targets[] = { { "message", EM_EVENT_TARGET_MESSAGE, emeh_message_masks }, { "composer", EM_EVENT_TARGET_COMPOSER, emeh_composer_masks}, { "sendreceive", EM_EVENT_TARGET_SEND_RECEIVE, emeh_send_receive_masks}, - { 0 } + { NULL } }; static void diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 335f402cc9..1815e0dcdb 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -481,11 +481,12 @@ get_widget(FilterRule *fr, RuleContext *rc) struct _rule_data *data; EMFilterRule *ff =(EMFilterRule *)fr; int rows, i = 0; + gchar *msg; widget = FILTER_RULE_CLASS(parent_class)->get_widget(fr, rc); /* and now for the action area */ - gchar * msg = g_strdup_printf("%s", _("Then")); + msg = g_strdup_printf("%s", _("Then")); label = gtk_label_new(msg); gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index 4cb10acae4..28fb4ae19a 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -122,7 +122,7 @@ struct _EMFolderBrowserPrivate { char *select_uid; guint folder_changed_id; - int show_wide:1; + guint show_wide:1; gboolean scope_restricted; EMMenu *menu; /* toplevel menu manager */ diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 87249e7f7b..0a8171e14b 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -464,7 +464,7 @@ em_folder_view_get_type(void) GtkWidget *em_folder_view_new(void) { - EMFolderView *emfv = g_object_new(em_folder_view_get_type(), 0); + EMFolderView *emfv = g_object_new(em_folder_view_get_type(), NULL); return (GtkWidget *)emfv; } diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c index be63366742..019c409b97 100644 --- a/mail/em-format-hook.c +++ b/mail/em-format-hook.c @@ -62,7 +62,7 @@ static void *emfh_parent_class; static const EPluginHookTargetKey emfh_flag_map[] = { { "inline", EM_FORMAT_HANDLER_INLINE }, { "inline_disposition", EM_FORMAT_HANDLER_INLINE_DISPOSITION }, - { 0 } + { NULL } }; static void diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index c5a5347fdb..036cf570e3 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -2470,7 +2470,7 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb struct _attach_puri *info; GtkWidget *hbox, *vbox, *button, *mainbox, *scroll, *label, *img; AtkObject *a11y; - GtkTextView *view; + GtkWidget *view; GtkTextBuffer *buffer; /* FIXME: handle default shown case */ @@ -2490,27 +2490,27 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb img = e_icon_factory_get_image ("stock_show-all", E_ICON_SIZE_BUTTON); label = gtk_label_new_with_mnemonic(_("View _Unformatted")); g_object_set_data (G_OBJECT (button), "text-label", (gpointer)label); - gtk_box_pack_start ((GtkBox *)hbox, img, TRUE, TRUE, 2); - gtk_box_pack_start ((GtkBox *)hbox, label, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), img, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 2); gtk_widget_show_all (hbox); gtk_container_add (GTK_CONTAINER (button), GTK_WIDGET (hbox)); if (info->handle) - g_signal_connect(button, "clicked", G_CALLBACK(efhd_optional_button_show), scroll); + g_signal_connect(G_OBJECT (button), "clicked", G_CALLBACK(efhd_optional_button_show), scroll); else { gtk_widget_set_sensitive(button, FALSE); GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); } vbox = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start((GtkBox *)mainbox, button, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX (mainbox), button, FALSE, FALSE, 6); button = gtk_button_new(); hbox = gtk_hbox_new (FALSE, 0); img = e_icon_factory_get_image ("stock_open", E_ICON_SIZE_BUTTON); label = gtk_label_new_with_mnemonic(_("O_pen With")); - gtk_box_pack_start ((GtkBox *)hbox, img, TRUE, TRUE, 2); - gtk_box_pack_start ((GtkBox *)hbox, label, TRUE, TRUE, 2); - gtk_box_pack_start ((GtkBox *)hbox, gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE), TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), img, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE), TRUE, TRUE, 2); gtk_widget_show_all (hbox); gtk_container_add (GTK_CONTAINER (button), GTK_WIDGET (hbox)); @@ -2520,16 +2520,16 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb g_signal_connect(button, "button_press_event", G_CALLBACK(efhd_attachment_popup), info); g_signal_connect(button, "popup_menu", G_CALLBACK(efhd_attachment_popup_menu), info); g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_popup_menu), info); - gtk_box_pack_start((GtkBox *)mainbox, button, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX (mainbox), button, FALSE, FALSE, 6); gtk_widget_show_all(mainbox); - gtk_box_pack_start((GtkBox *)vbox, mainbox, FALSE, FALSE, 6); + gtk_box_pack_start(GTK_BOX (vbox), mainbox, FALSE, FALSE, 6); - view = (GtkTextView *)gtk_text_view_new (); - gtk_text_view_set_editable (view, FALSE); - gtk_text_view_set_cursor_visible (view, FALSE); - buffer = gtk_text_view_get_buffer(view); + view = gtk_text_view_new (); + gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE); + gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); + buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW (view)); gtk_text_buffer_set_text (buffer, (char *)info->mstream->buffer->data, info->mstream->buffer->len); camel_object_unref(info->mstream); info->mstream = NULL; @@ -2537,10 +2537,10 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (view)); - gtk_box_pack_start((GtkBox *)vbox, scroll, TRUE, TRUE, 6); + gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 6); gtk_widget_show (GTK_WIDGET(view)); - gtk_widget_set_size_request (scroll, ((GtkWidget *)efh->html)->allocation.width-48, 250); + gtk_widget_set_size_request (scroll, (GTK_WIDGET (efh->html))->allocation.width - 48, 250); g_signal_connect (scroll, "size_allocate", G_CALLBACK(efhd_resize), efh); gtk_widget_show (scroll); @@ -2548,7 +2548,7 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb gtk_widget_hide (scroll); gtk_widget_show (vbox); - gtk_container_add((GtkContainer *)eb, vbox); + gtk_container_add(GTK_CONTAINER (eb), vbox); info->handle = NULL; return TRUE; diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 9a1cdf6efe..400cf5fad5 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -277,7 +277,7 @@ EMFormatHTML *em_format_html_new(void) { EMFormatHTML *efh; - efh = g_object_new(em_format_html_get_type(), 0); + efh = g_object_new(em_format_html_get_type(), NULL); return efh; } diff --git a/mail/em-icon-stream.h b/mail/em-icon-stream.h index f97552609b..03663b5051 100644 --- a/mail/em-icon-stream.h +++ b/mail/em-icon-stream.h @@ -47,7 +47,7 @@ typedef struct _EMIconStream { struct _GtkImage *image; char *key; - int keep:1; + guint keep:1; } EMIconStream; typedef struct { diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c index 32e9bbf487..79300b33bc 100644 --- a/mail/em-inline-filter.c +++ b/mail/em-inline-filter.c @@ -109,7 +109,7 @@ static const struct { const char *type; const char *subtype; CamelTransferEncoding encoding; - int plain:1; + guint plain:1; } emif_types[] = { { "text", "plain", CAMEL_TRANSFER_ENCODING_DEFAULT, 1, }, { "application", "octet-stream", CAMEL_TRANSFER_ENCODING_UUENCODE, 0, }, diff --git a/mail/em-junk-hook.c b/mail/em-junk-hook.c index dcf5f519ea..7c081fcf94 100644 --- a/mail/em-junk-hook.c +++ b/mail/em-junk-hook.c @@ -43,7 +43,7 @@ static GObjectClass *emj_parent; #define d(x) static const EPluginHookTargetKey emjh_flag_map[] = { - { 0 } + { NULL } }; /* ********************************************************************** */ diff --git a/mail/em-menu.c b/mail/em-menu.c index a7494679c8..2f4aa43ad2 100644 --- a/mail/em-menu.c +++ b/mail/em-menu.c @@ -129,7 +129,7 @@ em_menu_get_type(void) EMMenu *em_menu_new(const char *menuid) { - EMMenu *emp = g_object_new(em_menu_get_type(), 0); + EMMenu *emp = g_object_new(em_menu_get_type(), NULL); e_menu_construct(&emp->popup, menuid); @@ -310,19 +310,19 @@ static const EMenuHookTargetMask emph_select_masks[] = { { "mark_junk", EM_MENU_SELECT_MARK_JUNK }, { "mark_nojunk", EM_MENU_SELECT_MARK_NOJUNK }, { "folder", EM_MENU_SELECT_FOLDER }, - { 0 } + { NULL } }; /* dummy widget target, probably wont have any useful masks. this should probably be a more specific target type */ static const EMenuHookTargetMask emph_widget_masks[] = { - { 0 } + { NULL } }; static const EMenuHookTargetMap emph_targets[] = { { "select", EM_MENU_TARGET_SELECT, emph_select_masks }, { "widget", EM_MENU_TARGET_WIDGET, emph_widget_masks }, - { 0 } + { NULL } }; static void diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c index 79c83c1576..ec43254572 100644 --- a/mail/em-message-browser.c +++ b/mail/em-message-browser.c @@ -203,7 +203,7 @@ emmb_list_message_selected (struct _MessageList *ml, const char *uid, EMMessageB GtkWidget *em_message_browser_new(void) { - EMMessageBrowser *emmb = g_object_new(em_message_browser_get_type(), 0); + EMMessageBrowser *emmb = g_object_new(em_message_browser_get_type(), NULL); /** @HookPoint-EMMenu: Standalone Mssage View Menu * @Id: org.gnome.evolution.mail.messagebrowser diff --git a/mail/em-popup.c b/mail/em-popup.c index 3ed3a564e5..6e0fc4cc6d 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -155,7 +155,7 @@ em_popup_get_type(void) EMPopup *em_popup_new(const char *menuid) { - EMPopup *emp = g_object_new(em_popup_get_type(), 0); + EMPopup *emp = g_object_new(em_popup_get_type(), NULL); e_popup_construct(&emp->popup, menuid); @@ -641,8 +641,6 @@ static EPopupItem emp_standard_uri_popups[] = { #include - EMPopupTargetPart *target; - static void emp_apps_open_in(EPopup *ep, EPopupItem *item, void *data) { @@ -859,7 +857,7 @@ static const EPopupHookTargetMask emph_select_masks[] = { { "folder", EM_POPUP_SELECT_FOLDER }, { "junk", EM_POPUP_SELECT_JUNK }, { "not_junk", EM_POPUP_SELECT_NOT_JUNK }, - { 0 } + { NULL } }; static const EPopupHookTargetMask emph_uri_masks[] = { @@ -867,13 +865,13 @@ static const EPopupHookTargetMask emph_uri_masks[] = { { "mailto", EM_POPUP_URI_MAILTO }, { "notmailto", EM_POPUP_URI_NOT_MAILTO }, { "callto", EM_POPUP_URI_CALLTO }, - { 0 } + { NULL } }; static const EPopupHookTargetMask emph_part_masks[] = { { "message", EM_POPUP_PART_MESSAGE }, { "image", EM_POPUP_PART_IMAGE }, - { 0 } + { NULL } }; static const EPopupHookTargetMask emph_folder_masks[] = { @@ -884,7 +882,7 @@ static const EPopupHookTargetMask emph_folder_masks[] = { { "select", EM_POPUP_FOLDER_SELECT }, { "outbox", EM_POPUP_FOLDER_OUTBOX }, { "nonstatic", EM_POPUP_FOLDER_NONSTATIC }, - { 0 } + { NULL } }; static const EPopupHookTargetMask emph_attachments_masks[] = { @@ -893,7 +891,7 @@ static const EPopupHookTargetMask emph_attachments_masks[] = { { "multiple", EM_POPUP_ATTACHMENTS_MULTIPLE }, { "image", EM_POPUP_ATTACHMENTS_IMAGE }, { "message", EM_POPUP_ATTACHMENTS_MESSAGE }, - { 0 } + { NULL } }; static const EPopupHookTargetMap emph_targets[] = { @@ -902,7 +900,7 @@ static const EPopupHookTargetMap emph_targets[] = { { "part", EM_POPUP_TARGET_PART, emph_part_masks }, { "folder", EM_POPUP_TARGET_FOLDER, emph_folder_masks }, { "attachments", EM_POPUP_TARGET_ATTACHMENTS, emph_attachments_masks }, - { 0 } + { NULL } }; static void diff --git a/mail/em-sync-stream.c b/mail/em-sync-stream.c index cb8cfb36cd..5648efc83e 100644 --- a/mail/em-sync-stream.c +++ b/mail/em-sync-stream.c @@ -57,7 +57,7 @@ struct _EMSyncStreamPrivate { }; #ifdef LOG_STREAM -int dolog; +static int dolog; #endif /* Should probably expose messages to outside world ... so subclasses can extend */ diff --git a/mail/em-utils.c b/mail/em-utils.c index e5233b71be..894f547c32 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -268,7 +268,7 @@ em_filter_editor_response (GtkWidget *dialog, int button, gpointer user_data) static EMFilterSource em_filter_source_element_names[] = { { "incoming", }, { "outgoing", }, - { 0 } + { NULL } }; /** @@ -878,7 +878,7 @@ em_utils_read_messages_from_stream(CamelFolder *folder, CamelStream *stream) camel_mime_parser_scan_from(mp, TRUE); camel_mime_parser_init_with_stream(mp, stream); - while (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { + while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMimeMessage *msg; /* NB: de-from filter, once written */ @@ -894,7 +894,7 @@ em_utils_read_messages_from_stream(CamelFolder *folder, CamelStream *stream) if (camel_exception_is_set (ex)) break; - camel_mime_parser_step(mp, 0, 0); + camel_mime_parser_step(mp, NULL, NULL); } camel_object_unref(mp); @@ -1450,7 +1450,7 @@ em_utils_get_proxy_uri(void) pthread_mutex_lock(&emu_proxy_lock); if (!emu_proxy_init) { - mail_call_main(MAIL_CALL_p_p, emu_proxy_setup, NULL); + mail_call_main(MAIL_CALL_p_p, (MailMainFunc)emu_proxy_setup, NULL); emu_proxy_init = TRUE; } @@ -1864,7 +1864,7 @@ em_utils_in_addressbook(CamelInternetAddress *iaddr) pthread_mutex_lock(&emu_addr_lock); if (emu_addr_cache == NULL) { - mail_call_main(MAIL_CALL_p_p, emu_addr_setup, NULL); + mail_call_main(MAIL_CALL_p_p, (MailMainFunc)emu_addr_setup, NULL); } if (emu_addr_list == NULL) { @@ -1872,7 +1872,7 @@ em_utils_in_addressbook(CamelInternetAddress *iaddr) return FALSE; } - now = time(0); + now = time(NULL); d(printf("Checking '%s' is in addressbook", addr)); diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index c4f81278e4..15b93f24b0 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -208,10 +208,10 @@ em_vfolder_rule_next_source(EMVFolderRule *vr, const char *last) static int validate(FilterRule *fr) { - g_return_val_if_fail(fr != NULL, FALSE); + g_return_val_if_fail(fr != NULL, 0); if (!fr->name || !*fr->name) { - /* FIXME: set a aprent window? */ + /* FIXME: set a parent window? */ e_error_run(NULL, "mail:no-name-vfolder", NULL); return 0; } diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index ca4b18bdf5..35fd28c5b5 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -186,7 +186,7 @@ elm_import_describe (struct _mail_msg *mm, int complete) static MailImporterSpecial elm_special_folders[] = { { "received", "Inbox" }, - { 0 }, + { NULL }, }; static void diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index e4664efac4..4e36ebd7fa 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -232,7 +232,7 @@ import_mbox_import(struct _mail_msg *mm) camel_operation_start(NULL, _("Importing `%s'"), folder->full_name); camel_folder_freeze(folder); - while (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { + while (camel_mime_parser_step(mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMimeMessage *msg; const char *tmp; int pc = 0; @@ -269,7 +269,7 @@ import_mbox_import(struct _mail_msg *mm) if (camel_exception_is_set(&mm->ex)) break; - camel_mime_parser_step(mp, 0, 0); + camel_mime_parser_step(mp, NULL, NULL); } camel_folder_sync(folder, FALSE, NULL); camel_folder_thaw(folder); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index 24a53afd0a..4487d51f0e 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -232,7 +232,7 @@ pine_import_describe (struct _mail_msg *mm, int complete) static MailImporterSpecial pine_special_folders[] = { { "sent-mail", "Sent" }, /* pine */ { "saved-messages", "Drafts" }, /* pine */ - { 0 }, + { NULL }, }; static void diff --git a/mail/mail-component.c b/mail/mail-component.c index 383e8d5c5c..3cb63c7e68 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -1052,7 +1052,7 @@ setline_done(CamelStore *store, void *data) sd->pending--; if (sd->pending == 0) { - CORBA_Environment ev = { 0 }; + CORBA_Environment ev = { NULL }; GNOME_Evolution_Listener_complete(sd->listener, &ev); CORBA_exception_free(&ev); diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 65daffc821..bbe1f902f6 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -277,7 +277,7 @@ static void flush_updates(void) { if (update_id == -1 && !e_dlist_empty(&updates)) - update_id = mail_async_event_emit(mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)real_flush_updates, 0, 0, 0); + update_id = mail_async_event_emit(mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)real_flush_updates, NULL, NULL, NULL); } static void diff --git a/mail/mail-mt.c b/mail/mail-mt.c index dcbfb2866b..598b6af425 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -96,7 +96,7 @@ void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size) #if defined(LOG_OPS) || defined(LOG_LOCKS) if (!log_init) { - time_t now = time(0); + time_t now = time(NULL); log_init = TRUE; log_ops = getenv("EVOLUTION_MAIL_LOG_OPS") != NULL; @@ -636,18 +636,18 @@ void mail_msg_init(void) mail_gui_watch2 = em_channel_setup(&mail_gui_port2, &mail_gui_channel2, mail_msgport_received2); mail_thread_queued = e_thread_new(E_THREAD_QUEUE); - e_thread_set_msg_destroy(mail_thread_queued, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_queued, mail_msg_received, 0); + e_thread_set_msg_destroy(mail_thread_queued, mail_msg_destroy, NULL); + e_thread_set_msg_received(mail_thread_queued, mail_msg_received, NULL); e_thread_set_reply_port(mail_thread_queued, mail_gui_reply_port); mail_thread_queued_slow = e_thread_new(E_THREAD_QUEUE); - e_thread_set_msg_destroy(mail_thread_queued_slow, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_queued_slow, mail_msg_received, 0); + e_thread_set_msg_destroy(mail_thread_queued_slow, mail_msg_destroy, NULL); + e_thread_set_msg_received(mail_thread_queued_slow, mail_msg_received, NULL); e_thread_set_reply_port(mail_thread_queued_slow, mail_gui_reply_port); mail_thread_new = e_thread_new(E_THREAD_NEW); - e_thread_set_msg_destroy(mail_thread_new, mail_msg_destroy, 0); - e_thread_set_msg_received(mail_thread_new, mail_msg_received, 0); + e_thread_set_msg_destroy(mail_thread_new, mail_msg_destroy, NULL); + e_thread_set_msg_received(mail_thread_new, mail_msg_received, NULL); e_thread_set_reply_port(mail_thread_new, mail_gui_reply_port); e_thread_set_queue_limit(mail_thread_new, 10); diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index a1580d6788..35541673d8 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -644,7 +644,7 @@ static void receive_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int pc, const char *desc, void *data) { struct _send_info *info = data; - time_t now = time(0); + time_t now = time(NULL); /* let it flow through to the folder, every now and then too? */ g_hash_table_foreach(info->data->folders, (GHFunc)update_folders, &now); diff --git a/mail/mail-session.c b/mail/mail-session.c index 3b2308355a..8175c65ded 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -733,7 +733,7 @@ mail_session_add_junk_plugin (const char *plugin_name, CamelJunkPlugin *junk_plu def_plugin = gconf_client_get_string (gconf, "/apps/evolution/mail/junk/default_plugin", NULL); ms->junk_plugins = g_list_append(ms->junk_plugins, junk_plugin); - if (def_plugin && plugin_name) { + if (def_plugin && plugin_name) { if (!strcmp(def_plugin, plugin_name)) { printf("Loading %s as the default junk plugin\n", def_plugin); session->junk_plugin = junk_plugin; diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index a138a06ad3..35edafba75 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -678,13 +678,13 @@ mail_vfolder_rename_uri(CamelStore *store, const char *cfrom, const char *cto) } GList * -mail_vfolder_get_sources_local () +mail_vfolder_get_sources_local (void) { return source_folders_local; } GList * -mail_vfolder_get_sources_remote () +mail_vfolder_get_sources_remote (void) { return source_folders_remote; } diff --git a/mail/message-list.c b/mail/message-list.c index 3b6d9ff2ce..ea627c952a 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -120,9 +120,9 @@ static struct { GdkAtom atom; guint32 actions; } ml_drag_info[] = { - { "x-uid-list", 0, GDK_ACTION_ASK|GDK_ACTION_MOVE|GDK_ACTION_COPY }, - { "message/rfc822", 0, GDK_ACTION_COPY }, - { "text/uri-list", 0, GDK_ACTION_COPY }, + { "x-uid-list", NULL, GDK_ACTION_ASK|GDK_ACTION_MOVE|GDK_ACTION_COPY }, + { "message/rfc822", NULL, GDK_ACTION_COPY }, + { "text/uri-list", NULL, GDK_ACTION_COPY }, }; enum { @@ -3822,7 +3822,7 @@ regen_list_regen (struct _mail_msg *mm) } for (i = 0; i < uidnew->len; i++) { - if (g_hash_table_lookup (m->ml->hidden, uidnew->pdata[i]) == 0) { + if (g_hash_table_lookup (m->ml->hidden, uidnew->pdata[i]) == NULL) { char *uid = e_mempool_strdup (m->ml->hidden_pool, uidnew->pdata[i]); g_hash_table_insert (m->ml->hidden, uid, uid); } @@ -3849,7 +3849,7 @@ regen_list_regen (struct _mail_msg *mm) /* first, hide matches */ if (m->ml->hidden) { for (i = 0; i < uids->len; i++) { - if (g_hash_table_lookup (m->ml->hidden, uids->pdata[i]) == 0) + if (g_hash_table_lookup (m->ml->hidden, uids->pdata[i]) == NULL) g_ptr_array_add (uidnew, uids->pdata[i]); } } -- cgit v1.2.3