summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-01 23:38:51 -0500
committerpommicket <pommicket@gmail.com>2023-01-01 23:38:51 -0500
commit8c16344d5279eef6ed6ad18d4de7e8a2a5bf2f98 (patch)
treee56a9102b9317b51ace48ce0cba37d5397d6105b /command.c
parent94b241351c7418c2f6a32cc01b889bc48478c50d (diff)
char const => const char
Diffstat (limited to 'command.c')
-rw-r--r--command.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/command.c b/command.c
index 7180921..4900c07 100644
--- a/command.c
+++ b/command.c
@@ -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);