1
0
Fork 0

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); MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
Window new_xwindow; Window new_xwindow;
MetaCompScreen *info;
XWindowAttributes attrs; XWindowAttributes attrs;
/* /*
@ -317,8 +316,6 @@ window_decorated_notify (MetaWindow *mw,
meta_window_actor_detach (self); 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 * First of all, clean up any resources we are currently using and will
* be replacing. * be replacing.
@ -362,9 +359,6 @@ meta_window_actor_constructed (GObject *object)
Window xwindow = priv->xwindow; Window xwindow = priv->xwindow;
Display *xdisplay = meta_display_get_xdisplay (display); Display *xdisplay = meta_display_get_xdisplay (display);
XRenderPictFormat *format; XRenderPictFormat *format;
MetaCompositor *compositor;
compositor = meta_display_get_compositor (display);
#ifdef HAVE_SHAPE #ifdef HAVE_SHAPE
/* Listen for ShapeNotify events on the window */ /* Listen for ShapeNotify events on the window */
@ -1777,7 +1771,6 @@ check_needs_pixmap (MetaWindowActor *self)
MetaCompScreen *info = meta_screen_get_compositor_data (screen); MetaCompScreen *info = meta_screen_get_compositor_data (screen);
MetaCompositor *compositor; MetaCompositor *compositor;
Window xwindow = priv->xwindow; Window xwindow = priv->xwindow;
gboolean full = FALSE;
if (!priv->needs_pixmap) if (!priv->needs_pixmap)
return; return;
@ -1850,8 +1843,6 @@ check_needs_pixmap (MetaWindowActor *self)
NULL); NULL);
meta_window_actor_update_bounding_region (self, pxm_width, pxm_height); meta_window_actor_update_bounding_region (self, pxm_width, pxm_height);
full = TRUE;
} }
meta_error_trap_pop (display); meta_error_trap_pop (display);

View file

