diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-09 13:52:33 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-09 13:52:33 +0000 |
commit | 031ffaa1243878acb63f017e435a774655fa5b08 (patch) | |
tree | 154b20c37f941531b149f8573fdbe7eab74e95cb /usr.bin/tmux | |
parent | 08cbf972268ed30e723eb3162587b6c9c59a7911 (diff) |
Some unnecessary assignments and unused variables.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/client.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-send-keys.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/key-string.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/server-client.c | 9 | ||||
-rw-r--r-- | usr.bin/tmux/window-buffer.c | 5 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 3 |
6 files changed, 13 insertions, 18 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 53a0ce59d35..71ec7358c1c 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.139 2020/03/30 15:49:23 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.140 2020/04/09 13:52:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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/usr.bin/tmux/cmd-send-keys.c b/usr.bin/tmux/cmd-send-keys.c index bb504f1cb81..ea4b8d98676 100644 --- a/usr.bin/tmux/cmd-send-keys.c +++ b/usr.bin/tmux/cmd-send-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-send-keys.c,v 1.53 2020/03/19 14:03:48 nicm Exp $ */ +/* $OpenBSD: cmd-send-keys.c,v 1.54 2020/04/09 13:52:32 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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/usr.bin/tmux/key-string.c b/usr.bin/tmux/key-string.c index c78b19bff64..c81aa90a459 100644 --- a/usr.bin/tmux/key-string.c +++ b/usr.bin/tmux/key-string.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-string.c,v 1.55 2020/03/31 11:38:35 nicm Exp $ */ +/* $OpenBSD: key-string.c,v 1.56 2020/04/09 13:52:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 0605445e659..9f1a9a9e404 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.314 2020/04/09 12:16:16 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.315 2020/04/09 13:52:31 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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/usr.bin/tmux/window-buffer.c b/usr.bin/tmux/window-buffer.c index fabfb1981f3..0398b3799c3 100644 --- a/usr.bin/tmux/window-buffer.c +++ b/usr.bin/tmux/window-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-buffer.c,v 1.25 2020/02/11 07:01:09 nicm Exp $ */ +/* $OpenBSD: window-buffer.c,v 1.26 2020/04/09 13:52:31 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index e3d9c0cf017..9c20aa2bcae 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.266 2020/04/06 17:51:34 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.267 2020/04/09 13:52:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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; |