#include "hmap_s.h" #include "vec.h" #include uint32_t vec2i_hmap_hash(struct hmap_key key) { const struct vec2i *v = key.p; return (uint32_t) v->x + (uint32_t) v->y * 1337; } bool vec2i_hmap_keycmp(struct hmap_key k1, struct hmap_key k2) { const struct vec2i *v1 = k1.p, *v2 = k2.p; return vec2i_eql(v1, v2); } uint32_t vec3i_hmap_hash(struct hmap_key key) { const struct vec3i *v = key.p; return (uint32_t) v->x + (uint32_t) v->y * 1337 + (uint32_t) v->z * 1337 * 1337; } bool vec3i_hmap_keycmp(struct hmap_key k1, struct hmap_key k2) { const struct vec3i *v1 = k1.p, *v2 = k2.p; return vec3i_eql(v1, v2); } uint32_t ssizet_hmap_hash(struct hmap_key key) { return (uint32_t) (key.s * 1737); } bool ssizet_hmap_keycmp(struct hmap_key k1, struct hmap_key k2) { return k1.ss == k2.ss; }