X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/5913c95f2c7abf4c3cb06e27d384d80fb4c83547..4b48bfe2bb8471be547a0503aa516a5248277bac:/hash.c diff --git a/hash.c b/hash.c index 91f3b9e..506bd4c 100644 --- a/hash.c +++ b/hash.c @@ -1,18 +1,31 @@ /* * hash.c - hashing routines mainly used for caching key details. * - * Jonathan McDowell + * Copyright 2000-2002 Jonathan McDowell * - * Copyright 2000-2002 Project Purple + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include +#include #include "hash.h" #include "keystructs.h" #include "ll.h" #include "mem.h" +#include "stats.h" /** * hashtable - the hash table array. @@ -54,7 +67,7 @@ void destroyhash(void) * TODO: The problem is the object has pointers that * need freed too. */ - llfree(curll, free_statskey); + llfree(curll, (void (*)(void *)) free_statskey); hashtable[i] = NULL; } elements = 0; @@ -120,7 +133,7 @@ unsigned long hashelements(void) return elements; } -struct ll *gethashtableentry(int entry) +struct ll *gethashtableentry(unsigned int entry) { return hashtable[entry]; }