[gtk+/gtk-3-22] Calendar: Add default case to appease Coverity
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] Calendar: Add default case to appease Coverity
- Date: Tue, 1 Aug 2017 19:19:53 +0000 (UTC)
commit cd7e5fae226219d8b8d753974078f36540f28a89
Author: Daniel Boles <dboles src gnome org>
Date: Tue Aug 1 19:39:08 2017 +0100
Calendar: Add default case to appease Coverity
CID 1432024 (#1 of 1): Uninitialized scalar variable (UNINIT)
2. uninit_use_in_call: Using uninitialized value rect.x when calling
calendar_arrow_rectangle.
Add a default case to the switch which will bail out with
g_assert_not_reached(), which should reassure Coverity that the method
is always called with a valid value that is handled in the switch.
gtk/gtkcalendar.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index cd6f687..9423333 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -1273,6 +1273,9 @@ calendar_arrow_rectangle (GtkCalendar *calendar,
rect->x = (allocation.width - padding.left - padding.right
- 3 - priv->arrow_width);
break;
+
+ default:
+ g_assert_not_reached ();
}
rect->x += padding.left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]