[mutter] Fix set but not used variables



commit 4f079affea4a9d55a97c7150c2973c69166bc64e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Jan 24 15:44:12 2011 -0500

    Fix set but not used variables
    
    GCC 4.6 warns about variables that are set but never subsequently
    used; fix all such instances.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=640469

 src/compositor/meta-window-actor.c |    9 ---------
 src/core/boxes.c                   |    2 --
 src/core/main.c                    |    4 +---
 src/core/screen.c                  |    7 +++----
 src/core/testasyncgetprop.c        |   13 ++++++-------
 src/core/window.c                  |    9 +++------
 src/ui/tabpopup.c                  |    2 --
 src/ui/testgradient.c              |   36 +++++++++++++++++-------------------
 8 files changed, 30 insertions(+), 52 deletions(-)
---
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index 942b86b..e3c0cd9 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -301,7 +301,6 @@ window_decorated_notify (MetaWindow *mw,
   MetaDisplay            *display  = meta_screen_get_display (screen);
   Display                *xdisplay = meta_display_get_xdisplay (display);
   Window                  new_xwindow;
-  MetaCompScreen         *info;
   XWindowAttributes       attrs;
 
   /*
@@ -317,8 +316,6 @@ window_decorated_notify (MetaWindow *mw,
 
   meta_window_actor_detach (self);
 
-  info = meta_screen_get_compositor_data (screen);
-
   /*
    * First of all, clean up any resources we are currently using and will
    * be replacing.
@@ -362,9 +359,6 @@ meta_window_actor_constructed (GObject *object)
   Window                  xwindow  = priv->xwindow;
   Display                *xdisplay = meta_display_get_xdisplay (display);
   XRenderPictFormat      *format;
-  MetaCompositor         *compositor;
-
-  compositor = meta_display_get_compositor (display);
 
 #ifdef HAVE_SHAPE
   /* Listen for ShapeNotify events on the window */
@@ -1777,7 +1771,6 @@ check_needs_pixmap (MetaWindowActor *self)
   MetaCompScreen      *info     = meta_screen_get_compositor_data (screen);
   MetaCompositor      *compositor;
   Window               xwindow  = priv->xwindow;
-  gboolean             full     = FALSE;
 
   if (!priv->needs_pixmap)
     return;
@@ -1850,8 +1843,6 @@ check_needs_pixmap (MetaWindowActor *self)
                     NULL);
 
       meta_window_actor_update_bounding_region (self, pxm_width, pxm_height);
-
-      full = TRUE;
     }
 
   meta_error_trap_pop (display);
diff --git a/src/core/boxes.c b/src/core/boxes.c
index a1528a2..57df284 100644
--- a/src/core/boxes.c
+++ b/src/core/boxes.c
@@ -340,7 +340,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
    */
 
   /* First, the x direction */
-  int adjust = 0;
   switch (gravity)
     {
     case NorthWestGravity:
@@ -373,7 +372,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
   rect->width = new_width;
   
   /* Next, the y direction */
-  adjust = 0;
   switch (gravity)
     {
     case NorthWestGravity:
diff --git a/src/core/main.c b/src/core/main.c
index 9efb549..1ea6f5d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -442,9 +442,7 @@ sigterm_handler (int signum)
 {
   if (sigterm_pipe_fds[1] >= 0)
     {
-      int dummy;
-
-      dummy = write (sigterm_pipe_fds[1], "", 1);
+      (void) write (sigterm_pipe_fds[1], "", 1);
       close (sigterm_pipe_fds[1]);
       sigterm_pipe_fds[1] = -1;
     }
diff --git a/src/core/screen.c b/src/core/screen.c
index 9d9ea0d..50ebeeb 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -951,11 +951,10 @@ meta_screen_manage_all_windows (MetaScreen *screen)
   for (list = windows; list != NULL; list = list->next)
     {
       WindowInfo *info = list->data;
-      MetaWindow *window;
 
-      window = meta_window_new_with_attrs (screen->display, info->xwindow, TRUE,
-                                           META_COMP_EFFECT_NONE,
-                                           &info->attrs);
+      meta_window_new_with_attrs (screen->display, info->xwindow, TRUE,
+                                  META_COMP_EFFECT_NONE,
+                                  &info->attrs);
     }
   meta_stack_thaw (screen->stack);
 
diff --git a/src/core/testasyncgetprop.c b/src/core/testasyncgetprop.c
index 782d0b1..028276c 100644
--- a/src/core/testasyncgetprop.c
+++ b/src/core/testasyncgetprop.c
@@ -416,7 +416,6 @@ run_speed_comparison (Display *xdisplay,
       
       while ((task = ag_get_next_completed_task (xdisplay)))
         {
-          int result;
           Atom actual_type;
           int actual_format;
           unsigned long n_items;
@@ -426,12 +425,12 @@ run_speed_comparison (Display *xdisplay,
           assert (ag_task_have_reply (task));
           
           data = NULL;
-          result = ag_task_get_reply_and_free (task,
-                                               &actual_type,
-                                               &actual_format,
-                                               &n_items,
-                                               &bytes_after,
-                                               &data);
+          ag_task_get_reply_and_free (task,
+                                      &actual_type,
+                                      &actual_format,
+                                      &n_items,
+                                      &bytes_after,
+                                      &data);
           
           if (data)
             XFree (data);
diff --git a/src/core/window.c b/src/core/window.c
index ee2f48a..67cfa3a 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -5970,12 +5970,12 @@ meta_window_client_message (MetaWindow *window,
   else if (event->xclient.message_type ==
            display->atom__NET_MOVERESIZE_WINDOW)
     {
-      int gravity, source;
+      int gravity;
       guint value_mask;
 
       gravity = (event->xclient.data.l[0] & 0xff);
       value_mask = (event->xclient.data.l[0] & 0xf00) >> 8;
-      source = (event->xclient.data.l[0] & 0xf000) >> 12;
+      /* source = (event->xclient.data.l[0] & 0xf000) >> 12; */
 
       if (gravity == 0)
         gravity = window->size_hints.win_gravity;
@@ -6018,7 +6018,6 @@ meta_window_client_message (MetaWindow *window,
   else if (event->xclient.message_type ==
            display->atom__NET_WM_FULLSCREEN_MONITORS)
     {
-      MetaClientType source_indication;
       gulong top, bottom, left, right;
 
       meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'\n",
@@ -6028,7 +6027,7 @@ meta_window_client_message (MetaWindow *window,
       bottom = event->xclient.data.l[1];
       left = event->xclient.data.l[2];
       right = event->xclient.data.l[3];
-      source_indication = event->xclient.data.l[4];
+      /* source_indication = event->xclient.data.l[4]; */
 
       meta_window_update_fullscreen_monitors (window, top, bottom, left, right);
     }
@@ -7638,7 +7637,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
 {
   MetaRectangle  titlebar_rect;
   GList         *onscreen_region;
-  int            titlebar_size;
   gboolean       is_onscreen;
 
   const int min_height_needed  = 8;
@@ -7652,7 +7650,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
   /* Get the rectangle corresponding to the titlebar */
   meta_window_get_outer_rect (window, &titlebar_rect);
   titlebar_rect.height = window->frame->child_y;
-  titlebar_size = meta_rectangle_area (&titlebar_rect);
 
   /* Run through the spanning rectangles for the screen and see if one of
    * them overlaps with the titlebar sufficiently to consider it onscreen.
diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c
index 5136cb5..2fe8101 100644
--- a/src/ui/tabpopup.c
+++ b/src/ui/tabpopup.c
@@ -707,7 +707,6 @@ meta_select_image_draw (GtkWidget *widget,
       GtkMisc *misc;
       GtkRequisition requisition;
       GtkStyleContext *context;
-      GdkWindow *window;
       GdkRGBA color;
       int x, y, w, h;
       gint xpad, ypad;
@@ -728,7 +727,6 @@ meta_select_image_draw (GtkWidget *widget,
       w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1;
       h = requisition.height - OUTSIDE_SELECT_RECT * 2 - 1;
 
-      window = gtk_widget_get_window (widget);
       context = gtk_widget_get_style_context (widget);
 
       gtk_style_context_set_state (context,
diff --git a/src/ui/testgradient.c b/src/ui/testgradient.c
index a07c77d..bf3b4e4 100644
--- a/src/ui/testgradient.c
+++ b/src/ui/testgradient.c
@@ -275,31 +275,29 @@ create_gradient_window (const char *title,
 static void
 meta_gradient_test (void)
 {
-  GtkWidget *window;
+  create_gradient_window ("Simple vertical",
+                          render_vertical_func);
 
-  window = create_gradient_window ("Simple vertical",
-                                   render_vertical_func);
-  
-  window = create_gradient_window ("Simple horizontal",
-                                   render_horizontal_func);
+  create_gradient_window ("Simple horizontal",
+                          render_horizontal_func);
 
-  window = create_gradient_window ("Simple diagonal",
-                                   render_diagonal_func);
+  create_gradient_window ("Simple diagonal",
+                          render_diagonal_func);
 
-  window = create_gradient_window ("Multi vertical",
-                                   render_vertical_multi_func);
-  
-  window = create_gradient_window ("Multi horizontal",
-                                   render_horizontal_multi_func);
+  create_gradient_window ("Multi vertical",
+                          render_vertical_multi_func);
+
+  create_gradient_window ("Multi horizontal",
+                          render_horizontal_multi_func);
 
-  window = create_gradient_window ("Multi diagonal",
-                                   render_diagonal_multi_func);
+  create_gradient_window ("Multi diagonal",
+                          render_diagonal_multi_func);
 
-  window = create_gradient_window ("Interwoven",
-                                   render_interwoven_func);
+  create_gradient_window ("Interwoven",
+                          render_interwoven_func);
 
-  window = create_gradient_window ("Simple diagonal with horizontal multi alpha",
-                                   render_diagonal_alpha_func);
+  create_gradient_window ("Simple diagonal with horizontal multi alpha",
+                          render_diagonal_alpha_func);
 
 }
 



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