diff options
author | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
commit | 570c6374806d0f1ec59cf7a72543efe6b5b637be (patch) | |
tree | c5390b1fcb73f30c28bf37168add9bf1dc622b42 /calendar/gui/e-week-view.c | |
parent | 1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff) | |
download | gsoc2013-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/gui/e-week-view.c')
-rw-r--r-- | calendar/gui/e-week-view.c | 20 |
1 files changed, 5 insertions, 15 deletions
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; |