aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/extmark.c10
-rw-r--r--src/nvim/api/extmark.h1
-rw-r--r--src/nvim/api/private/helpers.h12
-rw-r--r--src/nvim/api/ui.c2
4 files changed, 11 insertions, 14 deletions
diff --git a/src/nvim/api/extmark.c b/src/nvim/api/extmark.c
index 87232a8a93..d6f0288f94 100644
--- a/src/nvim/api/extmark.c
+++ b/src/nvim/api/extmark.c
@@ -33,12 +33,10 @@
void api_extmark_free_all_mem(void)
{
String name;
- handle_T id;
- map_foreach(&namespace_ids, name, id, {
- (void)id;
+ map_foreach_key(&namespace_ids, name, {
xfree(name.data);
})
- map_destroy(String, handle_T)(&namespace_ids);
+ map_destroy(String, &namespace_ids);
}
/// Creates a new namespace or gets an existing one. \*namespace\*
@@ -77,7 +75,7 @@ Dictionary nvim_get_namespaces(void)
String name;
handle_T id;
- map_foreach(&namespace_ids, name, id, {
+ map_foreach(handle_T, &namespace_ids, name, id, {
PUT(retval, name.data, INTEGER_OBJ(id));
})
@@ -88,7 +86,7 @@ const char *describe_ns(NS ns_id)
{
String name;
handle_T id;
- map_foreach(&namespace_ids, name, id, {
+ map_foreach(handle_T, &namespace_ids, name, id, {
if ((NS)id == ns_id && name.size) {
return name.data;
}
diff --git a/src/nvim/api/extmark.h b/src/nvim/api/extmark.h
index a6586e3031..3c979fa4f6 100644
--- a/src/nvim/api/extmark.h
+++ b/src/nvim/api/extmark.h
@@ -6,7 +6,6 @@
#include "nvim/decoration.h"
#include "nvim/macros.h"
#include "nvim/map.h"
-#include "nvim/map_defs.h"
#include "nvim/types.h"
EXTERN Map(String, handle_T) namespace_ids INIT(= MAP_INIT);
diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h
index 2623c97c9d..bac501ed62 100644
--- a/src/nvim/api/private/helpers.h
+++ b/src/nvim/api/private/helpers.h
@@ -122,13 +122,13 @@
#define api_free_window(value)
#define api_free_tabpage(value)
-EXTERN PMap(handle_T) buffer_handles INIT(= MAP_INIT);
-EXTERN PMap(handle_T) window_handles INIT(= MAP_INIT);
-EXTERN PMap(handle_T) tabpage_handles INIT(= MAP_INIT);
+EXTERN PMap(int) buffer_handles INIT(= MAP_INIT);
+EXTERN PMap(int) window_handles INIT(= MAP_INIT);
+EXTERN PMap(int) tabpage_handles INIT(= MAP_INIT);
-#define handle_get_buffer(h) pmap_get(handle_T)(&buffer_handles, (h))
-#define handle_get_window(h) pmap_get(handle_T)(&window_handles, (h))
-#define handle_get_tabpage(h) pmap_get(handle_T)(&tabpage_handles, (h))
+#define handle_get_buffer(h) pmap_get(int)(&buffer_handles, (h))
+#define handle_get_window(h) pmap_get(int)(&window_handles, (h))
+#define handle_get_tabpage(h) pmap_get(int)(&tabpage_handles, (h))
/// Structure used for saving state for :try
///
diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c
index bd3482c85f..532c3054ab 100644
--- a/src/nvim/api/ui.c
+++ b/src/nvim/api/ui.c
@@ -111,7 +111,7 @@ void remote_ui_disconnect(uint64_t channel_id)
}
UIData *data = ui->data;
kv_destroy(data->call_buf);
- pmap_del(uint64_t)(&connected_uis, channel_id);
+ pmap_del(uint64_t)(&connected_uis, channel_id, NULL);
ui_detach_impl(ui, channel_id);
// Destroy `ui`.