Missed a few warnings in previous.

This commit is contained in:
nicm 2020-04-13 20:54:15 +00:00
parent 3f7f9a0e20
commit fc83517913
4 changed files with 11 additions and 21 deletions

View File

@ -57,26 +57,22 @@ const struct cmd_entry cmd_lock_client_entry = {
.args = { "t:", 0, 0 },
.usage = CMD_TARGET_CLIENT_USAGE,
.flags = CMD_AFTERHOOK,
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
.exec = cmd_lock_server_exec
};
static enum cmd_retval
cmd_lock_server_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = cmd_get_args(self);
struct cmd_find_state *target = cmdq_get_target(item);
struct client *c;
struct client *tc = cmdq_get_target_client(item);
if (cmd_get_entry(self) == &cmd_lock_server_entry)
server_lock();
else if (cmd_get_entry(self) == &cmd_lock_session_entry)
server_lock_session(target->s);
else {
if ((c = cmd_find_client(item, args_get(args, 't'), 0)) == NULL)
return (CMD_RETURN_ERROR);
server_lock_client(c);
}
else
server_lock_client(tc);
recalculate_sizes();
return (CMD_RETURN_NORMAL);

View File

@ -84,7 +84,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
struct args *args = cmd_get_args(self);
int append = args_has(args, 'a');
struct cmd_find_state *target = cmdq_get_target(item);
struct client *c, *loop;
struct client *loop;
struct session *s = target->s;
struct window *w;
struct window_pane *wp;
@ -98,8 +98,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
window = (cmd_get_entry(self) == &cmd_set_window_option_entry);
/* Expand argument. */
c = cmd_find_client(item, NULL, 1);
argument = format_single_from_target(item, args->argv[0], c);
argument = format_single_from_target(item, args->argv[0]);
/* If set-hook -R, fire the hook straight away. */
if (cmd_get_entry(self) == &cmd_set_hook_entry && args_has(args, 'R')) {
@ -122,7 +121,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item)
if (args->argc < 2)
value = NULL;
else if (args_has(args, 'F'))
value = format_single_from_target(item, args->argv[1], c);
value = format_single_from_target(item, args->argv[1]);
else
value = xstrdup(args->argv[1]);

View File

@ -39,7 +39,7 @@ const struct cmd_entry cmd_show_messages_entry = {
.args = { "JTt:", 0, 0 },
.usage = "[-JT] " CMD_TARGET_CLIENT_USAGE,
.flags = CMD_AFTERHOOK,
.flags = CMD_AFTERHOOK|CMD_CLIENT_TFLAG,
.exec = cmd_show_messages_exec
};
@ -70,14 +70,11 @@ static enum cmd_retval
cmd_show_messages_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = cmd_get_args(self);
struct client *c;
struct client *tc = cmdq_get_target_client(item);
struct message_entry *msg;
char *tim;
int done, blank;
if ((c = cmd_find_client(item, args_get(args, 't'), 0)) == NULL)
return (CMD_RETURN_ERROR);
done = blank = 0;
if (args_has(args, 'T')) {
blank = cmd_show_messages_terminals(item, blank);
@ -90,10 +87,9 @@ cmd_show_messages_exec(struct cmd *self, struct cmdq_item *item)
if (done)
return (CMD_RETURN_NORMAL);
TAILQ_FOREACH(msg, &c->message_log, entry) {
TAILQ_FOREACH(msg, &tc->message_log, entry) {
tim = ctime(&msg->msg_time);
*strchr(tim, '\n') = '\0';
cmdq_print(item, "%s %s", tim, msg->msg);
}

View File

@ -79,7 +79,6 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = cmd_get_args(self);
struct cmd_find_state *target = cmdq_get_target(item);
struct client *c = cmd_find_client(item, NULL, 1);
struct options *oo;
char *argument, *name = NULL, *cause;
int window, idx, ambiguous, parent, scope;
@ -99,7 +98,7 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item)
}
return (cmd_show_options_all(self, item, scope, oo));
}
argument = format_single_from_target(item, args->argv[0], c);
argument = format_single_from_target(item, args->argv[0]);
name = options_match(argument, &idx, &ambiguous);
if (name == NULL) {