[gtk+] Silence new gcc warnings



commit 454c36523a12f521fbddff1caf2ec158fd560932
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 23 18:50:09 2011 -0500

    Silence new gcc warnings
    
    gcc 4.6.0 has started to warn about set-but-unused variables.
    So don't do that, then.

 gdk/gdkevents.c                     |    3 +-
 gdk/gdkoffscreenwindow.c            |   52 +++++++++++++----------------------
 gdk/gdkwindow.c                     |   45 +++++++++---------------------
 gdk/x11/gdkcursor-x11.c             |   22 +++++++--------
 gdk/x11/gdkdevice-xi.c              |    4 ---
 gdk/x11/gdkdevicemanager-core-x11.c |    2 -
 gdk/x11/gdkdevicemanager-xi2.c      |   13 ++-------
 gdk/x11/gdkgeometry-x11.c           |    2 -
 8 files changed, 47 insertions(+), 96 deletions(-)
---
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index f4d4eff..21c57d5 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -1459,12 +1459,11 @@ gdk_synthesize_click (GdkDisplay *display,
                       gint        nclicks)
 {
   GdkEvent *event_copy;
-  GList *link;
 
   event_copy = gdk_event_copy (event);
   event_copy->type = (nclicks == 2) ? GDK_2BUTTON_PRESS : GDK_3BUTTON_PRESS;
 
-  link = _gdk_event_queue_append (display, event_copy);
+  _gdk_event_queue_append (display, event_copy);
 }
 
 void
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 5257bcc..8ee57f9 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -87,15 +87,11 @@ gdk_offscreen_window_init (GdkOffscreenWindow *window)
 
 static void
 gdk_offscreen_window_destroy (GdkWindow *window,
-			      gboolean   recursing,
-			      gboolean   foreign_destroy)
+                              gboolean   recursing,
+                              gboolean   foreign_destroy)
 {
-  GdkOffscreenWindow *offscreen;
-
-  offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
-
   gdk_offscreen_window_set_embedder (window, NULL);
-  
+
   if (!recursing)
     gdk_offscreen_window_hide (window);
 }
