/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*/
static int pmap_entry_cmp(const void *p1, const void *p2, size_t size)
{
- const pmap_entry *entry1 = p1;
- const pmap_entry *entry2 = p2;
+ const pmap_entry *entry1 = (const pmap_entry*) p1;
+ const pmap_entry *entry2 = (const pmap_entry*) p2;
(void) size;
return entry1->key != entry2->key;
}
/* Creates a new empty map with an initial number of slots. */
-pmap *pmap_create_ex(int slots)
+pmap *pmap_create_ex(size_t slots)
{
return (pmap *)new_set(pmap_entry_cmp, slots);
}
pmap_entry entry, *p;
entry.key = key;
- p = set_insert(M2S(map), &entry, sizeof(pmap_entry), HASH_PTR(key));
+ p = (pmap_entry*) set_insert(M2S(map), &entry, sizeof(pmap_entry), HASH_PTR(key));
p->value = value;
}
return entry == NULL ? NULL : entry->value;
}
-int pmap_count(pmap *map)
+size_t pmap_count(pmap *map)
{
return set_count(M2S(map));
}