mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 07:18:17 +00:00
object_to_vim: Fix buffer/window/tabpage conversion on BE systems
Since data.integer is a different (larger) integer type than data.{buffer,window,tabpage}, we cannot abuse the union by using data.integer to access the value for all 4 types. Instead, remove the {buffer,window,tabpage} members and always use the integer member. In order to accomodate this, perform distinct validation and coercion between the Integer type and Buffer/Window/Tabpage types in object_to_vim, msgpack_rpc helpers, and gendispatch.lua.
This commit is contained in:
@@ -37,15 +37,15 @@
|
||||
|
||||
#define BUFFER_OBJ(s) ((Object) { \
|
||||
.type = kObjectTypeBuffer, \
|
||||
.data.buffer = s })
|
||||
.data.integer = s })
|
||||
|
||||
#define WINDOW_OBJ(s) ((Object) { \
|
||||
.type = kObjectTypeWindow, \
|
||||
.data.window = s })
|
||||
.data.integer = s })
|
||||
|
||||
#define TABPAGE_OBJ(s) ((Object) { \
|
||||
.type = kObjectTypeTabpage, \
|
||||
.data.tabpage = s })
|
||||
.data.integer = s })
|
||||
|
||||
#define ARRAY_OBJ(a) ((Object) { \
|
||||
.type = kObjectTypeArray, \
|
||||
|
Reference in New Issue
Block a user