Fix new gcc 4.6 warnings
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 25 Jan 2011 20:16:01 +0000 (15:16 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 25 Jan 2011 20:16:01 +0000 (15:16 -0500)
simple-client.c:156:10: warning: variable ‘ar’ set but not used [-Wunused-but-set-variable]

etc.

clients/dnd.c
clients/gears.c
clients/image.c
clients/simple-client.c
clients/terminal.c
clients/view.c
clients/window.c

index 42233af..1625ffd 100644 (file)
@@ -678,7 +678,6 @@ int
 main(int argc, char *argv[])
 {
        struct display *d;
-       struct dnd *dnd;
 
        d = display_create(&argc, &argv, option_entries);
        if (d == NULL) {
@@ -688,7 +687,7 @@ main(int argc, char *argv[])
 
        display_set_global_handler(d, global_handler);
 
-       dnd = dnd_create (d);
+       dnd_create(d);
 
        display_run(d);
 
index 25e1fcb..5ae2a95 100644 (file)
@@ -421,14 +421,13 @@ gears_create(struct display *display)
 int main(int argc, char *argv[])
 {
        struct display *d;
-       struct gears *gears;
 
        d = display_create(&argc, &argv, NULL);
        if (d == NULL) {
                fprintf(stderr, "failed to create display: %m\n");
                return -1;
        }
-       gears = gears_create(d);
+       gears_create(d);
        display_run(d);
 
        return 0;
index b528ed6..3eada1e 100644 (file)
@@ -250,11 +250,8 @@ main(int argc, char *argv[])
                return -1;
        }
 
-       for (i = 1; i < argc; i++) {
-               struct image *image;
-
-               image = image_create (d, i, argv[i]);
-       }
+       for (i = 1; i < argc; i++)
+               image_create (d, i, argv[i]);
 
        display_run(d);
 
index 3a9b4a1..2524c8e 100644 (file)
@@ -153,7 +153,6 @@ create_shader(struct window *window, const char *source, GLenum shader_type)
 static void
 init_gl(struct window *window)
 {
-       GLfloat ar;
        GLuint frag, vert;
        GLint status;
 
@@ -163,7 +162,6 @@ init_gl(struct window *window)
        glGenRenderbuffers(1, &window->gl.color_rbo);
 
        glViewport(0, 0, window->geometry.width, window->geometry.height);
-       ar = (GLfloat)window->geometry.width / (GLfloat)window->geometry.height;
 
        frag = create_shader(window, frag_shader_text, GL_FRAGMENT_SHADER);
        vert = create_shader(window, vert_shader_text, GL_VERTEX_SHADER);
index cb4d861..dfddb7f 100644 (file)
@@ -666,7 +666,7 @@ static void
 terminal_shift_line(struct terminal *terminal, int d)
 {
        union utf8_char *row;
-       struct attr *attr_row, attr;
+       struct attr *attr_row;
        
        row = terminal_get_row(terminal, terminal->row);
        attr_row = terminal_get_attr_row(terminal, terminal->row);
@@ -681,7 +681,6 @@ terminal_shift_line(struct terminal *terminal, int d)
                memmove(&row[terminal->column],
                        &row[terminal->column + d],
                        (terminal->width - terminal->column - d) * sizeof(union utf8_char));
-               attr = attr_row[terminal->width - 1];
                memmove(&attr_row[terminal->column], &attr_row[terminal->column + d],
                        (terminal->width - terminal->column - d) * sizeof(struct attr));
                memset(&row[terminal->width - d], 0, d * sizeof(union utf8_char));
@@ -704,7 +703,7 @@ terminal_resize(struct terminal *terminal, int width, int height)
        struct attr *data_attr;
        char *tab_ruler;
        int data_pitch, attr_pitch;
-       int i, l, total_rows, start;
+       int i, l, total_rows;
        struct rectangle allocation;
        struct winsize ws;
        int32_t pixel_width, pixel_height;
@@ -744,10 +743,8 @@ terminal_resize(struct terminal *terminal, int width, int height)
 
                if (terminal->height > height) {
                        total_rows = height;
-                       start = terminal->height - height;
                } else {
                        total_rows = terminal->height;
-                       start = 0;
                }
 
                for (i = 0; i < total_rows; i++) {
index 9512dc4..88c59ad 100644 (file)
@@ -209,11 +209,8 @@ main(int argc, char *argv[])
                return -1;
        }
 
-       for (i = 1; i < argc; i++) {
-               struct view *view;
-
-               view = view_create (d, i, argv[i]);
-       }
+       for (i = 1; i < argc; i++)
+               view_create (d, i, argv[i]);
 
        display_run(d);
 
index 0278d08..7567cce 100644 (file)
@@ -865,15 +865,13 @@ window_handle_motion(void *data, struct wl_input_device *input_device,
 {
        struct input *input = data;
        struct window *window = input->pointer_focus;
-       int location, pointer = POINTER_LEFT_PTR;
+       int pointer = POINTER_LEFT_PTR;
 
        input->x = x;
        input->y = y;
        input->sx = sx;
        input->sy = sy;
 
-       location = get_pointer_location(window, input->sx, input->sy);
-
        if (window->motion_handler)
                pointer = (*window->motion_handler)(window, input, time,
                                                    x, y, sx, sy,