@@ -367,14 +363,13 @@ gdk_offscreen_window_lower (GdkWindow *window)
 
 static void
 gdk_offscreen_window_move_resize_internal (GdkWindow *window,
-					   gint       x,
-					   gint       y,
-					   gint       width,
-					   gint       height,
-					   gboolean   send_expose_events)
+                                           gint       x,
+                                           gint       y,
+                                           gint       width,
+                                           gint       height,
+                                           gboolean   send_expose_events)
 {
   GdkOffscreenWindow *offscreen;
-  gint dx, dy, dw, dh;
 
   offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
 
@@ -386,11 +381,6 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
   if (window->destroyed)
     return;
 
-  dx = x - window->x;
-  dy = y - window->y;
-  dw = width - window->width;
-  dh = height - window->height;
-
   window->x = x;
   window->y = y;
 
@@ -421,7 +411,7 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
 
   if (GDK_WINDOW_IS_MAPPED (window))
     {
-      // TODO: Only invalidate new area, i.e. for larger windows
+      /* TODO: Only invalidate new area, i.e. for larger windows */
       gdk_window_invalidate_rect (window, NULL, TRUE);
       _gdk_synthesize_crossing_events_for_geometry_change (window);
     }
@@ -429,16 +419,12 @@ gdk_offscreen_window_move_resize_internal (GdkWindow *window,
 
 static void
 gdk_offscreen_window_move_resize (GdkWindow *window,
-				  gboolean   with_move,
-				  gint       x,
-				  gint       y,
-				  gint       width,
-				  gint       height)
+                                  gboolean   with_move,
+                                  gint       x,
+                                  gint       y,
+                                  gint       width,
+                                  gint       height)
 {
-  GdkOffscreenWindow *offscreen;
-
-  offscreen = GDK_OFFSCREEN_WINDOW (window->impl);
-
   if (!with_move)
     {
       x = window->x;
@@ -451,9 +437,9 @@ gdk_offscreen_window_move_resize (GdkWindow *window,
   if (height < 0)
     height = window->height;
 
-  gdk_offscreen_window_move_resize_internal (window, x, y,
-					     width, height,
-					     TRUE);
+  gdk_offscreen_window_move_resize_internal (window,
+                                             x, y, width, height,
+                                             TRUE);
 }
 
 static void
@@ -469,6 +455,8 @@ gdk_offscreen_window_show (GdkWindow *window,
 static void
 gdk_offscreen_window_hide (GdkWindow *window)
 {
+  /* TODO: This needs updating to the new grab world */
+#if 0
   GdkOffscreenWindow *offscreen;
   GdkDisplay *display;
 
@@ -479,8 +467,6 @@ gdk_offscreen_window_hide (GdkWindow *window)
   /* May need to break grabs on children */
   display = gdk_window_get_display (window);
 
-  /* TODO: This needs updating to the new grab world */
-#if 0
   if (display->pointer_grab.window != NULL)
     {
       if (is_parent_of (window, display->pointer_grab.window))
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8820920..019b0ea 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2478,14 +2478,13 @@ gdk_window_add_filter (GdkWindow     *window,
  * @data: user data for previously-added filter function
  *
  * Remove a filter previously added with gdk_window_add_filter().
- *
- **/
+ */
 void
 gdk_window_remove_filter (GdkWindow     *window,
-			  GdkFilterFunc  function,
-			  gpointer       data)
+                          GdkFilterFunc  function,
+                          gpointer       data)
 {
-  GList *tmp_list, *node;
+  GList *tmp_list;
   GdkEventFilter *filter;
 
   g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));
@@ -2498,17 +2497,16 @@ gdk_window_remove_filter (GdkWindow     *window,
   while (tmp_list)
     {
       filter = (GdkEventFilter *)tmp_list->data;
-      node = tmp_list;
       tmp_list = tmp_list->next;
 
       if ((filter->function == function) && (filter->data == data))
-	{
+        {
           filter->flags |= GDK_EVENT_FILTER_REMOVED;
 
-	  _gdk_event_filter_unref (window, filter);
+          _gdk_event_filter_unref (window, filter);
 
-	  return;
-	}
+          return;
+        }
     }
 }
 
@@ -5901,25 +5899,20 @@ gdk_window_get_device_events (GdkWindow *window,
 
 static void
 gdk_window_move_resize_toplevel (GdkWindow *window,
-				 gboolean   with_move,
-				 gint       x,
-				 gint       y,
-				 gint       width,
-				 gint       height)
+                                 gboolean   with_move,
+                                 gint       x,
+                                 gint       y,
+                                 gint       width,
+                                 gint       height)
 {
   cairo_region_t *old_region, *new_region;
   GdkWindowImplClass *impl_class;
   gboolean expose;
-  int old_x, old_y, old_abs_x, old_abs_y;
-  int dx, dy;
   gboolean is_resize;
 
   expose = FALSE;
   old_region = NULL;
 
-  old_x = window->x;
-  old_y = window->y;
-
   is_resize = (width != -1) || (height != -1);
 
   if (gdk_window_is_viewable (window) &&
@@ -5932,12 +5925,6 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
   impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
   impl_class->move_resize (window, with_move, x, y, width, height);
 
-  dx = window->x - old_x;
-  dy = window->y - old_y;
-
-  old_abs_x = window->abs_x;
-  old_abs_y = window->abs_y;
-
   /* Avoid recomputing for pure toplevel moves, for performance reasons */
   if (is_resize)
     recompute_visible_regions (window, TRUE, FALSE);
@@ -5947,8 +5934,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
       new_region = cairo_region_copy (window->clip_region);
 
       /* This is the newly exposed area (due to any resize),
-       * X will expose it, but lets do that without the
-       * roundtrip
+       * X will expose it, but lets do that without the roundtrip
        */
       cairo_region_subtract (new_region, old_region);
       gdk_window_invalidate_region_full (window, new_region, TRUE, CLEAR_BG_WINCLEARED);
@@ -9059,14 +9045,11 @@ do_synthesize_crossing_event (gpointer data)
 void
 _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window)
 {
-  GdkDisplay *display;
   GdkWindow *toplevel;
 
   if (_gdk_native_windows)
     return; /* We use the native crossing events if all native */
 
-  display = gdk_window_get_display (changed_window);
-
   toplevel = get_event_toplevel (changed_window);
 
   if (!toplevel->synthesize_crossing_event_queued)
diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c
index 3282449..6cc43a6 100644
--- a/gdk/x11/gdkcursor-x11.c
+++ b/gdk/x11/gdkcursor-x11.c
@@ -429,7 +429,7 @@ update_cursor (gpointer data,
 
   if (!cursor)
     return;
-  
+
   _gdk_x11_cursor_update_theme (cursor);
 }
 
@@ -437,18 +437,18 @@ update_cursor (gpointer data,
  * gdk_x11_display_set_cursor_theme:
  * @display: a #GdkDisplay
  * @theme: the name of the cursor theme to use, or %NULL to unset
- *         a previously set value 
+ *         a previously set value
  * @size: the cursor size to use, or 0 to keep the previous size
  *
  * Sets the cursor theme from which the images for cursor
- * should be taken. 
- * 
- * If the windowing system supports it, existing cursors created 
- * with gdk_cursor_new(), gdk_cursor_new_for_display() and 
- * gdk_cursor_new_for_name() are updated to reflect the theme 
+ * should be taken.
+ *
+ * If the windowing system supports it, existing cursors created
+ * with gdk_cursor_new(), gdk_cursor_new_for_display() and
+ * gdk_cursor_new_for_name() are updated to reflect the theme
  * change. Custom cursors constructed with
  * gdk_cursor_new_from_pixbuf() will have to be handled
- * by the application (GTK+ applications can learn about 
+ * by the application (GTK+ applications can learn about
  * cursor theme changes by listening for change notification
  * for the corresponding #GtkSetting).
  *
@@ -459,14 +459,12 @@ gdk_x11_display_set_cursor_theme (GdkDisplay  *display,
                                   const gchar *theme,
                                   const gint   size)
 {
-  GdkX11Display *display_x11;
   Display *xdisplay;
   gchar *old_theme;
   gint old_size;
 
   g_return_if_fail (GDK_IS_DISPLAY (display));
 
-  display_x11 = GDK_X11_DISPLAY (display);
   xdisplay = GDK_DISPLAY_XDISPLAY (display);
 
   old_theme = XcursorGetTheme (xdisplay);
@@ -482,13 +480,13 @@ gdk_x11_display_set_cursor_theme (GdkDisplay  *display,
   XcursorSetTheme (xdisplay, theme);
   if (size > 0)
     XcursorSetDefaultSize (xdisplay, size);
-    
+
   g_slist_foreach (cursor_cache, update_cursor, NULL);
 }
 
 #else
 
-static GdkPixbuf*  
+static GdkPixbuf*
 gdk_x11_cursor_get_image (GdkCursor *cursor)
 {
   return NULL;
diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c
index bf81675..1d59761 100644
--- a/gdk/x11/gdkdevice-xi.c
+++ b/gdk/x11/gdkdevice-xi.c
@@ -497,13 +497,11 @@ gdk_x11_device_xi_select_window_events (GdkDevice    *device,
                                         GdkEventMask  event_mask)
 {
   XEventClass event_classes[MAX_DEVICE_CLASSES];
-  GdkX11DeviceXI *device_xi;
   gint num_classes;
 
   event_mask |= (GDK_PROXIMITY_IN_MASK |
                  GDK_PROXIMITY_OUT_MASK);
 
-  device_xi = GDK_X11_DEVICE_XI (device);
   find_events (device, event_mask, event_classes, &num_classes);
 
   XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (window),
@@ -590,14 +588,12 @@ _gdk_x11_device_xi_translate_axes (GdkDevice *device,
                                    gdouble   *x,
                                    gdouble   *y)
 {
-  GdkX11DeviceXI *device_xi;
   GdkWindow *impl_window;
   gdouble root_x, root_y;
   gdouble temp_x, temp_y;
   gint n_axes;
   gint i;
 
-  device_xi = GDK_X11_DEVICE_XI (device);
   impl_window = _gdk_window_get_impl_window (window);
   temp_x = temp_y = 0;
 
diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c
index 951bcae..9315e45 100644
--- a/gdk/x11/gdkdevicemanager-core-x11.c
+++ b/gdk/x11/gdkdevicemanager-core-x11.c
@@ -415,7 +415,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
 {
   GdkX11DeviceManagerCore *device_manager;
   GdkWindow *window;
-  GdkWindowImplX11 *window_impl = NULL;
   gboolean return_val;
   GdkToplevelX11 *toplevel = NULL;
   GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
@@ -431,7 +430,6 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator,
         return FALSE;
 
       toplevel = _gdk_x11_window_get_toplevel (window);
-      window_impl = GDK_WINDOW_IMPL_X11 (window->impl);
       g_object_ref (window);
     }
 
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index fa04873..6fcc172 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -411,10 +411,8 @@ gdk_x11_device_manager_xi2_constructed (GObject *object)
   /* Initialize devices list */
   for (i = 0; i < ndevices; i++)
     {
-      GdkDevice *device;
-
       dev = &info[i];
-      device = add_device (device_manager, dev, FALSE);
+      add_device (device_manager, dev, FALSE);
 
       if (dev->use == XIMasterPointer ||
           dev->use == XIMasterKeyboard)
@@ -567,7 +565,6 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
 {
   GdkDisplay *display;
   Display *xdisplay;
-  GdkDevice *device;
   XIDeviceInfo *info;
   int ndevices;
   gint i;
@@ -580,7 +577,7 @@ handle_hierarchy_changed (GdkX11DeviceManagerXI2 *device_manager,
       if (ev->info[i].flags & XIDeviceEnabled)
         {
           info = XIQueryDevice (xdisplay, ev->info[i].deviceid, &ndevices);
-          device = add_device (device_manager, &info[0], TRUE);
+          add_device (device_manager, &info[0], TRUE);
           XIFreeDeviceInfo (info);
         }
       else if (ev->info[i].flags & XIDeviceDisabled)
@@ -870,18 +867,14 @@ translate_axes (GdkDevice       *device,
                 XIValuatorState *valuators)
 {
   guint n_axes, i;
-  gint width, height;
   gdouble *axes;
-  double *vals;
+  gdouble *vals;
 
   g_object_get (device, "n-axes", &n_axes, NULL);
 
   axes = g_new0 (gdouble, n_axes);
   vals = valuators->values;
 
-  width = gdk_window_get_width (window);
-  height = gdk_window_get_height (window);
-
   for (i = 0; i < valuators->mask_len * 8; i++)
     {
       GdkAxisUse use;
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 6745e3d..aa731db 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -272,7 +272,6 @@ _gdk_x11_window_translate (GdkWindow      *window,
   GC xgc;
   GdkRectangle extents;
   GdkWindow *parent;
-  int px, py;
 
   /* We need to get data from subwindows here, because we might have
    * shaped a native window over the moving region (with bg none,
@@ -281,7 +280,6 @@ _gdk_x11_window_translate (GdkWindow      *window,
    * so we copy from the toplevel with INCLUDE_INFERIORS.
    */
   parent = window;
-  px = py = 0;
   while (parent->parent != NULL &&
          parent->parent->window_type != GDK_WINDOW_ROOT)
     {



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