From b2d0f04a50f1444f9d62d11636a28c89951f0f40 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 4 Oct 2011 21:00:11 -0700 Subject: Add const attributes to fix gcc -Wwrite-strings warnings Does not fix all of them since some lists contain constant strings and some contain dynamically allocated strings that need to be freed later. Signed-off-by: Alan Coopersmith --- hash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hash.c') diff --git a/hash.c b/hash.c index 313d5b6..94ef2ac 100644 --- a/hash.c +++ b/hash.c @@ -31,7 +31,7 @@ #define NUMBUCKETS (1 << LOG2_NUMBUCKETS) static unsigned -hash(char *string) +hash(const char *string) { int i; unsigned u = 0; @@ -41,7 +41,7 @@ hash(char *string) } static void -strcpy_lwr(char *dst, char *src) +strcpy_lwr(char *dst, const char *src) { while(1) { *dst = tolower(*src); @@ -77,7 +77,7 @@ destroyHashTable(HashTablePtr table) } char * -getHash(HashTablePtr table, char *key) +getHash(HashTablePtr table, const char *key) { int i = hash(key); HashBucketPtr bp; -- cgit v1.2.3