Some unnecessary assignments and unused variables.

This commit is contained in:
nicm 2020-04-09 13:52:31 +00:00
parent c4d0089edb
commit b96ac80901
6 changed files with 7 additions and 12 deletions

View File

@ -644,7 +644,7 @@ client_read_open(void *data, size_t datalen)
struct msg_read_done reply;
struct client_file find, *cf;
const int flags = O_NONBLOCK|O_RDONLY;
int error = 0;
int error;
if (datalen < sizeof *msg)
fatalx("bad MSG_READ_OPEN size");

View File

@ -152,7 +152,7 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_ERROR);
}
if (wme != NULL && (args_has(args, 'X') || args->argc == 0)) {
if (wme == NULL || wme->mode->command == NULL) {
if (wme->mode->command == NULL) {
cmdq_error(item, "not in a mode");
return (CMD_RETURN_ERROR);
}

View File

@ -229,10 +229,8 @@ key_string_lookup_string(const char *string)
key -= 64;
else if (key == 32)
key = 0;
else if (key == '?')
key = 127;
else if (key == 63)
key = KEYC_BSPACE;
key = 127;
else
return (KEYC_UNKNOWN);
modifiers &= ~KEYC_CTRL;

View File

@ -606,10 +606,9 @@ have_event:
wp = window_get_active_at(s->curw->window, px, py);
if (wp != NULL)
where = PANE;
else
return (KEYC_UNKNOWN);
}
if (where == NOWHERE)
return (KEYC_UNKNOWN);
if (where == PANE)
log_debug("mouse %u,%u on pane %%%u", x, y, wp->id);
else if (where == BORDER)
@ -1543,7 +1542,7 @@ server_client_reset_state(struct client *c)
struct window_pane *wp = w->active, *loop;
struct screen *s;
struct options *oo = c->session->options;
int mode, cursor = 0;
int mode, cursor;
u_int cx = 0, cy = 0, ox, oy, sx, sy;
if (c->flags & (CLIENT_CONTROL|CLIENT_SUSPENDED))

View File

@ -348,9 +348,8 @@ window_buffer_do_paste(void *modedata, void *itemdata, struct client *c,
{
struct window_buffer_modedata *data = modedata;
struct window_buffer_itemdata *item = itemdata;
struct paste_buffer *pb;
if ((pb = paste_get_name(item->name)) != NULL)
if (paste_get_name(item->name) != NULL)
mode_tree_run_command(c, NULL, data->command, item->name);
}

View File

@ -4151,7 +4151,6 @@ window_copy_cursor_previous_word_pos(struct window_mode_entry *wme,
data->oy >=
screen_hsize(data->backing) - 1))
goto out;
py--;
py = screen_hsize(data->backing) + data->cy -
data->oy;