[gtk+] Fix some compilation warning



commit 670e141b3a23c9578dcffe7b04d6a0ff84404bec
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Oct 21 02:07:26 2009 +0200

    Fix some compilation warning
    
    Added some default cases and assert if reached

 gtk/gtkinfobar.c        |    5 +++++
 gtk/gtkmenu.c           |    4 ++++
 gtk/gtkprintoperation.c |    4 ++++
 3 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index 9ada2c9..be1e875 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -569,6 +569,11 @@ gtk_info_bar_update_colors (GtkInfoBar *info_bar)
           fg = &other_default_border_color;
           bg = &other_default_fill_color;
           break;
+
+        default:
+          g_assert_not_reached();
+          fg = NULL;
+          bg = NULL;
         }
     }
 
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 5d66878..9d3107b 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -2730,6 +2730,10 @@ get_arrows_visible_area (GtkMenu      *menu,
       lower->width = (border->width - 2 * border->x) / 2;
       lower->height = scroll_arrow_height;
       break;
+
+    default:
+       g_assert_not_reached();
+       upper->x = upper->y = upper->width = upper->height = 0;
     }
 
   *arrow_space = scroll_arrow_height - 2 * widget->style->ythickness;
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index c8a85e7..2d01148 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -2496,6 +2496,10 @@ common_render_page (GtkPrintOperation *op,
             x = columns - 1 - (priv->page_position / rows) % columns;
             y = rows - 1 - priv->page_position % rows;
             break;
+          default:
+            g_assert_not_reached();
+            x = 0;
+            y = 0;
         }
 
       if (priv->manual_number_up == 4 || priv->manual_number_up == 9 || priv->manual_number_up == 16)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]