apply const qualifier appropriately

This commit is contained in:
Holger Vogt 2020-04-23 14:16:49 +02:00
parent 814cadf36c
commit fdbcdb5b7d
3 changed files with 5 additions and 3 deletions

View File

@ -78,10 +78,12 @@ arg_plot(const wordlist *wl, const struct comm *command)
void void
arg_load(wordlist *wl, const struct comm *command) arg_load(const wordlist *wl_in, const struct comm *command)
{ {
/* just call com_load */ /* just call com_load */
wordlist* const wl = wl_copy(wl_in);
command->co_func(wl); command->co_func(wl);
wl_free(wl);
} }

View File

@ -10,7 +10,7 @@ char *prompt(FILE *fp);
wordlist *process(wordlist *wlist); wordlist *process(wordlist *wlist);
void arg_print(const wordlist *wl, const struct comm *command); void arg_print(const wordlist *wl, const struct comm *command);
void arg_plot(const wordlist *wl, const struct comm *command); void arg_plot(const wordlist *wl, const struct comm *command);
void arg_load(wordlist *wl, const struct comm *command); void arg_load(const wordlist *wl, const struct comm *command);
void arg_let(const wordlist *wl, const struct comm *command); void arg_let(const wordlist *wl, const struct comm *command);
void arg_set(const wordlist *wl, const struct comm *command); void arg_set(const wordlist *wl, const struct comm *command);
void arg_display(const wordlist *wl, const struct comm *command); void arg_display(const wordlist *wl, const struct comm *command);

View File

@ -41,7 +41,7 @@ struct comm {
int co_maxargs; int co_maxargs;
/* The fn that prompts the user. */ /* The fn that prompts the user. */
void (*co_argfn) (wordlist *wl, struct comm *command); void (*co_argfn) (const wordlist *wl, const struct comm *command);
/* When these are printed, printf(string, av[0]) .. */ /* When these are printed, printf(string, av[0]) .. */
char *co_help; char *co_help;