aboutsummaryrefslogtreecommitdiff
path: root/scripts/gendispatch.lua
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-11-02 20:04:10 -0400
committerGitHub <noreply@github.com>2016-11-02 20:04:10 -0400
commit9ef4be9aab6a9a16cf185ca17a2dabe87f8aa328 (patch)
tree61f8f49756967806c80c92ab99c144c21d2400ea /scripts/gendispatch.lua
parent349fa0048b7d45875daf96eefca0da163cd3a82f (diff)
parent654e92186ba4adcc48295998b840c76242456368 (diff)
downloadrneovim-9ef4be9aab6a9a16cf185ca17a2dabe87f8aa328.tar.gz
rneovim-9ef4be9aab6a9a16cf185ca17a2dabe87f8aa328.tar.bz2
rneovim-9ef4be9aab6a9a16cf185ca17a2dabe87f8aa328.zip
Merge pull request #5550 from jamessan/big-endian-fixes
Making nvim big-endian friendly
Diffstat (limited to 'scripts/gendispatch.lua')
-rw-r--r--scripts/gendispatch.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua
index 94789e1ef0..397ccc9aaf 100644
--- a/scripts/gendispatch.lua
+++ b/scripts/gendispatch.lua
@@ -232,8 +232,14 @@ for i = 1, #functions do
converted = 'arg_'..j
local rt = real_type(param[1])
if rt ~= 'Object' then
- output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {')
- output:write('\n '..converted..' = args.items['..(j - 1)..'].data.'..rt:lower()..';')
+ if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') then
+ -- Buffer, Window, and Tabpage have a specific type, but are stored in integer
+ output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..' && args.items['..(j - 1)..'].data.integer >= 0) {')
+ output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
+ else
+ output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {')
+ output:write('\n '..converted..' = args.items['..(j - 1)..'].data.'..rt:lower()..';')
+ end
if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') or rt:match('^Boolean$') then
-- accept nonnegative integers for Booleans, Buffers, Windows and Tabpages
output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {')