aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-02-27 09:46:21 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-25 18:57:34 -0300
commit51c69b89a7143d43024049a135573883fc10f6b0 (patch)
treeb422592a462628e2a446c7fd6d2551c9994b3d51
parent05c030c725fe15b17a2b09974b5da9d78affc926 (diff)
downloadrneovim-51c69b89a7143d43024049a135573883fc10f6b0.tar.gz
rneovim-51c69b89a7143d43024049a135573883fc10f6b0.tar.bz2
rneovim-51c69b89a7143d43024049a135573883fc10f6b0.zip
map: Add Map(int, int)
-rw-r--r--src/nvim/map.c3
-rw-r--r--src/nvim/map.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/map.c b/src/nvim/map.c
index 39ca7aaaee..06ae19f5bc 100644
--- a/src/nvim/map.c
+++ b/src/nvim/map.c
@@ -16,6 +16,8 @@
#define uint64_t_eq kh_int64_hash_equal
#define uint32_t_hash kh_int_hash_func
#define uint32_t_eq kh_int_hash_equal
+#define int_hash kh_int_hash_func
+#define int_eq kh_int_hash_equal
#if defined(ARCH_64)
#define ptr_t_hash(key) uint64_t_hash((uint64_t)key)
@@ -109,6 +111,7 @@ static inline bool String_eq(String a, String b)
}
+MAP_IMPL(int, int, DEFAULT_INITIALIZER)
MAP_IMPL(cstr_t, uint64_t, DEFAULT_INITIALIZER)
MAP_IMPL(cstr_t, ptr_t, DEFAULT_INITIALIZER)
MAP_IMPL(ptr_t, ptr_t, DEFAULT_INITIALIZER)
diff --git a/src/nvim/map.h b/src/nvim/map.h
index d50f95b163..c0e2ca3aac 100644
--- a/src/nvim/map.h
+++ b/src/nvim/map.h
@@ -22,6 +22,7 @@
U map_##T##_##U##_del(Map(T, U) *map, T key); \
void map_##T##_##U##_clear(Map(T, U) *map);
+MAP_DECLS(int, int)
MAP_DECLS(cstr_t, uint64_t)
MAP_DECLS(cstr_t, ptr_t)
MAP_DECLS(ptr_t, ptr_t)