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 function to call on dofuction() error */
|
||||||
lua_CFunction lualib_dofunction_on_error;
|
lua_CFunction lualib_dofunction_on_error;
|
||||||
|
|
||||||
#define luaA_checkfunction(L, n) \
|
static inline void luaA_checkfunction(lua_State *L, int idx)
|
||||||
do { \
|
{
|
||||||
if(!lua_isfunction(L, n)) \
|
if(!lua_isfunction(L, idx))
|
||||||
luaL_typerror(L, n, "function"); \
|
luaL_typerror(L, idx, "function");
|
||||||
} while(0)
|
}
|
||||||
|
|
||||||
|
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.
|
/** Dump the Lua stack. Useful for debugging.
|
||||||
* \param L The Lua VM state.
|
* \param L The Lua VM state.
|
||||||
|
@ -115,12 +121,6 @@ luaA_dofunction(lua_State *L, int nargs, int nret)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define luaA_checktable(L, n) \
|
|
||||||
do { \
|
|
||||||
if(!lua_istable(L, n)) \
|
|
||||||
luaL_typerror(L, n, "table"); \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue