From a5bbf35da58d8e25de35a0a90c63d31870239dd2 Mon Sep 17 00:00:00 2001 From: Dan Vrátil Date: Mon, 20 Aug 2012 13:06:23 +0200 Subject: Fix all 'may be used uninitialized' compiler warnings --- calendar/gui/dialogs/memo-page.c | 4 ++-- em-format/e-mail-formatter-text-html.c | 2 ++ em-format/e-mail-parser.c | 2 ++ mail/e-http-request.c | 1 + mail/e-mail-reader-utils.c | 2 +- mail/em-folder-tree.c | 2 +- modules/prefer-plain/e-mail-parser-prefer-plain.c | 1 + 7 files changed, 10 insertions(+), 4 deletions(-) diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 14c1a23b3c..57332a1e0c 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -759,8 +759,8 @@ memo_page_fill_component (CompEditorPage *page, gchar *backend_addr = NULL; gchar *backend_mailto = NULL; - gchar *name; - gchar *mailto; + gchar *name = NULL; + gchar *mailto = NULL; e_client_get_backend_property_sync (E_CLIENT (client), CAL_BACKEND_PROPERTY_CAL_EMAIL_ADDRESS, &backend_addr, NULL, NULL); diff --git a/em-format/e-mail-formatter-text-html.c b/em-format/e-mail-formatter-text-html.c index f4fb3ea4dd..5f493b2f4d 100644 --- a/em-format/e-mail-formatter-text-html.c +++ b/em-format/e-mail-formatter-text-html.c @@ -69,6 +69,7 @@ get_tag (const gchar *utf8_string, gunichar c; gboolean has_end; + c = '\0'; t = g_utf8_find_prev_char (utf8_string, closing); while (t != opening) { @@ -90,6 +91,7 @@ get_tag (const gchar *utf8_string, t = g_utf8_find_next_char (t, NULL); } + has_end = FALSE; do { c = g_utf8_get_char (t); diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c index 3b1b2a2a72..c718f79425 100644 --- a/em-format/e-mail-parser.c +++ b/em-format/e-mail-parser.c @@ -652,6 +652,8 @@ e_mail_parser_wrap_as_attachment (EMailParser *parser, if (camel_mime_part_get_encoding (part) == CAMEL_TRANSFER_ENCODING_BASE64) size = size / 1.37; + } else { + size = 0; } /* e_attachment_load_async must be called from main thread */ diff --git a/mail/e-http-request.c b/mail/e-http-request.c index 0f634688a2..d6fe5d2254 100644 --- a/mail/e-http-request.c +++ b/mail/e-http-request.c @@ -133,6 +133,7 @@ handle_http_request (GSimpleAsyncResult *res, /* Remove the "evo-" prefix from scheme */ uri_len = strlen (evo_uri); + uri = NULL; if (evo_uri && (uri_len > 5)) { /* Remove trailing "?" if there is no URI query */ diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 3a8a2cab54..6f0a9822ce 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -1320,7 +1320,7 @@ e_mail_reader_reply_to_message (EMailReader *reader, EMailBackend *backend; EShellBackend *shell_backend; EMailDisplay *display; - EMailPartList *part_list; + EMailPartList *part_list = NULL; GtkWidget *message_list; CamelMimeMessage *new_message; CamelInternetAddress *address = NULL; diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 0a19e50bad..590ec684df 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -3507,7 +3507,7 @@ em_folder_tree_restore_state (EMFolderTree *folder_tree, const gchar *group_name = group->data; const gchar *key = STATE_KEY_EXPANDED; gchar *folder_name = NULL; - gboolean expanded; + gboolean expanded = FALSE; gboolean success = FALSE; if (g_str_has_prefix (group_name, "Store ")) { diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index 5237831675..958c3c0a3c 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -225,6 +225,7 @@ empe_prefer_plain_parse (EMailParserExtension *extension, } nparts = camel_multipart_get_number (mp); + plain_text_parts = NULL; has_html = FALSE; for (i = 0; i < nparts; i++) { -- cgit