Commit: 8a45ba86ea7375d2a3f5f17f215621b574f04698
Parent: 99db1266c053bc8c1a7daa8c921f4b8e1f1afc38
Author: 0x766F6964
Date: Sun, 20 Oct 2019 11:26:50 -0600
remove always false checks
Diffstat:
4 files changed, 3 insertions(+), 66 deletions(-)
diff --git a/bfu.c b/bfu.c
@@ -554,8 +554,7 @@ static void menu_func(struct window *win, struct links_event *ev, int fwd)
break;
case EV_MOUSE:
if ((ev->b & BM_ACT) == B_MOVE) break;
- if ((ev->b & BM_BUTT) == B_FOURTH
- || (ev->b & BM_BUTT) == B_FIFTH) {
+ if ((ev->b & BM_BUTT) == B_FIFTH) {
if ((ev->b & BM_ACT) == B_DOWN) goto go_lr;
break;
}
@@ -846,10 +845,6 @@ static void mainmenu_func(struct window *win, struct links_event *ev, int fwd)
case EV_MOUSE:
in_menu = ev->x >= 0 && ev->x < win->term->x && ev->y >= 0 && ev->y < LL;
if ((ev->b & BM_ACT) == B_MOVE) break;
- if ((ev->b & BM_BUTT) == B_FOURTH) {
- if ((ev->b & BM_ACT) == B_DOWN) goto go_left;
- break;
- }
if ((ev->b & BM_BUTT) == B_FIFTH) {
if ((ev->b & BM_ACT) == B_DOWN) goto go_right;
break;
@@ -887,7 +882,6 @@ static void mainmenu_func(struct window *win, struct links_event *ev, int fwd)
select_mainmenu(win->term, menu);
break;
} else if (ev->x == KBD_LEFT) {
- go_left:
if (!menu->selected--) menu->selected = menu->ni - 1;
s = 1;
if (fwd) s = 2;
@@ -1452,10 +1446,6 @@ void dialog_func(struct window *win, struct links_event *ev, int fwd)
break;
case EV_MOUSE:
if ((ev->b & BM_ACT) == B_MOVE) break;
- if ((ev->b & BM_BUTT) == B_FOURTH) {
- if ((ev->b & BM_ACT) == B_DOWN) goto go_prev;
- break;
- }
if ((ev->b & BM_BUTT) == B_FIFTH) {
if ((ev->b & BM_ACT) == B_DOWN) goto go_next;
break;
@@ -1675,7 +1665,6 @@ void dialog_func(struct window *win, struct links_event *ev, int fwd)
}
if (((ev->x == KBD_TAB && ev->y) || ev->x == KBD_UP
|| ev->x == KBD_LEFT) && dlg->n > 1) {
- go_prev:
x_display_dlg_item(dlg, &dlg->items[dlg->selected], 0);
if ((--dlg->selected) < 0) dlg->selected = dlg->n - 1;
x_display_dlg_item(dlg, &dlg->items[dlg->selected], 1);
diff --git a/listedit.c b/listedit.c
@@ -1502,38 +1502,6 @@ static int list_event_handler(struct dialog_data *dlg, struct links_event *ev)
break;
case EV_MOUSE:
- /* toggle select item */
- if ((ev->b & BM_ACT) == B_DOWN && (ev->b & BM_BUTT) == B_RIGHT) {
- int n,a;
- struct list *l=ld->win_offset;
-
- last_mouse_y=ev->y;
-
- if (
- (ev->y)<(dlg->y+DIALOG_TB)||
- (ev->y)>=(dlg->y+DIALOG_TB+gf_val(ld->n_items,G_BFU_FONT_SIZE*(ld->n_items)))||
- (ev->x)<(dlg->x+DIALOG_LB)||
- (ev->x)>(dlg->x+dlg->xw-DIALOG_LB-(F?sirka_scrollovadla:0))
- )break; /* out of the dialog */
-
- n=(ev->y-dlg->y-DIALOG_TB)/gf_val(1,G_BFU_FONT_SIZE);
- for (a=0;a<n;a++)
- {
- struct list *l1;
- l1=next_in_tree(ld,l); /* current item under the mouse pointer */
- if (l1==ld->list)goto break2;
- else l=l1;
- }
- /*a=ld->type?((l->depth)>=0?(l->depth)+1:0):(l->depth>=0);*/
-
- l->type^=4;
- ld->current_pos=l;
- ld->win_pos=n;
- rd.n=0;
- draw_to_window(dlg->win,redraw_list,&rd);
- draw_to_window(dlg->win,redraw_list_line,&rd); /* set cursor */
- return EVENT_PROCESSED;
- }
/* click on item */
if (((ev->b & BM_ACT) == B_DOWN || (ev->b & BM_ACT) == B_DRAG) && (ev->b & BM_BUTT) == B_LEFT) {
int n,a;
@@ -1674,7 +1642,7 @@ static int list_event_handler(struct dialog_data *dlg, struct links_event *ev)
}
/* mouse wheel */
- if ((ev->b & BM_ACT) == B_MOVE && ((ev->b & BM_BUTT) == B_WHEELUP || (ev->b & BM_BUTT) == B_WHEELDOWN || (ev->b & BM_BUTT) == B_WHEELDOWN1 || (ev->b & BM_BUTT) == B_WHEELUP1)) {
+ if ((ev->b & BM_BUTT) == B_WHEELDOWN1 || (ev->b & BM_BUTT) == B_WHEELUP1) {
int button=(int)ev->b&BM_BUTT;
last_mouse_y=ev->y;
@@ -1709,7 +1677,6 @@ static int list_event_handler(struct dialog_data *dlg, struct links_event *ev)
return EVENT_PROCESSED;
}
- break2:
break;
case EV_INIT:
diff --git a/view.c b/view.c
@@ -2340,20 +2340,12 @@ int field_op(struct session *ses, struct f_data_c *f, struct link *l, struct lin
y = 0;
}
- if ((ev->b & BM_BUTT) == B_WHEELUP)
- ydiff = form->rows >= 5 ? -5 : -form->rows;
- else if ((ev->b & BM_BUTT) == B_WHEELUP1)
+ if ((ev->b & BM_BUTT) == B_WHEELUP1)
ydiff = -1;
- else if ((ev->b & BM_BUTT) == B_WHEELDOWN)
- ydiff = form->rows >= 5 ? 5 : form->rows;
else if ((ev->b & BM_BUTT) == B_WHEELDOWN1)
ydiff = 1;
- else if ((ev->b & BM_BUTT) == B_WHEELLEFT)
- xdiff = form->cols >= 5 ? -5 : -form->cols;
else if ((ev->b & BM_BUTT) == B_WHEELLEFT1)
xdiff = -1;
- else if ((ev->b & BM_BUTT) == B_WHEELRIGHT)
- xdiff = form->cols >= 5 ? 5 : form->cols;
else if ((ev->b & BM_BUTT) == B_WHEELRIGHT1)
xdiff = 1;
diff --git a/view_gr.c b/view_gr.c
@@ -1108,18 +1108,10 @@ int g_frame_ev(struct session *ses, struct f_data_c *fd, struct links_event *ev)
}
return 1;
}
- if ((ev->b & BM_BUTT) == B_WHEELUP)
- return scroll_v(fd, -64);
- if ((ev->b & BM_BUTT) == B_WHEELDOWN)
- return scroll_v(fd, 64);
if ((ev->b & BM_BUTT) == B_WHEELUP1)
return scroll_v(fd, -16);
if ((ev->b & BM_BUTT) == B_WHEELDOWN1)
return scroll_v(fd, 16);
- if ((ev->b & BM_BUTT) == B_WHEELLEFT)
- return scroll_h(fd, -64);
- if ((ev->b & BM_BUTT) == B_WHEELRIGHT)
- return scroll_h(fd, 64);
if ((ev->b & BM_BUTT) == B_WHEELLEFT1)
return scroll_h(fd, -16);
if ((ev->b & BM_BUTT) == B_WHEELRIGHT1)
@@ -1156,7 +1148,6 @@ int g_frame_ev(struct session *ses, struct f_data_c *fd, struct links_event *ev)
if (fd->hsb && ev_in_rect(ev, 0, fd->yw - G_SCROLL_BAR_WIDTH, fd->xw, fd->yw)) return 0;
if ((ev->b & BM_ACT) == B_DOWN && (ev->b & BM_BUTT) == B_MIDDLE) {
- scrll:
ses->scrolltype = ev->x + fd->vs->view_posx;
ses->scrolloff = ev->y + fd->vs->view_pos;
ses->scrolling = 2;
@@ -1227,8 +1218,6 @@ int g_frame_ev(struct session *ses, struct f_data_c *fd, struct links_event *ev)
fd->f_data->start_highlight_x = -1;
fd->f_data->start_highlight_y = -1;
}
-
- if ((ev->b & BM_ACT) == B_DOWN && (ev->b & BM_BUTT) == B_RIGHT && fd->vs->current_link == -1) goto scrll;
break;
case EV_KBD:
if (ses->locked_link && fd->vs->current_link >= 0 && fd->vs->current_link < fd->f_data->nlinks && (fd->f_data->links[fd->vs->current_link].type == L_FIELD || fd->f_data->links[fd->vs->current_link].type == L_AREA)) {