[gtk+] Cleanups



commit be22a6216094814b00243a3da93fe177814a4e9b
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Sep 9 22:40:44 2009 -0400

    Cleanups
    
    This commit removes dead code, mostly pointed out by clang.

 demos/gtk-demo/offscreen_window2.c               |    2 --
 gdk-pixbuf/io-xpm.c                              |    2 +-
 gdk/gdkoffscreenwindow.c                         |    8 --------
 gdk/gdkwindow.c                                  |    7 -------
 gdk/x11/gdkgeometry-x11.c                        |   21 ++++++++-------------
 gdk/x11/gdkwindow-x11.c                          |    6 ------
 modules/other/gail/gailbutton.c                  |    3 ---
 modules/other/gail/gailcombobox.c                |   12 ++++++------
 modules/other/gail/gailscalebutton.c             |    2 --
 modules/printbackends/file/gtkprintbackendfile.c |    2 --
 10 files changed, 15 insertions(+), 50 deletions(-)
---
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index d7e3c95..19ca760 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -374,7 +374,6 @@ gtk_mirror_bin_expose (GtkWidget      *widget,
       if (event->window == widget->window)
         {
           GdkPixmap *pixmap;
-          GtkAllocation child_area;
           cairo_t *cr;
           cairo_matrix_t matrix;
           cairo_pattern_t *mask;
@@ -383,7 +382,6 @@ gtk_mirror_bin_expose (GtkWidget      *widget,
             {
               pixmap = gdk_offscreen_window_get_pixmap (bin->offscreen_window);
               gdk_drawable_get_size (pixmap, &width, &height);
-              child_area = bin->child->allocation;
 
               cr = gdk_cairo_create (widget->window);
 
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index 4d57cf2..b8a02d8 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -596,7 +596,7 @@ pixbuf_create_from_xpm (const gchar * (*get_buf) (enum buf_op op, gpointer handl
 		if ((!buffer) || (strlen (buffer) < wbytes))
 			continue;
 
-		for (n = 0, cnt = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
+		for (n = 0, xcnt = 0; n < wbytes; n += cpp, xcnt++) {
 			strncpy (pixel_str, &buffer[n], cpp);
 			pixel_str[cpp] = 0;
 
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 202e798..2622235 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -601,7 +601,6 @@ _gdk_offscreen_window_new (GdkWindow     *window,
 			   GdkWindowAttr *attributes,
 			   gint           attributes_mask)
 {
-  GdkWindowObject *parent_private;
   GdkWindowObject *private;
   GdkOffscreenWindow *offscreen;
 
@@ -615,7 +614,6 @@ _gdk_offscreen_window_new (GdkWindow     *window,
   if (private->parent != NULL && GDK_WINDOW_DESTROYED (private->parent))
     return;
 
-  parent_private = (GdkWindowObject*) private->parent;
   private->impl = g_object_new (GDK_TYPE_OFFSCREEN_WINDOW, NULL);
   offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
   offscreen->wrapper = window;
@@ -650,7 +648,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowObject *new_parent_private = (GdkWindowObject *)new_parent;
   GdkWindowObject *old_parent;
-  GdkOffscreenWindow *offscreen;
   gboolean was_mapped;
 
   if (new_parent)
@@ -664,8 +661,6 @@ gdk_offscreen_window_reparent (GdkWindow *window,
 	return FALSE;
     }
 
-  offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
-
   was_mapped = GDK_WINDOW_IS_MAPPED (window);
 
   gdk_window_hide (window);
@@ -1121,9 +1116,6 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
 				   gint      *depth)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
-  GdkOffscreenWindow *offscreen;
-
-  offscreen = GDK_OFFSCREEN_WINDOW (private->impl);
 
   g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
 
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index eb41ec2..760dd95 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -8483,7 +8483,6 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
     {
       GList *cur;
       GdkRectangle real_clip_rect;
-      gboolean is_offscreen;
 
       if (parentwin != private)
 	{
@@ -8491,8 +8490,6 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
 	  y_offset += GDK_WINDOW_OBJECT (lastwin)->y;
 	}
 
-      is_offscreen = gdk_window_is_offscreen (parentwin);
-
       /* children is ordered in reverse stack order */
       for (cur = parentwin->children;
 	   cur && cur->data != lastwin;
@@ -9376,15 +9373,11 @@ void
 _gdk_display_set_window_under_pointer (GdkDisplay *display,
 				       GdkWindow *window)
 {
-  GdkWindowObject *private;
-
   /* We don't track this if all native, and it can cause issues
      with the update_cursor call below */
   if (_gdk_native_windows)
     return;
 
-  private = (GdkWindowObject *)window;
-
   if (display->pointer_info.window_under_pointer)
     g_object_unref (display->pointer_info.window_under_pointer);
   display->pointer_info.window_under_pointer = window;
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 8efeea9..7917031 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -60,26 +60,24 @@ _gdk_window_move_resize_child (GdkWindow *window,
 			       gint       width,
 			       gint       height)
 {
-  GdkWindowImplX11 *impl;
   GdkWindowObject *obj;
-  
+
   g_return_if_fail (window != NULL);
-  g_return_if_fail (GDK_IS_WINDOW (window)); 
+  g_return_if_fail (GDK_IS_WINDOW (window));
 
-  impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
   obj = GDK_WINDOW_OBJECT (window);
 
   if (width > 65535 ||
       height > 65535)
     {
       g_warning ("Native children wider or taller than 65535 pixels are not supported");
-      
+
       if (width > 65535)
 	width = 65535;
       if (height > 65535)
 	height = 65535;
     }
-  
+
   obj->x = x;
   obj->y = y;
   obj->width = width;
@@ -89,7 +87,6 @@ _gdk_window_move_resize_child (GdkWindow *window,
      the window won't be visible anyway and thus it will be shaped
      to nothing */
 
-  
   _gdk_x11_window_tmp_unset_parent_bg (window);
   _gdk_x11_window_tmp_unset_bg (window, TRUE);
   XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
@@ -268,20 +265,18 @@ _gdk_window_process_expose (GdkWindow    *window,
 			    gulong        serial,
 			    GdkRectangle *area)
 {
-  GdkWindowImplX11 *impl;
   GdkRegion *invalidate_region = gdk_region_rectangle (area);
   GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window));
-  impl = GDK_WINDOW_IMPL_X11 (GDK_WINDOW_OBJECT (window)->impl);
 
   if (display_x11->translate_queue)
     {
       GList *tmp_list = display_x11->translate_queue->head;
-      
+
       while (tmp_list)
 	{
 	  GdkWindowQueueItem *item = tmp_list->data;
           GList *next = tmp_list->next;
-	  
+
 	  /* an overflow-safe (serial < item->serial) */
 	  if (serial - item->serial > (gulong) G_MAXLONG)
 	    {
@@ -292,7 +287,7 @@ _gdk_window_process_expose (GdkWindow    *window,
 		      if (item->u.translate.area)
 			{
 			  GdkRegion *intersection;
-			  
+
 			  intersection = gdk_region_copy (invalidate_region);
 			  gdk_region_intersect (intersection, item->u.translate.area);
 			  gdk_region_subtract (invalidate_region, intersection);
@@ -320,7 +315,7 @@ _gdk_window_process_expose (GdkWindow    *window,
 
   if (!gdk_region_empty (invalidate_region))
     _gdk_window_invalidate_for_expose (window, invalidate_region);
-  
+
   gdk_region_destroy (invalidate_region);
 }
 
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index d664384..257dba7 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -419,7 +419,6 @@ void
 _gdk_windowing_window_init (GdkScreen * screen)
 {
   GdkWindowObject *private;
-  GdkWindowImplX11 *impl;
   GdkDrawableImplX11 *draw_impl;
   GdkScreenX11 *screen_x11;
 
@@ -436,7 +435,6 @@ _gdk_windowing_window_init (GdkScreen * screen)
   private->impl = g_object_new (_gdk_window_impl_get_type (), NULL);
   private->impl_window = private;
 
-  impl = GDK_WINDOW_IMPL_X11 (private->impl);
   draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
   
   draw_impl->screen = screen;
@@ -1601,11 +1599,9 @@ gdk_window_x11_reparent (GdkWindow *window,
 {
   GdkWindowObject *window_private;
   GdkWindowObject *parent_private;
-  GdkWindowObject *old_parent_private;
   GdkWindowImplX11 *impl;
 
   window_private = (GdkWindowObject*) window;
-  old_parent_private = (GdkWindowObject*)window_private->parent;
   parent_private = (GdkWindowObject*) new_parent;
   impl = GDK_WINDOW_IMPL_X11 (window_private->impl);
 
@@ -5526,7 +5522,6 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
 {
 #if defined(HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
   GdkWindowObject *private = (GdkWindowObject *) window;
-  GdkDisplayX11 *x11_display;
   GdkWindowImplX11 *impl;
   GdkDisplay *display;
   Display *dpy;
@@ -5535,7 +5530,6 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
   impl = GDK_WINDOW_IMPL_X11 (private->impl);
 
   display = gdk_screen_get_display (GDK_DRAWABLE_IMPL_X11 (impl)->screen);
-  x11_display = GDK_DISPLAY_X11 (display);
   dpy = GDK_DISPLAY_XDISPLAY (display);
   xid = GDK_WINDOW_XWINDOW (private);
 
diff --git a/modules/other/gail/gailbutton.c b/modules/other/gail/gailbutton.c
index 1e42904..998ec29 100644
--- a/modules/other/gail/gailbutton.c
+++ b/modules/other/gail/gailbutton.c
@@ -874,7 +874,6 @@ gail_button_ref_state_set (AtkObject *obj)
 {
   AtkStateSet *state_set;
   GtkWidget *widget;
-  GtkButton *button;
 
   state_set = ATK_OBJECT_CLASS (gail_button_parent_class)->ref_state_set (obj);
   widget = GTK_ACCESSIBLE (obj)->widget;
@@ -882,8 +881,6 @@ gail_button_ref_state_set (AtkObject *obj)
   if (widget == NULL)
     return state_set;
 
-  button = GTK_BUTTON (widget);
-
   if (GTK_WIDGET_STATE (widget) == GTK_STATE_ACTIVE)
     atk_state_set_add_state (state_set, ATK_STATE_ARMED);
 
diff --git a/modules/other/gail/gailcombobox.c b/modules/other/gail/gailcombobox.c
index b90e7cc..e246aa3 100644
--- a/modules/other/gail/gailcombobox.c
+++ b/modules/other/gail/gailcombobox.c
@@ -358,15 +358,14 @@ gail_combo_box_get_keybinding (AtkAction *action,
 {
   GailComboBox *combo_box;
   gchar *return_value = NULL;
-  combo_box = GAIL_COMBO_BOX (action);
   switch (i)
   {
      case 0:
       {
-	  GtkWidget *widget;							    
+	  GtkWidget *widget;
 	  GtkWidget *label;
 	  AtkRelationSet *set;
-	  AtkRelation *relation;							     
+	  AtkRelation *relation;
 	  GPtrArray *target;
 	  gpointer target_object;
 	  guint key_val;
@@ -375,7 +374,7 @@ gail_combo_box_get_keybinding (AtkAction *action,
 	  widget = GTK_ACCESSIBLE (combo_box)->widget;
 	  if (widget == NULL)
              return NULL;
-	  set = atk_object_ref_relation_set (ATK_OBJECT (action));							
+	  set = atk_object_ref_relation_set (ATK_OBJECT (action));
 	  if (!set)
              return NULL;
 	  label = NULL;
@@ -388,7 +387,7 @@ gail_combo_box_get_keybinding (AtkAction *action,
 	     {
 	        label = GTK_ACCESSIBLE (target_object)->widget;
 	     }
-	  }  
+	  }
 	  g_object_unref (set);
 	  if (GTK_IS_LABEL (label))
 	  {
@@ -398,7 +397,8 @@ gail_combo_box_get_keybinding (AtkAction *action,
 	  }
 	   g_free (combo_box->press_keybinding);
 	   combo_box->press_keybinding = return_value;
-	   break;                                                                                    }                             
+	   break;
+       }
     default:
 	   break;
   }
diff --git a/modules/other/gail/gailscalebutton.c b/modules/other/gail/gailscalebutton.c
index aa0ac2f..32cb12e 100644
--- a/modules/other/gail/gailscalebutton.c
+++ b/modules/other/gail/gailscalebutton.c
@@ -187,12 +187,10 @@ static void
 gail_scale_button_get_current_value (AtkValue *obj,
                                      GValue   *value)
 {
-  GailScaleButton *scale_button;
   GtkScaleButton *gtk_scale_button;
 
   g_return_if_fail (GAIL_IS_SCALE_BUTTON (obj));
 
-  scale_button = GAIL_SCALE_BUTTON (obj);
   gtk_scale_button = GTK_SCALE_BUTTON (GTK_ACCESSIBLE (obj)->widget);
 
   g_value_set_double (g_value_init (value, G_TYPE_DOUBLE),
diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c
index aaf8ce1..fc2046c 100644
--- a/modules/printbackends/file/gtkprintbackendfile.c
+++ b/modules/printbackends/file/gtkprintbackendfile.c
@@ -442,13 +442,11 @@ gtk_print_backend_file_print_stream (GtkPrintBackend        *print_backend,
 				     GDestroyNotify          dnotify)
 {
   GError *internal_error = NULL;
-  GtkPrinter *printer;
   _PrintStreamData *ps;
   GtkPrintSettings *settings;
   gchar *uri;
   GFile *file = NULL;
 
-  printer = gtk_print_job_get_printer (job);
   settings = gtk_print_job_get_settings (job);
 
   ps = g_new0 (_PrintStreamData, 1);



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