From 6db4fb0a9b2ee7c91aa36ad668f813f26a4efe7a Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 8 Apr 2008 19:52:02 +0200 Subject: [PATCH] Make Dictionary keys const everywhere. --- include/irc_dictionary.h | 4 ++-- src/irc_dictionary.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/irc_dictionary.h b/include/irc_dictionary.h index 0dac5456c..5d762848d 100644 --- a/include/irc_dictionary.h +++ b/include/irc_dictionary.h @@ -33,7 +33,7 @@ struct DictionaryElement { struct DictionaryElement *left, *right, *prev, *next; void *data; - char *key; + const char *key; int position; }; @@ -133,7 +133,7 @@ extern void irc_dictionary_foreach_next(struct Dictionary *dtree, /* * irc_dictionary_add() adds a key->value entry to the dictionary tree. */ -extern struct DictionaryElement *irc_dictionary_add(struct Dictionary *dtree, char *key, void *data); +extern struct DictionaryElement *irc_dictionary_add(struct Dictionary *dtree, const char *key, void *data); /* * irc_dictionary_find() returns a struct DictionaryElement container from a dtree for key 'key'. diff --git a/src/irc_dictionary.c b/src/irc_dictionary.c index a99dede82..bf9409b80 100644 --- a/src/irc_dictionary.c +++ b/src/irc_dictionary.c @@ -704,7 +704,7 @@ struct DictionaryElement *irc_dictionary_find(struct Dictionary *dict, const cha * Side Effects: * - data is inserted into the DTree. */ -struct DictionaryElement *irc_dictionary_add(struct Dictionary *dict, char *key, void *data) +struct DictionaryElement *irc_dictionary_add(struct Dictionary *dict, const char *key, void *data) { struct DictionaryElement *delem;