aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/alarm-notify/alarm-notify-dialog.c
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/alarm-notify/alarm-notify-dialog.c
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/alarm-notify/alarm-notify-dialog.c')
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.c25
1 files changed, 20 insertions, 5 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);
}