From a2d25b7bf81728d913e7b317d33997c8b8268af2 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 19 Jun 2016 21:06:03 +0200 Subject: api: unify buffer numbers and window ids with handles also allow handle==0 meaning curbuf/curwin/curtab --- scripts/gendispatch.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/gendispatch.lua b/scripts/gendispatch.lua index ce1d8be222..9178996a56 100644 --- a/scripts/gendispatch.lua +++ b/scripts/gendispatch.lua @@ -193,9 +193,9 @@ for i = 1, #functions do 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$') or rt:match('^Boolean$') then - -- accept positive integers for Buffers, Windows and Tabpages - output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer > 0) {') - output:write('\n '..converted..' = (unsigned)args.items['..(j - 1)..'].data.integer;') + -- 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) {') + output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;') end output:write('\n } else {') output:write('\n snprintf(error->msg, sizeof(error->msg), "Wrong type for argument '..j..', expecting '..param[1]..'");') -- cgit