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
This commit is contained in:
Owen W. Taylor 2011-01-24 15:44:12 -05:00
parent b4888103a6
commit 4f079affea
8 changed files with 30 additions and 52 deletions

View File

@ -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);

View File

@ -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:

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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.

View File

@ -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,

View File

@ -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);
window = create_gradient_window ("Multi diagonal",
render_diagonal_multi_func);
create_gradient_window ("Multi horizontal",
render_horizontal_multi_func);
window = create_gradient_window ("Interwoven",
render_interwoven_func);
create_gradient_window ("Multi diagonal",
render_diagonal_multi_func);
window = create_gradient_window ("Simple diagonal with horizontal multi alpha",
render_diagonal_alpha_func);
create_gradient_window ("Interwoven",
render_interwoven_func);
create_gradient_window ("Simple diagonal with horizontal multi alpha",
render_diagonal_alpha_func);
}