Unnecessary #define's to static inline functions
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
This commit is contained in:
parent
d61cdb86c9
commit
a77dc54f87
|
@ -28,11 +28,17 @@
|
|||
/** Lua function to call on dofuction() error */
|
||||
lua_CFunction lualib_dofunction_on_error;
|
||||
|
||||
#define luaA_checkfunction(L, n) \
|
||||
do { \
|
||||
if(!lua_isfunction(L, n)) \
|
||||
luaL_typerror(L, n, "function"); \
|
||||
} while(0)
|
||||
static inline void luaA_checkfunction(lua_State *L, int idx)
|
||||
{
|
||||
if(!lua_isfunction(L, idx))
|
||||
luaL_typerror(L, idx, "function");
|
||||
}
|
||||
|
||||
static inline void luaA_checktable(lua_State *L, int idx)
|
||||
{
|
||||
if(!lua_istable(L, idx))
|
||||
luaL_typerror(L, idx, "table");
|
||||
}
|
||||
|
||||
/** Dump the Lua stack. Useful for debugging.
|
||||
* \param L The Lua VM state.
|
||||
|
@ -115,12 +121,6 @@ luaA_dofunction(lua_State *L, int nargs, int nret)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define luaA_checktable(L, n) \
|
||||
do { \
|
||||
if(!lua_istable(L, n)) \
|
||||
luaL_typerror(L, n, "table"); \
|
||||
} while(0)
|
||||
|
||||
#endif
|
||||
|
||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in New Issue