aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/map.h
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-08-22 10:25:26 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2021-08-22 10:46:01 +0200
commit6d23a58b7d27a42de9c20a1492c07aeaffc956b6 (patch)
tree4917d068efdac0780fd9e466b446d8e10c6356a5 /src/nvim/map.h
parent4500253f60ed634a7dcad15dfdaa2927afb99cdb (diff)
downloadrneovim-6d23a58b7d27a42de9c20a1492c07aeaffc956b6.tar.gz
rneovim-6d23a58b7d27a42de9c20a1492c07aeaffc956b6.tar.bz2
rneovim-6d23a58b7d27a42de9c20a1492c07aeaffc956b6.zip
refactor(extmark): remove pointer indirection for extmark use of maps
Diffstat (limited to 'src/nvim/map.h')
-rw-r--r--src/nvim/map.h4
1 files changed, 2 insertions, 2 deletions
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