tbl->size = size;
tbl->entries = 0;
tbl->node_size = node_size;
- tbl->key64 = key64;
+ tbl->key64 = key64 ? 1 : 0;
return tbl;
}
struct ht_int32_node *node;
uint32 ndx;
+ if (key64 ? key == 0 : (int32)key == 0) {
+ rprintf(FERROR, "Internal hashtable error: illegal key supplied!\n");
+ exit_cleanup(RERR_MESSAGEIO);
+ }
+
if (allocate_if_missing && tbl->entries > HASH_LOAD_LIMIT(tbl->size)) {
void *old_nodes = tbl->nodes;
int size = tbl->size * 2;
if (key64)
((struct ht_int64_node*)node)->key = key;
else
- node->key = key;
+ node->key = (int32)key;
tbl->entries++;
return node;
}