From 97d634a708122387a6322e0f908f4b10e4210c87 Mon Sep 17 00:00:00 2001 From: petermlm Date: Sun, 17 Apr 2016 18:43:10 +0100 Subject: [PATCH] Added const to declarations --- mpc.c | 8 ++++---- mpc.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mpc.c b/mpc.c index e5c350e..6c65255 100644 --- a/mpc.c +++ b/mpc.c @@ -2776,11 +2776,11 @@ void mpc_ast_print_to(mpc_ast_t *a, FILE *fp) { mpc_ast_print_depth(a, 0, fp); } -int mpc_ast_get_index(mpc_ast_t *ast, char *tag) { +int mpc_ast_get_index(mpc_ast_t *ast, const char *tag) { return mpc_ast_get_index_lb(ast, tag, 0); } -int mpc_ast_get_index_lb(mpc_ast_t *ast, char *tag, int lb) { +int mpc_ast_get_index_lb(mpc_ast_t *ast, const char *tag, int lb) { int i; for(i=lb; ichildren_num; i++) { @@ -2792,11 +2792,11 @@ int mpc_ast_get_index_lb(mpc_ast_t *ast, char *tag, int lb) { return -1; } -mpc_ast_t *mpc_ast_get_child(mpc_ast_t *ast, char *tag) { +mpc_ast_t *mpc_ast_get_child(mpc_ast_t *ast, const char *tag) { return mpc_ast_get_child_lb(ast, tag, 0); } -mpc_ast_t *mpc_ast_get_child_lb(mpc_ast_t *ast, char *tag, int lb) { +mpc_ast_t *mpc_ast_get_child_lb(mpc_ast_t *ast, const char *tag, int lb) { int i; for(i=lb; ichildren_num; i++) { diff --git a/mpc.h b/mpc.h index 02a6b4e..82ee6ba 100644 --- a/mpc.h +++ b/mpc.h @@ -276,10 +276,10 @@ void mpc_ast_delete(mpc_ast_t *a); void mpc_ast_print(mpc_ast_t *a); void mpc_ast_print_to(mpc_ast_t *a, FILE *fp); -int mpc_ast_get_index(mpc_ast_t *ast, char *tag); -int mpc_ast_get_index_lb(mpc_ast_t *ast, char *tag, int lb); -mpc_ast_t *mpc_ast_get_child(mpc_ast_t *ast, char *tag); -mpc_ast_t *mpc_ast_get_child_lb(mpc_ast_t *ast, char *tag, int lb); +int mpc_ast_get_index(mpc_ast_t *ast, const char *tag); +int mpc_ast_get_index_lb(mpc_ast_t *ast, const char *tag, int lb); +mpc_ast_t *mpc_ast_get_child(mpc_ast_t *ast, const char *tag); +mpc_ast_t *mpc_ast_get_child_lb(mpc_ast_t *ast, const char *tag, int lb); /* ** Warning: This function currently doesn't test for equality of the `state` member!