mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 19:25:11 -07:00
lua/converter: Remove useless macros
This commit is contained in:
parent
9bf15ca3fa
commit
a8ade2441d
@ -542,16 +542,6 @@ bool nlua_push_typval(lua_State *lstate, typval_T *const tv)
|
|||||||
return true;
|
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
|
/// Push value which is a type index
|
||||||
///
|
///
|
||||||
/// Used for all “typed” tables: i.e. for all tables which represent VimL
|
/// 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) \
|
void nlua_push_##type(lua_State *lstate, const type item) \
|
||||||
FUNC_ATTR_NONNULL_ALL \
|
FUNC_ATTR_NONNULL_ALL \
|
||||||
{ \
|
{ \
|
||||||
NLUA_PUSH_HANDLE(lstate, type, item); \
|
lua_pushnumber(lstate, (lua_Number)(item)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
GENERATE_INDEX_FUNCTION(Buffer)
|
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 \
|
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT \
|
||||||
{ \
|
{ \
|
||||||
type ret; \
|
type ret; \
|
||||||
NLUA_POP_HANDLE(lstate, type, -1, ret); \
|
ret = (type)lua_tonumber(lstate, -1); \
|
||||||
lua_pop(lstate, 1); \
|
lua_pop(lstate, 1); \
|
||||||
return ret; \
|
return ret; \
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user