* into proprietary software; there is no requirement for such software to
* contain a copyright notice related to this source.
*
- * $Id: hash.c,v 1.4 2009-11-19 10:37:43 franklahm Exp $
* $Name: $
*/
#define NDEBUG
#include "hash.h"
#ifdef KAZLIB_RCSID
-static const char rcsid[] = "$Id: hash.c,v 1.4 2009-11-19 10:37:43 franklahm Exp $";
#endif
#define INIT_BITS 6
static hnode_t *hnode_alloc(void *context);
static void hnode_free(hnode_t *node, void *context);
static hash_val_t hash_fun_default(const void *key);
-static hash_val_t hash_fun2(const void *key);
static int hash_comp_default(const void *key1, const void *key2);
int hash_val_t_bit;
+(uint32_t)(((const uint8_t *)(d))[0]) )
#endif
+static int hash_comp_default(const void *key1, const void *key2)
+{
+ return strcmp(key1, key2);
+}
+
+#ifdef KAZLIB_TEST_MAIN
+
static hash_val_t hash_fun2(const void *key)
{
int len, rem;
const unsigned char *data = key;
- hash_val_t hash, tmp;
+ hash_val_t hash = 0, tmp = 0;
len = strlen((char *)data);
return hash;
}
-static int hash_comp_default(const void *key1, const void *key2)
-{
- return strcmp(key1, key2);
-}
-
-#ifdef KAZLIB_TEST_MAIN
-
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
"s switch to non-functioning allocator\n"
"q quit";
- if (!h)
+ if (!h) {
puts("hash_create failed");
+ return 1;
+ }
for (;;) {
if (prompt)
puts("out of memory");
free((void *) key);
free(val);
+ break;
}
if (!hash_alloc_insert(h, key, val)) {