From a45b6d6c716cac5d938642ee9003a89e43815882 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Tue, 25 Sep 2001 23:30:52 +0000 Subject: [PATCH] Const-ize string input parameters. svn path=/trunk/yasm/; revision=228 --- src/ternary.c | 6 +++--- src/ternary.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ternary.c b/src/ternary.c index addd3fa9..d91b1332 100644 --- a/src/ternary.c +++ b/src/ternary.c @@ -39,7 +39,7 @@ RCSID("$IdPath$"); insertions. */ void * -ternary_insert (ternary_tree * root, char *s, void *data, int replace) +ternary_insert (ternary_tree * root, const char *s, void *data, int replace) { int diff; ternary_tree curr, *pcurr; @@ -115,7 +115,7 @@ ternary_cleanup (ternary_tree p) /* Non-recursive find of a string in the ternary tree */ void * -ternary_search (ternary_tree p, char *s) +ternary_search (ternary_tree p, const char *s) { ternary_tree curr; int diff, spchar; @@ -147,7 +147,7 @@ ternary_search (ternary_tree p, char *s) /* For those who care, the recursive version of the search. Useful if you want a starting point for pmsearch or nearsearch. */ static void * -ternary_recursivesearch (ternary_tree p, char *s) +ternary_recursivesearch (ternary_tree p, const char *s) { if (!p) return 0; diff --git a/src/ternary.h b/src/ternary.h index add95476..8e0ff6a2 100644 --- a/src/ternary.h +++ b/src/ternary.h @@ -38,7 +38,7 @@ ternary_node; already there, and replace is 0. Otherwise, replaces if it it exists, inserts if it doesn't, and returns the data you passed in. */ -void *ternary_insert (ternary_tree *p, char *s, void *data, int replace); +void *ternary_insert (ternary_tree *p, const char *s, void *data, int replace); /* Delete the ternary search tree rooted at P. Does NOT delete the data you associated with the strings. */ @@ -46,5 +46,5 @@ void ternary_cleanup (ternary_tree p); /* Search the ternary tree for string S, returning the data associated with it if found. */ -void *ternary_search (ternary_tree p, char *s); +void *ternary_search (ternary_tree p, const char *s); #endif