From: nicm Date: Fri, 20 Aug 2021 19:34:51 +0000 (+0000) Subject: Add a couple of const and fix some warnings. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=aab759e85a4221a93904b674e9d6eb0d6e227fd9;p=openbsd Add a couple of const and fix some warnings. --- diff --git a/usr.bin/tmux/cmd-refresh-client.c b/usr.bin/tmux/cmd-refresh-client.c index c95daca0c97..b6a2809904f 100644 --- a/usr.bin/tmux/cmd-refresh-client.c +++ b/usr.bin/tmux/cmd-refresh-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-refresh-client.c,v 1.40 2021/08/20 18:59:53 nicm Exp $ */ +/* $OpenBSD: cmd-refresh-client.c,v 1.41 2021/08/20 19:34:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -117,7 +117,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) struct client *tc = cmdq_get_target_client(item); struct tty *tty = &tc->tty; struct window *w; - const char *size, *errstr, *value; + const char *size, *errstr; u_int x, y, adjust; struct args_value *av; @@ -187,7 +187,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) av = args_first_value(args, 'A'); while (av != NULL) { cmd_refresh_client_update_offset(tc, av->value); - av = args_next_value(&av); + av = args_next_value(av); } return (CMD_RETURN_NORMAL); } @@ -196,7 +196,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) goto not_control_client; av = args_first_value(args, 'B'); while (av != NULL) { - cmd_refresh_client_update_subscription(tc, av); + cmd_refresh_client_update_subscription(tc, av->value); av = args_next_value(av); } return (CMD_RETURN_NORMAL); diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index fa6515a0089..92d14f458e3 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.164 2021/06/10 07:50:03 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.165 2021/08/20 19:34:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -252,7 +252,7 @@ cmd_log_argv(int argc, char **argv, const char *fmt, ...) /* Prepend to an argument vector. */ void -cmd_prepend_argv(int *argc, char ***argv, char *arg) +cmd_prepend_argv(int *argc, char ***argv, const char *arg) { char **new_argv; int i; @@ -269,7 +269,7 @@ cmd_prepend_argv(int *argc, char ***argv, char *arg) /* Append to an argument vector. */ void -cmd_append_argv(int *argc, char ***argv, char *arg) +cmd_append_argv(int *argc, char ***argv, const char *arg) { *argv = xreallocarray(*argv, (*argc) + 1, sizeof **argv); (*argv)[(*argc)++] = xstrdup(arg); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index ace9f84ca64..3a92db24cd1 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1125 2021/08/20 18:59:53 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1126 2021/08/20 19:34:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2236,8 +2236,8 @@ int cmd_find_from_nothing(struct cmd_find_state *, int); /* cmd.c */ extern const struct cmd_entry *cmd_table[]; void printflike(3, 4) cmd_log_argv(int, char **, const char *, ...); -void cmd_prepend_argv(int *, char ***, char *); -void cmd_append_argv(int *, char ***, char *); +void cmd_prepend_argv(int *, char ***, const char *); +void cmd_append_argv(int *, char ***, const char *); int cmd_pack_argv(int, char **, char *, size_t); int cmd_unpack_argv(char *, size_t, int, char ***); char **cmd_copy_argv(int, char **);