diff options
author | pommicket <pommicket@gmail.com> | 2023-01-01 23:38:51 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-01-01 23:38:51 -0500 |
commit | 8c16344d5279eef6ed6ad18d4de7e8a2a5bf2f98 (patch) | |
tree | e56a9102b9317b51ace48ce0cba37d5397d6105b /command.c | |
parent | 94b241351c7418c2f6a32cc01b889bc48478c50d (diff) |
char const => const char
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ typedef struct { - char const *name; + const char *name; Command cmd; } CommandName; static CommandName const command_names[] = { @@ -87,7 +87,7 @@ static CommandName const command_names[] = { static_assert_if_possible(arr_count(command_names) == CMD_COUNT) -Command command_from_str(char const *str) { +Command command_from_str(const char *str) { // @TODO(optimize): sort command_names, do a binary search for (int i = 0; i < CMD_COUNT; ++i) { if (streq(command_names[i].name, str)) @@ -106,7 +106,7 @@ const char *command_to_str(Command c) { } // get the string corresponding to this argument; returns NULL if it's not a string argument -char const *arg_get_string(Ted *ted, i64 argument) { +const char *arg_get_string(Ted *ted, i64 argument) { if (argument < 0) return NULL; if (argument & ARG_STRING) { argument -= ARG_STRING; @@ -524,7 +524,7 @@ void command_execute(Ted *ted, Command c, i64 argument) { build_prev_error(ted); break; case CMD_SHELL: { - char const *str = arg_get_string(ted, argument); + const char *str = arg_get_string(ted, argument); if (str) { strbuf_cpy(ted->build_dir, ted->cwd); build_start_with_command(ted, str); |