[evolution] Fix few 'may be used uninitialized' compiler warnings
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Fix few 'may be used uninitialized' compiler warnings
- Date: Fri, 30 Sep 2011 13:41:01 +0000 (UTC)
commit 4c56856e05c6ab1468fe8ace4b73ac31b333990b
Author: Milan Crha <mcrha redhat com>
Date: Fri Sep 30 15:39:57 2011 +0200
Fix few 'may be used uninitialized' compiler warnings
.../contact-list-editor/e-contact-list-editor.c | 2 +-
.../gui/contact-list-editor/e-contact-list-model.c | 6 ++++--
addressbook/gui/widgets/eab-gui-util.c | 2 +-
addressbook/importers/evolution-vcard-importer.c | 3 +--
calendar/gui/dialogs/comp-editor.c | 4 ++--
calendar/gui/e-day-view-main-item.c | 2 +-
mail/e-mail-store.c | 2 +-
mail/mail-ops.c | 2 +-
mail/message-list.c | 2 +-
widgets/table/e-table-group-container.c | 5 ++---
widgets/text/e-reflow.c | 2 +-
11 files changed, 16 insertions(+), 16 deletions(-)
---
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 d6a373a..57d2acd 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -780,7 +780,7 @@ contact_list_editor_remove_button_clicked_cb (GtkWidget *widget)
{
EContactListEditor *editor;
GtkTreeSelection *selection;
- GtkTreeRowReference *new_selection;
+ GtkTreeRowReference *new_selection = NULL;
GtkTreeModel *model;
GtkTreeView *view;
GtkTreePath *path;
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 6774eee..8236baf 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c
@@ -144,7 +144,7 @@ e_contact_list_model_add_destination (EContactListModel *model,
gboolean ignore_conflicts)
{
GtkTreeIter iter;
- GtkTreePath *path;
+ GtkTreePath *path = NULL;
g_return_val_if_fail (E_IS_CONTACT_LIST_MODEL (model), NULL);
g_return_val_if_fail (E_IS_DESTINATION (destination), NULL);
@@ -160,8 +160,10 @@ e_contact_list_model_add_destination (EContactListModel *model,
for (dest = dests; dest; dest = dest->next) {
path = e_contact_list_model_add_destination (model, dest->data, &iter, ignore_conflicts);
- if (dest->next && path)
+ if (dest->next && path) {
gtk_tree_path_free (path);
+ path = NULL;
+ }
}
/* When the list has no children the remove it. We don't want empty sublists displayed. */
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 00f4e88..6994af2 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -735,7 +735,7 @@ country_to_ISO (const gchar *country)
}
while (fgets (buffer, length, file) != NULL) {
- gchar *low;
+ gchar *low = NULL;
pair = g_strsplit (buffer, "\t", 2);
if (pair[0]) {
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index be97f25..b355539 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -351,8 +351,7 @@ guess_vcard_encoding (const gchar *filename)
return VCARD_ENCODING_NONE;
}
- fgets (line, 4096, handle);
- if (line == NULL) {
+ if (fgets (line, 4096, handle) == NULL) {
fclose (handle);
g_print ("\n");
return VCARD_ENCODING_NONE;
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 9a60f6d..9c463c6 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -3010,8 +3010,8 @@ attachment_loaded_cb (EAttachment *attachment,
{
GFileInfo *file_info;
const gchar *display_name;
- const gchar *new_name;
const gchar *uid;
+ gchar *new_name;
/* Prior to 2.27.2, attachment files were named:
*
@@ -3042,7 +3042,7 @@ attachment_loaded_cb (EAttachment *attachment,
uid = g_object_get_data (G_OBJECT (attachment), "uid");
if (g_str_has_prefix (display_name, uid)) {
- new_name = g_strdup (display_name+strlen(uid)+1);
+ new_name = g_strdup (display_name + strlen (uid) + 1);
g_file_info_set_display_name (file_info, new_name);
g_object_notify (G_OBJECT (attachment), "file-info");
g_free (new_name);
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index c379f2a..b6cdc96 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -185,7 +185,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item,
gint item_x, item_y, item_w, item_h, bar_y1, bar_y2;
GdkColor bg_color;
ECalComponent *comp;
- gint num_icons, icon_x, icon_y, icon_x_inc = 0, icon_y_inc = 0;
+ gint num_icons, icon_x = 0, icon_y, icon_x_inc = 0, icon_y_inc = 0;
gint max_icon_w, max_icon_h;
gboolean draw_reminder_icon, draw_recurrence_icon, draw_timezone_icon, draw_meeting_icon;
gboolean draw_attach_icon;
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index 885e34b..e59e7b2 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -311,7 +311,7 @@ e_mail_store_add_by_account (EMailBackend *backend,
CamelService *service = NULL;
CamelProvider *provider;
CamelURL *url;
- gboolean skip, transport_only;
+ gboolean skip = FALSE, transport_only;
GError *error = NULL;
g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 0ff745e..5788517 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -215,7 +215,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
CamelFolder *folder = NULL;
CamelURL *url;
const gchar *uid;
- gboolean is_local_delivery;
+ gboolean is_local_delivery = FALSE;
gint i;
fm->destination = e_mail_local_get_folder (
diff --git a/mail/message-list.c b/mail/message-list.c
index 602bdfa..1e903a3 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4125,7 +4125,7 @@ on_click (ETree *tree,
CamelMessageInfo *info;
gboolean folder_is_trash;
const gchar *uid;
- gint flag;
+ gint flag = 0;
guint32 flags;
if (col == COL_MESSAGE_STATUS)
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index d874834..7d04eda 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -1252,7 +1252,7 @@ e_table_group_container_print_page (EPrintable *ep,
gboolean quantize,
ETGCPrintContext *groupcontext)
{
- cairo_t *cr;
+ cairo_t *cr = NULL;
GtkPageSetup *setup;
gdouble yd;
gdouble page_height, page_margin;
@@ -1301,8 +1301,7 @@ e_table_group_container_print_page (EPrintable *ep,
child_height = e_printable_height (child_printable, context, width,yd, quantize);
if (child_height < 0)
child_height = -child_height;
- if (yd < 2 * TEXT_AREA_HEIGHT + 20 + child_height )
- {
+ if (cr && yd < 2 * TEXT_AREA_HEIGHT + 20 + child_height) {
cairo_show_page (cr);
cairo_translate (cr, -2 * TEXT_AREA_HEIGHT, -TEXT_AREA_HEIGHT);
break;
diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c
index 37cfef1..296d732 100644
--- a/widgets/text/e-reflow.c
+++ b/widgets/text/e-reflow.c
@@ -1398,7 +1398,7 @@ e_reflow_point (GnomeCanvasItem *item,
gint cx,
gint cy)
{
- GnomeCanvasItem *child;
+ GnomeCanvasItem *child = NULL;
if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point)
child = GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point (item, x, y, cx, cy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]