diff --git a/README.md b/README.md index e514607..2160e74 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ TINYEXPR defines only five functions: ```C double te_interp(const char *expression, int *error); te_expr *te_compile(const char *expression, const te_variable *lookup, int lookup_len, int *error); - double te_eval(te_expr *n); + double te_eval(const te_expr *n); void te_print(const te_expr *n); void te_free(te_expr *n); ``` diff --git a/tinyexpr.c b/tinyexpr.c index 3c4e95d..8364ef1 100644 --- a/tinyexpr.c +++ b/tinyexpr.c @@ -306,7 +306,7 @@ static te_expr *expr(state *s) { } -double te_eval(te_expr *n) { +double te_eval(const te_expr *n) { double ret; if (n->bound) { diff --git a/tinyexpr.h b/tinyexpr.h index 1df74d2..45da464 100644 --- a/tinyexpr.h +++ b/tinyexpr.h @@ -61,7 +61,7 @@ double te_interp(const char *expression, int *error); te_expr *te_compile(const char *expression, const te_variable *lookup, int lookup_len, int *error); /* Evaluates the expression. */ -double te_eval(te_expr *n); +double te_eval(const te_expr *n); /* Prints debugging information on the syntax tree. */ void te_print(const te_expr *n);