diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-11 10:37:14 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-04-11 11:05:19 +0300 |
commit | a8ade2441d41289581628118a88c260c3ebb3fa5 (patch) | |
tree | cbe10be533f846130683b0cd82487bccfd83c1cb /src | |
parent | 9bf15ca3fa2aa5f1a533b7b1598b6e3937fb1b17 (diff) | |
download | rneovim-a8ade2441d41289581628118a88c260c3ebb3fa5.tar.gz rneovim-a8ade2441d41289581628118a88c260c3ebb3fa5.tar.bz2 rneovim-a8ade2441d41289581628118a88c260c3ebb3fa5.zip |
lua/converter: Remove useless macros
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/lua/converter.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/nvim/lua/converter.c b/src/nvim/lua/converter.c index 348315124b..80d9096212 100644 --- a/src/nvim/lua/converter.c +++ b/src/nvim/lua/converter.c @@ -542,16 +542,6 @@ bool nlua_push_typval(lua_State *lstate, typval_T *const tv) return true; } -#define NLUA_PUSH_HANDLE(lstate, type, idx) \ - do { \ - lua_pushnumber(lstate, (lua_Number)(idx)); \ - } while (0) - -#define NLUA_POP_HANDLE(lstate, type, stack_idx, idx) \ - do { \ - idx = (type)lua_tonumber(lstate, stack_idx); \ - } while (0) - /// Push value which is a type index /// /// Used for all “typed” tables: i.e. for all tables which represent VimL @@ -676,7 +666,7 @@ void nlua_push_Array(lua_State *lstate, const Array array) void nlua_push_##type(lua_State *lstate, const type item) \ FUNC_ATTR_NONNULL_ALL \ { \ - NLUA_PUSH_HANDLE(lstate, type, item); \ + lua_pushnumber(lstate, (lua_Number)(item)); \ } GENERATE_INDEX_FUNCTION(Buffer) @@ -1135,7 +1125,7 @@ type nlua_pop_##type(lua_State *lstate, Error *err) \ FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT \ { \ type ret; \ - NLUA_POP_HANDLE(lstate, type, -1, ret); \ + ret = (type)lua_tonumber(lstate, -1); \ lua_pop(lstate, 1); \ return ret; \ } |