From 6d23a58b7d27a42de9c20a1492c07aeaffc956b6 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 22 Aug 2021 10:25:26 +0200 Subject: refactor(extmark): remove pointer indirection for extmark use of maps --- src/nvim/map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/map.h') diff --git a/src/nvim/map.h b/src/nvim/map.h index 7cdae0b2a3..7d77a229c5 100644 --- a/src/nvim/map.h +++ b/src/nvim/map.h @@ -46,7 +46,7 @@ MAP_DECLS(uint64_t, uint64_t) // NB: this is the only way to define a struct both containing and contained // in a map... typedef struct ExtmarkNs { // For namespacing extmarks - Map(uint64_t, uint64_t) *map; // For fast lookup + Map(uint64_t, uint64_t) map[1]; // For fast lookup uint64_t free_id; // For automatically assigning id's } ExtmarkNs; @@ -60,7 +60,7 @@ MAP_DECLS(String, handle_T) MAP_DECLS(ColorKey, ColorItem) #define MAP_INIT { { 0, 0, 0, 0, NULL, NULL, NULL } } -#define map_init(k, v, map) (*(map) = (Map(k, v))MAP_INIT) +#define map_init(k, v, map) do { *(map) = (Map(k, v))MAP_INIT; } while (false) #define map_new(T, U) map_##T##_##U##_new #define map_free(T, U) map_##T##_##U##_free -- cgit