Skip to content

Commit

Permalink
Drop unused variables and code.
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
zas committed Aug 30, 2012
1 parent a528475 commit 177aaa7
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions src/pan-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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));

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 177aaa7

Please sign in to comment.