[gtk+] Calendar: Add default case to appease Coverity



commit 881d7c6442e9ad711ea29db8b7d0f09501c73b47
Author: Daniel Boles <dboles src gnome org>
Date:   Tue Aug 1 19:42:17 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 b9b55dd..e2f2ae6 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -1224,6 +1224,9 @@ calendar_arrow_rectangle (GtkCalendar  *calendar,
         rect->x = (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]