From 110ba767e591946d6784acef87737850f2ad3ae9 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 21 Aug 2021 10:28:05 +0000 Subject: [PATCH] Rename a member to match what it will be in future. --- arguments.c | 12 ++++++------ cmd-new-session.c | 2 +- cmd-new-window.c | 2 +- cmd-queue.c | 2 +- cmd-refresh-client.c | 4 ++-- cmd-resize-pane.c | 3 +-- cmd-resize-window.c | 3 +-- cmd-respawn-pane.c | 2 +- cmd-respawn-window.c | 2 +- cmd-split-window.c | 2 +- tmux.h | 2 +- 11 files changed, 17 insertions(+), 19 deletions(-) diff --git a/arguments.c b/arguments.c index 77ca8e73..2f9c0c31 100644 --- a/arguments.c +++ b/arguments.c @@ -128,7 +128,7 @@ args_free(struct args *args) RB_REMOVE(args_tree, &args->tree, entry); TAILQ_FOREACH_SAFE(value, &entry->values, entry, value1) { TAILQ_REMOVE(&entry->values, value, entry); - free(value->value); + free(value->string); free(value); } free(entry); @@ -210,7 +210,7 @@ args_print(struct args *args) args_print_add(&buf, &len, " -%c", entry->flag); else args_print_add(&buf, &len, "-%c", entry->flag); - args_print_add_argument(&buf, &len, value->value); + args_print_add_argument(&buf, &len, value->string); } } @@ -299,7 +299,7 @@ args_set(struct args *args, u_char flag, const char *s) if (s != NULL) { value = xcalloc(1, sizeof *value); - value->value = xstrdup(s); + value->string = xstrdup(s); TAILQ_INSERT_TAIL(&entry->values, value, entry); } } @@ -314,7 +314,7 @@ args_get(struct args *args, u_char flag) return (NULL); if (TAILQ_EMPTY(&entry->values)) return (NULL); - return (TAILQ_LAST(&entry->values, args_values)->value); + return (TAILQ_LAST(&entry->values, args_values)->string); } /* Get first argument. */ @@ -387,7 +387,7 @@ args_strtonum(struct args *args, u_char flag, long long minval, } value = TAILQ_LAST(&entry->values, args_values); - ll = strtonum(value->value, minval, maxval, &errstr); + ll = strtonum(value->string, minval, maxval, &errstr); if (errstr != NULL) { *cause = xstrdup(errstr); return (0); @@ -409,7 +409,7 @@ args_percentage(struct args *args, u_char flag, long long minval, *cause = xstrdup("missing"); return (0); } - value = TAILQ_LAST(&entry->values, args_values)->value; + value = TAILQ_LAST(&entry->values, args_values)->string; return (args_string_percentage(value, minval, maxval, curval, cause)); } diff --git a/cmd-new-session.c b/cmd-new-session.c index 83e3f299..93c7e7b4 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -271,7 +271,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) environ_update(global_s_options, c->environ, env); av = args_first_value(args, 'e'); while (av != NULL) { - environ_put(env, av->value, 0); + environ_put(env, av->string, 0); av = args_next_value(av); } s = session_create(prefix, newname, cwd, env, oo, tiop); diff --git a/cmd-new-window.c b/cmd-new-window.c index 208cd880..e88795c2 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -110,7 +110,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) av = args_first_value(args, 'e'); while (av != NULL) { - environ_put(sc.environ, av->value, 0); + environ_put(sc.environ, av->string, 0); av = args_next_value(av); } diff --git a/cmd-queue.c b/cmd-queue.c index 687d037f..806f1cbb 100644 --- a/cmd-queue.c +++ b/cmd-queue.c @@ -413,7 +413,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item, av = args_first_value(args, flag); while (av != NULL) { xsnprintf(tmp, sizeof tmp, "hook_flag_%c_%d", flag, i); - cmdq_add_format(new_state, tmp, "%s", av->value); + cmdq_add_format(new_state, tmp, "%s", av->string); i++; av = args_next_value(av); } diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c index 026bee02..24a49dcb 100644 --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -187,7 +187,7 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) goto not_control_client; av = args_first_value(args, 'A'); while (av != NULL) { - cmd_refresh_client_update_offset(tc, av->value); + cmd_refresh_client_update_offset(tc, av->string); av = args_next_value(av); } return (CMD_RETURN_NORMAL); @@ -197,7 +197,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->value); + cmd_refresh_client_update_subscription(tc, av->string); av = args_next_value(av); } return (CMD_RETURN_NORMAL); diff --git a/cmd-resize-pane.c b/cmd-resize-pane.c index 9395b379..81744f72 100644 --- a/cmd-resize-pane.c +++ b/cmd-resize-pane.c @@ -98,8 +98,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item) if (args_count(args) == 0) adjust = 1; else { - adjust = strtonum(args_string(args, 0), 1, INT_MAX, - &errstr); + adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "adjustment %s", errstr); return (CMD_RETURN_ERROR); diff --git a/cmd-resize-window.c b/cmd-resize-window.c index 8389230b..24d73c87 100644 --- a/cmd-resize-window.c +++ b/cmd-resize-window.c @@ -59,8 +59,7 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item) if (args_count(args) == 0) adjust = 1; else { - adjust = strtonum(args_string(args, 0), 1, INT_MAX, - &errstr); + adjust = strtonum(args_string(args, 0), 1, INT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "adjustment %s", errstr); return (CMD_RETURN_ERROR); diff --git a/cmd-respawn-pane.c b/cmd-respawn-pane.c index 3d8d1c03..652ef755 100644 --- a/cmd-respawn-pane.c +++ b/cmd-respawn-pane.c @@ -69,7 +69,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmdq_item *item) av = args_first_value(args, 'e'); while (av != NULL) { - environ_put(sc.environ, av->value, 0); + environ_put(sc.environ, av->string, 0); av = args_next_value(av); } diff --git a/cmd-respawn-window.c b/cmd-respawn-window.c index 51ef209e..4e6dc2a9 100644 --- a/cmd-respawn-window.c +++ b/cmd-respawn-window.c @@ -67,7 +67,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmdq_item *item) av = args_first_value(args, 'e'); while (av != NULL) { - environ_put(sc.environ, av->value, 0); + environ_put(sc.environ, av->string, 0); av = args_next_value(av); } diff --git a/cmd-split-window.c b/cmd-split-window.c index 30a361df..8b078db1 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -142,7 +142,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) av = args_first_value(args, 'e'); while (av != NULL) { - environ_put(sc.environ, av->value, 0); + environ_put(sc.environ, av->string, 0); av = args_next_value(av); } diff --git a/tmux.h b/tmux.h index af3e3a84..fb1631f9 100644 --- a/tmux.h +++ b/tmux.h @@ -1357,7 +1357,7 @@ TAILQ_HEAD(message_list, message_entry); /* Argument value. */ struct args_value { - char *value; + char *string; TAILQ_ENTRY(args_value) entry; };