diff options
author | nicm <nicm> | 2020-04-09 13:52:31 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-04-09 13:52:31 +0000 |
commit | b96ac809018c461b55aed66459a68a71dd08047f (patch) | |
tree | e8a3ea7ce40ff18088c0113ee76d1c4f834b3999 | |
parent | c4d0089edb802763619724e405ac2715542969d5 (diff) | |
download | rtmux-b96ac809018c461b55aed66459a68a71dd08047f.tar.gz rtmux-b96ac809018c461b55aed66459a68a71dd08047f.tar.bz2 rtmux-b96ac809018c461b55aed66459a68a71dd08047f.zip |
Some unnecessary assignments and unused variables.
-rw-r--r-- | client.c | 2 | ||||
-rw-r--r-- | cmd-send-keys.c | 2 | ||||
-rw-r--r-- | key-string.c | 4 | ||||
-rw-r--r-- | server-client.c | 7 | ||||
-rw-r--r-- | window-buffer.c | 3 | ||||
-rw-r--r-- | window-copy.c | 1 |
6 files changed, 7 insertions, 12 deletions
@@ -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"); diff --git a/cmd-send-keys.c b/cmd-send-keys.c index 5770572a..15967b0c 100644 --- a/cmd-send-keys.c +++ b/cmd-send-keys.c @@ -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); } diff --git a/key-string.c b/key-string.c index 76ee4fbe..2a0602b2 100644 --- a/key-string.c +++ b/key-string.c @@ -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; diff --git a/server-client.c b/server-client.c index 5d39e492..b6ce94a9 100644 --- a/server-client.c +++ b/server-client.c @@ -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)) diff --git a/window-buffer.c b/window-buffer.c index bbc5c744..37707233 100644 --- a/window-buffer.c +++ b/window-buffer.c @@ -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); } diff --git a/window-copy.c b/window-copy.c index 5a1a03ec..ca938fdd 100644 --- a/window-copy.c +++ b/window-copy.c @@ -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; |