diff --git a/c/flisp.c b/c/flisp.c index 6245691..f94e135 100644 --- a/c/flisp.c +++ b/c/flisp.c @@ -261,12 +261,12 @@ SAFECAST_OP(string, char *, cvalue_data) struct symbol *symtab = NULL; -int fl_is_keyword_name(char *str, size_t len) +int fl_is_keyword_name(const char *str, size_t len) { return ((str[0] == ':' || str[len - 1] == ':') && str[1] != '\0'); } -static struct symbol *mk_symbol(char *str) +static struct symbol *mk_symbol(const char *str) { struct symbol *sym; size_t len = strlen(str); @@ -289,7 +289,7 @@ static struct symbol *mk_symbol(char *str) return sym; } -static struct symbol **symtab_lookup(struct symbol **ptree, char *str) +static struct symbol **symtab_lookup(struct symbol **ptree, const char *str) { int x; @@ -305,7 +305,7 @@ static struct symbol **symtab_lookup(struct symbol **ptree, char *str) return ptree; } -value_t symbol(char *str) +value_t symbol(const char *str) { struct symbol **pnode; diff --git a/c/flisp.h b/c/flisp.h index a778d28..a00e359 100644 --- a/c/flisp.h +++ b/c/flisp.h @@ -141,9 +141,9 @@ extern value_t printprettysym, printreadablysym, printwidthsym; value_t fl_cons(value_t a, value_t b); value_t fl_list2(value_t a, value_t b); value_t fl_listn(size_t n, ...); -value_t symbol(char *str); +value_t symbol(const char *str); char *symbol_name(value_t v); -int fl_is_keyword_name(char *str, size_t len); +int fl_is_keyword_name(const char *str, size_t len); value_t alloc_vector(size_t n, int init); size_t llength(value_t v); value_t fl_compare(value_t a, value_t b); // -1, 0, or 1