@ -340,7 +340,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
*/ */
/* First, the x direction */ /* First, the x direction */
int adjust = 0;
switch (gravity) switch (gravity)
{ {
case NorthWestGravity: case NorthWestGravity:
@ -373,7 +372,6 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
rect->width = new_width; rect->width = new_width;
/* Next, the y direction */ /* Next, the y direction */
adjust = 0;
switch (gravity) switch (gravity)
{ {
case NorthWestGravity: case NorthWestGravity:

View file

@ -442,9 +442,7 @@ sigterm_handler (int signum)
{ {
if (sigterm_pipe_fds[1] >= 0) if (sigterm_pipe_fds[1] >= 0)
{ {
int dummy; (void) write (sigterm_pipe_fds[1], "", 1);
dummy = write (sigterm_pipe_fds[1], "", 1);
close (sigterm_pipe_fds[1]); close (sigterm_pipe_fds[1]);
sigterm_pipe_fds[1] = -1; sigterm_pipe_fds[1] = -1;
} }

View file

@ -951,9 +951,8 @@ meta_screen_manage_all_windows (MetaScreen *screen)
for (list = windows; list != NULL; list = list->next) for (list = windows; list != NULL; list = list->next)
{ {
WindowInfo *info = list->data; WindowInfo *info = list->data;
MetaWindow *window;
window = meta_window_new_with_attrs (screen->display, info->xwindow, TRUE, meta_window_new_with_attrs (screen->display, info->xwindow, TRUE,
META_COMP_EFFECT_NONE, META_COMP_EFFECT_NONE,
&info->attrs); &info->attrs);
} }

View file

@ -416,7 +416,6 @@ run_speed_comparison (Display *xdisplay,
while ((task = ag_get_next_completed_task (xdisplay))) while ((task = ag_get_next_completed_task (xdisplay)))
{ {
int result;
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
unsigned long n_items; unsigned long n_items;
@ -426,7 +425,7 @@ run_speed_comparison (Display *xdisplay,
assert (ag_task_have_reply (task)); assert (ag_task_have_reply (task));
data = NULL; data = NULL;
result = ag_task_get_reply_and_free (task, ag_task_get_reply_and_free (task,
&actual_type, &actual_type,
&actual_format, &actual_format,
&n_items, &n_items,

View file

@ -5970,12 +5970,12 @@ meta_window_client_message (MetaWindow *window,
else if (event->xclient.message_type == else if (event->xclient.message_type ==
display->atom__NET_MOVERESIZE_WINDOW) display->atom__NET_MOVERESIZE_WINDOW)
{ {
int gravity, source; int gravity;
guint value_mask; guint value_mask;
gravity = (event->xclient.data.l[0] & 0xff); gravity = (event->xclient.data.l[0] & 0xff);
value_mask = (event->xclient.data.l[0] & 0xf00) >> 8; 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) if (gravity == 0)
gravity = window->size_hints.win_gravity; gravity = window->size_hints.win_gravity;
@ -6018,7 +6018,6 @@ meta_window_client_message (MetaWindow *window,
else if (event->xclient.message_type == else if (event->xclient.message_type ==
display->atom__NET_WM_FULLSCREEN_MONITORS) display->atom__NET_WM_FULLSCREEN_MONITORS)
{ {
MetaClientType source_indication;
gulong top, bottom, left, right; gulong top, bottom, left, right;
meta_verbose ("_NET_WM_FULLSCREEN_MONITORS request for window '%s'\n", 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]; bottom = event->xclient.data.l[1];
left = event->xclient.data.l[2]; left = event->xclient.data.l[2];
right = event->xclient.data.l[3]; 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); meta_window_update_fullscreen_monitors (window, top, bottom, left, right);
} }
@ -7638,7 +7637,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
{ {
MetaRectangle titlebar_rect; MetaRectangle titlebar_rect;
GList *onscreen_region; GList *onscreen_region;
int titlebar_size;
gboolean is_onscreen; gboolean is_onscreen;
const int min_height_needed = 8; const int min_height_needed = 8;
@ -7652,7 +7650,6 @@ meta_window_titlebar_is_onscreen (MetaWindow *window)
/* Get the rectangle corresponding to the titlebar */ /* Get the rectangle corresponding to the titlebar */
meta_window_get_outer_rect (window, &titlebar_rect); meta_window_get_outer_rect (window, &titlebar_rect);
titlebar_rect.height = window->frame->child_y; 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 /* Run through the spanning rectangles for the screen and see if one of
* them overlaps with the titlebar sufficiently to consider it onscreen. * them overlaps with the titlebar sufficiently to consider it onscreen.

View file

@ -707,7 +707,6 @@ meta_select_image_draw (GtkWidget *widget,
GtkMisc *misc; GtkMisc *misc;
GtkRequisition requisition; GtkRequisition requisition;
GtkStyleContext *context; GtkStyleContext *context;
GdkWindow *window;
GdkRGBA color; GdkRGBA color;
int x, y, w, h; int x, y, w, h;
gint xpad, ypad; gint xpad, ypad;
@ -728,7 +727,6 @@ meta_select_image_draw (GtkWidget *widget,
w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1; w = requisition.width - OUTSIDE_SELECT_RECT * 2 - 1;
h = requisition.height - 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); context = gtk_widget_get_style_context (widget);
gtk_style_context_set_state (context, gtk_style_context_set_state (context,

View file

@ -275,30 +275,28 @@ create_gradient_window (const char *title,
static void static void
meta_gradient_test (void) meta_gradient_test (void)
{ {
GtkWidget *window; create_gradient_window ("Simple vertical",
window = create_gradient_window ("Simple vertical",
render_vertical_func); render_vertical_func);
window = create_gradient_window ("Simple horizontal", create_gradient_window ("Simple horizontal",
render_horizontal_func); render_horizontal_func);
window = create_gradient_window ("Simple diagonal", create_gradient_window ("Simple diagonal",
render_diagonal_func); render_diagonal_func);
window = create_gradient_window ("Multi vertical", create_gradient_window ("Multi vertical",
render_vertical_multi_func); render_vertical_multi_func);
window = create_gradient_window ("Multi horizontal", create_gradient_window ("Multi horizontal",
render_horizontal_multi_func); render_horizontal_multi_func);
window = create_gradient_window ("Multi diagonal", create_gradient_window ("Multi diagonal",
render_diagonal_multi_func); render_diagonal_multi_func);
window = create_gradient_window ("Interwoven", create_gradient_window ("Interwoven",
render_interwoven_func); render_interwoven_func);
window = create_gradient_window ("Simple diagonal with horizontal multi alpha", create_gradient_window ("Simple diagonal with horizontal multi alpha",
render_diagonal_alpha_func); render_diagonal_alpha_func);
} }