]> git.karo-electronics.de Git - mdnsd.git/commitdiff
fix warnings in xht.[ch]
authorSimon Budig <simon@budig.de>
Thu, 22 Jan 2009 22:51:32 +0000 (23:51 +0100)
committerOle Reinhardt <ole.reinhardt@kernelconcepts.de>
Sun, 28 Apr 2013 23:01:41 +0000 (01:01 +0200)
xht.c
xht.h

diff --git a/xht.c b/xht.c
index c647f54ac143c57dc3025debdd672841b079c0ee..b3dcf29fe9282586ba65506d044151463947b71f 100644 (file)
--- a/xht.c
+++ b/xht.c
@@ -1,10 +1,12 @@
+#include <stdlib.h>
+#include <string.h>
 #include "xht.h"
 
 typedef struct xhn_struct
 {
     char flag;
     struct xhn_struct *next;
-    const char *key;
+    char *key;
     void *val;
 } *xhn;
 
@@ -58,7 +60,7 @@ xht xht_new(int prime)
 }
 
 /* does the set work, used by xht_set and xht_store */
-xhn _xht_set(xht h, const char *key, void *val, char flag)
+void _xht_set(xht h, char *key, void *val, char flag)
 {
     int i;
     xhn n;
@@ -92,7 +94,7 @@ xhn _xht_set(xht h, const char *key, void *val, char flag)
     n->val = val;
 }
 
-void xht_set(xht h, const char *key, void *val)
+void xht_set(xht h, char *key, void *val)
 {
     if(h == 0 || key == 0)
         return;
diff --git a/xht.h b/xht.h
index db26b31fef70b41bb40f8fa818e343b5456c5587..1af42ea514c22e0f48c2b346b32540d039405538 100644 (file)
--- a/xht.h
+++ b/xht.h
@@ -10,7 +10,7 @@ xht xht_new(int prime);
 
 // caller responsible for key storage, no copies made (don't free it b4 xht_free()!)
 // set val to NULL to clear an entry, memory is reused but never free'd (# of keys only grows to peak usage)
-void xht_set(xht h, const char *key, void *val);
+void xht_set(xht h, char *key, void *val);
 
 // ooh! unlike set where key/val is in caller's mem, here they are copied into xht and free'd when val is 0 or xht_free()
 void xht_store(xht h, const char *key, int klen, void *val, int vlen);