aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
committerMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
commit570c6374806d0f1ec59cf7a72543efe6b5b637be (patch)
treec5390b1fcb73f30c28bf37168add9bf1dc622b42 /calendar
parent1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff)
downloadgsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.gz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.bz2
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.lz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.xz
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.zst
gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.zip
Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues. It is sometimes quite pedantic and expects/suggests some coding habits, thus certain changes may look weird, but for a good thing, I hope. The code is also tagged with Coverity scan suppressions, to keep the code as is and hide the warning too. Also note that Coverity treats g_return_if_fail(), g_assert() and similar macros as unreliable, and it's true these can be disabled during the compile time, thus it brings in other set of 'weird' changes.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.c25
-rw-r--r--calendar/gui/dialogs/comp-editor.c19
-rw-r--r--calendar/gui/dialogs/event-page.c14
-rw-r--r--calendar/gui/dialogs/memo-page.c8
-rw-r--r--calendar/gui/dialogs/recurrence-page.c4
-rw-r--r--calendar/gui/e-cal-model-tasks.c3
-rw-r--r--calendar/gui/e-cal-model.c7
-rw-r--r--calendar/gui/e-day-view-main-item.c4
-rw-r--r--calendar/gui/e-day-view.c66
-rw-r--r--calendar/gui/e-day-view.h2
-rw-r--r--calendar/gui/e-meeting-list-view.c11
-rw-r--r--calendar/gui/e-meeting-time-sel.c6
-rw-r--r--calendar/gui/e-week-view-event-item.c2
-rw-r--r--calendar/gui/e-week-view.c20
-rw-r--r--calendar/gui/e-weekday-chooser.c7
-rw-r--r--calendar/gui/ea-gnome-calendar.c7
-rw-r--r--calendar/gui/ea-week-view-main-item.c2
-rw-r--r--calendar/gui/ea-week-view.c11
-rw-r--r--calendar/gui/itip-utils.c9
-rw-r--r--calendar/gui/print.c14
-rw-r--r--calendar/importers/icalendar-importer.c44
21 files changed, 148 insertions, 137 deletions
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c
index ac6ce49d93..0eb0774f09 100644
--- a/calendar/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/alarm-notify/alarm-notify-dialog.c
@@ -155,7 +155,10 @@ dialog_response_cb (GtkDialog *dialog,
gtk_tree_model_get (treemodel, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
}
- g_return_if_fail (funcinfo);
+ if (!funcinfo) {
+ g_warn_if_reached ();
+ return;
+ }
switch (response_id) {
case GTK_RESPONSE_CLOSE:
@@ -178,7 +181,10 @@ edit_pressed_cb (GtkButton *button,
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
- g_return_if_fail (funcinfo);
+ if (!funcinfo) {
+ g_warn_if_reached ();
+ return;
+ }
(* funcinfo->func) (ALARM_NOTIFY_EDIT, -1, funcinfo->func_data);
}
@@ -196,7 +202,10 @@ print_pressed_cb (GtkButton *button,
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
- g_return_if_fail (funcinfo);
+ if (!funcinfo) {
+ g_warn_if_reached ();
+ return;
+ }
(* funcinfo->func) (ALARM_NOTIFY_PRINT, -1, funcinfo->func_data);
}
@@ -219,7 +228,10 @@ snooze_pressed_cb (GtkButton *button,
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
- g_return_if_fail (funcinfo);
+ if (!funcinfo) {
+ g_warn_if_reached ();
+ return;
+ }
snooze_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time_min));
snooze_timeout += 60 * (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time_hrs)));
@@ -248,7 +260,10 @@ dismiss_pressed_cb (GtkButton *button,
if (gtk_tree_selection_get_selected (selection, &model, &iter))
gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
- g_return_if_fail (funcinfo);
+ if (!funcinfo) {
+ g_warn_if_reached ();
+ return;
+ }
(* funcinfo->func) (ALARM_NOTIFY_DISMISS, -1, funcinfo->func_data);
}
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 0459e4797a..0c831de19c 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -329,6 +329,7 @@ get_attachment_list (CompEditor *editor)
/* We can't return until we have results, so crank
* the main loop until the callback gets triggered. */
+ /* coverity[loop_condition] */
while (!status.done)
gtk_main_iteration ();
@@ -936,25 +937,21 @@ save_and_close_editor (CompEditor *editor,
if (e_attachment_store_get_num_loading (store) > 0) {
gboolean response = 1;
- /*FIXME: Cannot use mail functions from calendar!!!! */
-#if 0
ECalComponentVType vtype = e_cal_component_get_vtype (editor->priv->comp);
if (vtype == E_CAL_COMPONENT_EVENT)
- response = em_utils_prompt_user (
- (GtkWindow *) widget,
- NULL,
+ response = e_alert_run_dialog_for_args (
+ GTK_WINDOW (editor),
"calendar:ask-send-event-pending-download",
NULL);
else
- response = em_utils_prompt_user (
- (GtkWindow *) widget,
- NULL,
+ response = e_alert_run_dialog_for_args (
+ GTK_WINDOW (editor),
"calendar:ask-send-task-pending-download",
NULL);
-#endif
- if (!response)
- return;
+
+ if (response != GTK_RESPONSE_YES)
+ return;
}
if (e_client_is_readonly (E_CLIENT (priv->cal_client))) {
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index f4d9658ccb..09cb8c880b 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -991,12 +991,14 @@ event_page_load_locations_list (CompEditorPage *page,
}
error = NULL;
- g_file_get_contents (file_name, &contents, NULL, &error);
- if (error != NULL) {
- g_warning (
- "%s: Failed to load locations list: %s",
- G_STRFUNC, error->message);
- g_error_free (error);
+ if (!g_file_get_contents (file_name, &contents, NULL, &error)) {
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to load locations list: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
+ }
+
g_free (file_name);
return;
}
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 1fd9221a54..0e06d19316 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -605,12 +605,10 @@ fill_comp_with_recipients (ENameSelector *name_selector,
for (l = list_dests; l; l = l->next) {
EDestination *dest = l->data;
- const gchar *attendee = NULL;
+ const gchar *attendee;
- /* If we couldn't get the attendee prior,
- * get the email address as the default. */
- if (attendee == NULL || *attendee == '\0')
- attendee = e_destination_get_email (dest);
+ /* Get the email address as the default. */
+ attendee = e_destination_get_email (dest);
if (attendee == NULL || *attendee == '\0')
continue;
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index 638bfafc71..7828868e54 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -837,8 +837,10 @@ simple_recur_to_comp (RecurrencePage *rpage,
if (month_num == MONTH_NUM_LAST)
month_num = -1;
- else
+ else if (month_num != -1)
month_num++;
+ else
+ g_warn_if_reached ();
switch (month_day) {
case MONTH_DAY_NTH:
diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c
index c14371c090..d4315f1a6e 100644
--- a/calendar/gui/e-cal-model-tasks.c
+++ b/calendar/gui/e-cal-model-tasks.c
@@ -588,6 +588,9 @@ set_status (ECalModelComponent *comp_data,
case ICAL_STATUS_COMPLETED:
ensure_task_complete (comp_data, -1);
break;
+
+ /* to make compiler happy */
+ /* coverity[dead_error_begin] */
default:
break;
}
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 5748e23d78..a4f06efac5 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2108,12 +2108,7 @@ e_cal_model_update_comp_time (ECalModel *model,
/* If the TZID is set to "UTC", we don't want to save the TZID. */
if (tzid && strcmp (tzid, "UTC")) {
- if (param) {
- icalparameter_set_tzid (param, (gchar *) tzid);
- } else {
- param = icalparameter_new_tzid ((gchar *) tzid);
- icalproperty_add_parameter (prop, param);
- }
+ icalparameter_set_tzid (param, (gchar *) tzid);
} else {
icalproperty_remove_parameter (prop, ICAL_TZID_PARAMETER);
}
diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c
index cdf167edd2..ef233f4a6f 100644
--- a/calendar/gui/e-day-view-main-item.c
+++ b/calendar/gui/e-day-view-main-item.c
@@ -1013,6 +1013,10 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
g_return_if_fail (day_view != NULL);
days_shown = e_day_view_get_days_shown (day_view);
+ if (days_shown <= 0) {
+ g_warn_if_reached ();
+ return;
+ }
cal_view = E_CALENDAR_VIEW (day_view);
time_divisions = e_calendar_view_get_time_divisions (cal_view);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 93f66408d9..41fbc41ca1 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1540,10 +1540,11 @@ day_view_focus (GtkWidget *widget,
e_day_view_ensure_rows_visible (
day_view,
start_row, end_row);
+ } else if (new_day != -1) {
+ e_day_view_start_editing_event (
+ day_view, new_day,
+ new_event_num, NULL);
}
- e_day_view_start_editing_event (
- day_view, new_day,
- new_event_num, NULL);
return TRUE;
}
@@ -1771,6 +1772,8 @@ day_view_get_visible_time_range (ECalendarView *cal_view,
return FALSE;
days_shown = e_day_view_get_days_shown (day_view);
+ if (days_shown <= 0)
+ return FALSE;
*start_time = day_view->day_starts[0];
*end_time = day_view->day_starts[days_shown];
@@ -3417,6 +3420,8 @@ e_day_view_recalc_day_starts (EDayView *day_view,
GDate dt;
days_shown = e_day_view_get_days_shown (day_view);
+ if (days_shown <= 0)
+ return;
day_view->day_starts[0] = start_time;
for (day = 1; day <= days_shown; day++) {
@@ -4321,11 +4326,13 @@ e_day_view_on_long_event_click (EDayView *day_view,
day_view->drag_event_x = event_x;
day_view->drag_event_y = event_y;
- e_day_view_convert_position_in_top_canvas (
+ pos = e_day_view_convert_position_in_top_canvas (
day_view,
event_x, event_y,
&day, NULL);
- day_view->drag_event_offset = day - start_day;
+
+ if (pos != E_CALENDAR_VIEW_POS_NONE && pos != E_CALENDAR_VIEW_POS_OUTSIDE)
+ day_view->drag_event_offset = day - start_day;
}
}
@@ -4428,13 +4435,16 @@ e_day_view_on_event_click (EDayView *day_view,
day_view->drag_event_x = event_x;
day_view->drag_event_y = event_y;
- e_day_view_convert_position_in_main_canvas (
+ pos = e_day_view_convert_position_in_main_canvas (
day_view,
event_x, event_y,
&tmp_day, &row,
NULL);
- start_row = event->start_minute / time_divisions;
- day_view->drag_event_offset = row - start_row;
+
+ if (pos != E_CALENDAR_VIEW_POS_NONE && pos != E_CALENDAR_VIEW_POS_OUTSIDE) {
+ start_row = event->start_minute / time_divisions;
+ day_view->drag_event_offset = row - start_row;
+ }
}
}
@@ -6882,7 +6892,10 @@ cancel_editing (EDayView *day_view)
day = day_view->editing_event_day;
event_num = day_view->editing_event_num;
- g_return_if_fail (day != -1);
+ if (day == -1) {
+ g_warn_if_reached ();
+ return;
+ }
if (day == E_DAY_VIEW_LONG_EVENT) {
if (!is_array_index_in_bounds (day_view->long_events, event_num))
@@ -7005,11 +7018,16 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
break;
case GDK_BUTTON_RELEASE:
- if (day_view->resize_event_num != -1)
- day_view->resize_event_num = -1;
+ if (day_view->resize_event_num != -1)
+ day_view->resize_event_num = -1;
- if (day_view->drag_event_num != -1)
- day_view->drag_event_num = -1;
+ if (day_view->drag_event_num != -1)
+ day_view->drag_event_num = -1;
+ tooltip_destroy (day_view, item);
+ /* Only let the EText handle the event while editing. */
+ if (!E_TEXT (item)->editing)
+ g_signal_stop_emission_by_name (item, "event");
+ break;
case GDK_BUTTON_PRESS:
tooltip_destroy (day_view, item);
@@ -8441,12 +8459,12 @@ e_day_view_update_main_canvas_drag (EDayView *day_view,
end_row = start_row;
num_rows = end_row - start_row + 1;
- }
- if (event && day_view->drag_event_day == day && start_row == row) {
- cols_in_row = day_view->cols_per_row[day][row];
- start_col = event->start_row_or_col;
- num_columns = event->num_columns;
+ if (day_view->drag_event_day == day && start_row == row) {
+ cols_in_row = day_view->cols_per_row[day][row];
+ start_col = event->start_row_or_col;
+ num_columns = event->num_columns;
+ }
}
item_x = day_view->day_offsets[day]
@@ -8561,7 +8579,11 @@ e_day_view_on_drag_begin (GtkWidget *widget,
event_num = day_view->drag_event_num;
/* These should both be set. */
- g_return_if_fail (day != -1);
+ if (day == -1) {
+ g_warn_if_reached ();
+ return;
+ }
+
g_return_if_fail (event_num != -1);
if (day == E_DAY_VIEW_LONG_EVENT) {
@@ -8639,7 +8661,11 @@ e_day_view_on_drag_data_get (GtkWidget *widget,
event_num = day_view->drag_event_num;
/* These should both be set. */
- g_return_if_fail (day != -1);
+ if (day == -1) {
+ g_warn_if_reached ();
+ return;
+ }
+
g_return_if_fail (event_num != -1);
if (day == E_DAY_VIEW_LONG_EVENT) {
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index 19d735d6d2..e02567fff8 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -277,7 +277,7 @@ struct _EDayView {
/* This is the width & offset of each of the day columns in the
* display. */
- gint day_widths[E_DAY_VIEW_MAX_DAYS];
+ gint day_widths[E_DAY_VIEW_MAX_DAYS + 1];
gint day_offsets[E_DAY_VIEW_MAX_DAYS + 1];
/* An array holding the number of columns in each row, in each day.
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index e211d21f82..0b584a11de 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -307,15 +307,16 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view,
EDestination *des = l->data;
if (e_destination_is_evolution_list (des)) {
- GList *l, *dl;
+ GList *l2, *dl;
dl = (GList *) e_destination_list_get_dests (des);
- for (l = dl; l; l = l->next) {
- attendee = e_destination_get_email (l->data);
+ for (l2 = dl; l2; l2 = l2->next) {
+ attendee = e_destination_get_email (l2->data);
if (madd && attendee && g_str_equal (madd, attendee)) {
- g_object_unref (l->data);
- l = g_list_remove (l, l->data);
+ g_object_unref (l2->data);
+ /* coverity[returned_pointer] */
+ l2 = g_list_remove (l2, l2->data);
break;
}
}
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index 674059dc71..f8965700fa 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -997,7 +997,11 @@ e_meeting_time_selector_create_no_info_pattern (EMeetingTimeSelector *mts)
CAIRO_CONTENT_COLOR, 8, 8);
cr = cairo_create (surface);
- gdk_color_parse ("white", &color);
+ color.pixel = 0;
+ color.red = 0xFFFF;
+ color.green = 0xFFFF;
+ color.blue = 0xFFFF;
+
gdk_cairo_set_source_color (cr, &color);
cairo_paint (cr);
diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c
index 298319cdea..4fa4966457 100644
--- a/calendar/gui/e-week-view-event-item.c
+++ b/calendar/gui/e-week-view-event-item.c
@@ -888,7 +888,7 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item,
draw_end = FALSE;
break;
default:
- g_return_if_reached ();
+ g_warn_if_reached ();
draw_start = FALSE;
draw_end = FALSE;
break;
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index a45cb0cb77..7e1be0a614 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1259,7 +1259,6 @@ week_view_set_selected_time_range (ECalendarView *cal_view,
{
GDate date, end_date;
gint num_days;
- gboolean update_adjustment_value = FALSE;
EWeekView *week_view = E_WEEK_VIEW (cal_view);
g_return_if_fail (E_IS_WEEK_VIEW (week_view));
@@ -1293,18 +1292,6 @@ week_view_set_selected_time_range (ECalendarView *cal_view,
week_view->selection_start_day,
num_days);
- /* Reset the adjustment value to 0 if the base address has changed.
- * Note that we do this after updating first_day_shown so that our
- * signal handler will not try to reload the events. */
- if (update_adjustment_value) {
- GtkRange *range;
- GtkAdjustment *adjustment;
-
- range = GTK_RANGE (week_view->vscrollbar);
- adjustment = gtk_range_get_adjustment (range);
- gtk_adjustment_set_value (adjustment, 0);
- }
-
gtk_widget_queue_draw (week_view->main_canvas);
}
@@ -3703,7 +3690,7 @@ e_week_view_start_editing_event (EWeekView *week_view,
editing = &g_array_index (week_view->events, EWeekViewEvent, week_view->editing_event_num);
/* do not change to other part of same component - the event is spread into more days */
- if (editing && event && editing->comp_data == event->comp_data)
+ if (editing && editing->comp_data == event->comp_data)
return FALSE;
}
@@ -4828,7 +4815,10 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item,
break;
}
- g_return_val_if_fail (day < E_WEEK_VIEW_MAX_WEEKS * 7, FALSE);
+ if (day >= E_WEEK_VIEW_MAX_WEEKS * 7) {
+ g_warn_if_reached ();
+ return FALSE;
+ }
if (focus_event->in) {
week_view->focused_jump_button = day;
diff --git a/calendar/gui/e-weekday-chooser.c b/calendar/gui/e-weekday-chooser.c
index ef459e574d..05757a5c2f 100644
--- a/calendar/gui/e-weekday-chooser.c
+++ b/calendar/gui/e-weekday-chooser.c
@@ -480,7 +480,10 @@ day_event_cb (GnomeCanvasItem *item,
break;
}
- g_return_val_if_fail (ii < 7, FALSE);
+ if (ii >= 7) {
+ g_warn_if_reached ();
+ return FALSE;
+ }
chooser->priv->focus_day = e_weekday_add_days (
chooser->priv->week_start_day, ii);
@@ -634,7 +637,7 @@ e_weekday_chooser_set_blocked (EWeekdayChooser *chooser,
GDateWeekday
e_weekday_chooser_get_week_start_day (EWeekdayChooser *chooser)
{
- g_return_val_if_fail (E_IS_WEEKDAY_CHOOSER (chooser), -1);
+ g_return_val_if_fail (E_IS_WEEKDAY_CHOOSER (chooser), G_DATE_BAD_WEEKDAY);
return chooser->priv->week_start_day;
}
diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c
index 7edf52de7d..9fd48565a9 100644
--- a/calendar/gui/ea-gnome-calendar.c
+++ b/calendar/gui/ea-gnome-calendar.c
@@ -162,8 +162,11 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal)
view_type = gnome_calendar_get_view (gcal);
calendar_view = gnome_calendar_get_calendar_view (gcal, view_type);
- e_calendar_view_get_visible_time_range (
- calendar_view, &start_time, &end_time);
+ if(!e_calendar_view_get_visible_time_range (
+ calendar_view, &start_time, &end_time)) {
+ g_warn_if_reached ();
+ return NULL;
+ }
start_tt = icaltime_from_timet_with_zone (start_time, FALSE, zone);
start_tm.tm_year = start_tt.year - 1900;
diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c
index 3aa571d3a9..20c86aa7c0 100644
--- a/calendar/gui/ea-week-view-main-item.c
+++ b/calendar/gui/ea-week-view-main-item.c
@@ -1142,8 +1142,6 @@ table_interface_get_column_description (AtkTable *table,
case 6:
g_snprintf (buffer,128,"Sunday");
break;
- default:
- break;
}
ea_cell_table_set_column_label (cell_data, in_col, buffer);
diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c
index 24d6e8de83..4d77cda1e3 100644
--- a/calendar/gui/ea-week-view.c
+++ b/calendar/gui/ea-week-view.c
@@ -232,14 +232,9 @@ ea_week_view_get_n_children (AtkObject *accessible)
event = &g_array_index (week_view->events,
EWeekViewEvent, event_index);
- if (!event)
- continue;
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + 0);
- if (!span)
- continue;
-
/* at least one of the event spans is visible, count it */
if (span->text_item)
++count;
@@ -299,15 +294,9 @@ ea_week_view_ref_child (AtkObject *accessible,
event = &g_array_index (week_view->events,
EWeekViewEvent, event_index);
- if (!event)
- continue;
-
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
- if (!span)
- continue;
-
current_day = span->start_day;
if (span->text_item)
++count;
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index d8cc740a3b..1a48a29ee4 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -634,6 +634,7 @@ comp_from (ECalComponentItipMethod method,
return sender;
if (!e_cal_component_has_attendees (comp))
return NULL;
+ /* coverity[fallthrough] */
case E_CAL_COMPONENT_METHOD_CANCEL:
@@ -1844,7 +1845,6 @@ reply_to_calendar_comp (ESourceRegistry *registry,
ECalComponent *comp = NULL;
icalcomponent *top_level = NULL;
icaltimezone *default_zone;
- GSList *users = NULL;
gchar *subject = NULL;
gchar *ical_string = NULL;
gboolean retval = FALSE;
@@ -1865,7 +1865,7 @@ reply_to_calendar_comp (ESourceRegistry *registry,
/* Recipients */
destinations = comp_to_list (
- registry, method, comp, users, reply_all, NULL);
+ registry, method, comp, NULL, reply_all, NULL);
/* Subject information */
subject = comp_subject (registry, method, comp);
@@ -2003,11 +2003,6 @@ reply_to_calendar_comp (ESourceRegistry *registry,
if (top_level != NULL)
icalcomponent_free (top_level);
- if (users) {
- g_slist_foreach (users, (GFunc) g_free, NULL);
- g_slist_free (users);
- }
-
g_free (subject);
g_free (ical_string);
return retval;
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 13f195c2b7..c902a1c4e7 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -1654,8 +1654,10 @@ print_day_details (GtkPrintContext *context,
/* this ugly thing is here only to get rid of compiler warning
* about unused 'jump_xpm_focused' */
- if (pixbuf)
+ if (pixbuf) {
+ /* coverity[dead_error_line] */
xpm = (const gchar **) jump_xpm_focused;
+ }
pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
}
@@ -2003,11 +2005,6 @@ print_week_event (GtkPrintContext *context,
if (!pixbuf) {
const gchar **xpm = (const gchar **) jump_xpm;
- /* this ugly thing is here only to get rid of compiler warning
- * about unused 'jump_xpm_focused' */
- if (pixbuf)
- xpm = (const gchar **) jump_xpm_focused;
-
pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
}
@@ -2840,11 +2837,6 @@ print_work_week_day_details (GtkPrintContext *context,
if (!pixbuf) {
const gchar **xpm = (const gchar **) jump_xpm;
- /* this ugly thing is here only to get rid of compiler warning
- * about unused 'jump_xpm_focused' */
- if (pixbuf)
- xpm = (const gchar **) jump_xpm_focused;
-
pixbuf = gdk_pixbuf_new_from_xpm_data (xpm);
}
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 2368643877..83fc9521c0 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -1004,34 +1004,28 @@ gnome_calendar_import (EImport *ei,
g_free (filename);
/* If we couldn't load the file, just return. FIXME: Error message? */
- if (!icalcomp)
- goto out;
-
- ici = g_malloc0 (sizeof (*ici));
- ici->ei = ei;
- ici->target = target;
- ici->cancellable = g_cancellable_new ();
- ici->icalcomp = icalcomp;
- icalcomp = NULL;
-
- g_datalist_set_data_full (&target->data, "gnomecal-data", ici, free_ici);
-
- prepare_events (ici->icalcomp, &ici->tasks);
- if (do_calendar) {
- open_default_source (ici, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, gc_import_events);
- return;
- }
+ if (icalcomp) {
+ ici = g_malloc0 (sizeof (*ici));
+ ici->ei = ei;
+ ici->target = target;
+ ici->cancellable = g_cancellable_new ();
+ ici->icalcomp = icalcomp;
+
+ g_datalist_set_data_full (&target->data, "gnomecal-data", ici, free_ici);
+
+ prepare_events (ici->icalcomp, &ici->tasks);
+ if (do_calendar) {
+ open_default_source (ici, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, gc_import_events);
+ return;
+ }
- prepare_tasks (ici->icalcomp, ici->tasks);
- if (do_tasks) {
- open_default_source (ici, E_CAL_CLIENT_SOURCE_TYPE_TASKS, gc_import_tasks);
- return;
+ prepare_tasks (ici->icalcomp, ici->tasks);
+ if (do_tasks) {
+ open_default_source (ici, E_CAL_CLIENT_SOURCE_TYPE_TASKS, gc_import_tasks);
+ return;
+ }
}
- out:
- if (icalcomp)
- icalcomponent_free (icalcomp);
-
e_import_complete (ei, target);
}