From 177aaa75226e85083c33f15d7f27c728f5051694 Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 30 Aug 2012 14:30:57 +0200 Subject: [PATCH] Drop unused variables and code. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit pan-view.c: In function ‘pan_grid_build’: pan-view.c:753:14: attention : variable ‘ah’ set but not used [-Wunused-but-set-variable] pan-view.c:753:10: attention : variable ‘aw’ set but not used [-Wunused-but-set-variable] pan-view.c: In function ‘pan_window_key_press_cb’: pan-view.c:1217:2: attention : suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] pan-view.c:1271:8: attention : variable ‘n’ set but not used [-Wunused-but-set-variable] pan-view.c: In function ‘pan_window_set_dnd_data’: pan-view.c:2939:8: attention : unused variable ‘len’ [-Wunused-variable] pan-view.c:2938:10: attention : unused variable ‘text’ [-Wunused-variable] --- src/pan-view.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/src/pan-view.c b/src/pan-view.c index c6facb9c..ce741f5c 100644 --- a/src/pan-view.c +++ b/src/pan-view.c @@ -748,9 +748,6 @@ static void pan_grid_build(PanWindow *pw, gint width, gint height, gint grid_siz gint col, row; gint cw, ch; gint l; - gdouble total; - gdouble s; - gdouble aw, ah; gint i, j; pan_grid_clear(pw); @@ -759,12 +756,6 @@ static void pan_grid_build(PanWindow *pw, gint width, gint height, gint grid_siz if (l < 1) return; - total = (gdouble)width * (gdouble)height / (gdouble)l; - s = sqrt(total); - - aw = (gdouble)width / s; - ah = (gdouble)height / s; - col = (gint)(sqrt((gdouble)l / grid_size) * width / height + 0.999); col = CLAMP(col, 1, l / grid_size + 1); row = (gint)((gdouble)l / grid_size / col); @@ -1214,7 +1205,7 @@ static gboolean pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, g fd = pan_menu_click_fd(pw); imd_widget = gtk_container_get_focus_child(GTK_CONTAINER(pw->imd->widget)); - focused = (pw->fs || imd_widget && gtk_widget_has_focus(imd_widget)); + focused = (pw->fs || (imd_widget && gtk_widget_has_focus(imd_widget))); on_entry = (gtk_widget_has_focus(pw->path_entry) || gtk_widget_has_focus(pw->search_entry)); @@ -1268,40 +1259,19 @@ static gboolean pan_window_key_press_cb(GtkWidget *widget, GdkEventKey *event, g if (event->state & GDK_CONTROL_MASK) { - gint n = -1; - stop_signal = TRUE; switch (event->keyval) { case '1': - n = 0; - break; case '2': - n = 1; - break; case '3': - n = 2; - break; case '4': - n = 3; - break; case '5': - n = 4; - break; case '6': - n = 5; - break; case '7': - n = 6; - break; case '8': - n = 7; - break; case '9': - n = 8; - break; case '0': - n = 9; break; case 'C': case 'c': if (fd) file_util_copy(fd, NULL, NULL, GTK_WIDGET(pr)); @@ -2935,8 +2905,6 @@ static void pan_window_set_dnd_data(GtkWidget *widget, GdkDragContext *context, fd = pan_menu_click_fd(pw); if (fd) { - gchar *text = NULL; - gint len; GList *list; list = g_list_append(NULL, fd); -- 2.20.1