aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-06-21 23:45:50 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-06-21 23:45:50 -0500
commitcc66e24e2b39726b4cd7623e775eac4b92280a5a (patch)
tree414b8476ee0448dde9fe8a31a5c4e941d59ecd5b
parent975bb5fc5aa6a870fcb75c9053dba14e010c7248 (diff)
downloadlibhashtable-cc66e24e2b39726b4cd7623e775eac4b92280a5a.tar.gz
libhashtable-cc66e24e2b39726b4cd7623e775eac4b92280a5a.zip
made some debugging statements moved to inside #ifdefs
-rw-r--r--libhashtable.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libhashtable.c b/libhashtable.c
index bf6616a..0bdcd60 100644
--- a/libhashtable.c
+++ b/libhashtable.c
@@ -4,6 +4,8 @@
#include <stdint.h>
#include "hashtable.h"
+//#define DEBUG
+
/* _A_
struct entry {
char *original;
@@ -135,7 +137,9 @@ int ht_setkey(struct hashtable *ht,char *key,void *value) {
int i;
if(!key) key="(null)";
h=hash(key)%(ht->size);
- //printf("setkey: %s\nhash: %u\n",key,h);
+#ifdef DEBUG
+ printf("setkey: %s\nhash: %u\n",key,h);
+#endif
for(i=0;i<ht->kl;i++) {
if(ht->keys[i]==h) break;
}
@@ -199,7 +203,9 @@ struct entry *ht_getnode(struct hashtable *ht,char *key) {
//you'll probably want to use me.
void *ht_getvalue(struct hashtable *ht,char *key) {
struct entry *tmp=ll_getentry(ht_getentry(ht,key),key);
- //printf("getvalue: %s\nhash: %u\n",key,hash(key)%(ht->size));
+#ifdef DEBUG
+ printf("getvalue: %s\nhash: %u\n",key,hash(key)%(ht->size));
+#endif
return tmp?tmp->target:0;
}