luaa: rename luaA_toudata2() to luaA_toudata()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7da55e899b
commit
a4a745d505
6
luaa.c
6
luaa.c
|
@ -413,7 +413,7 @@ luaAe_type(lua_State *L)
|
|||
luaL_checkany(L, 1);
|
||||
#define CHECK_TYPE(type) \
|
||||
do { \
|
||||
if(luaA_toudata2(L, 1, #type)) \
|
||||
if(luaA_toudata(L, 1, #type)) \
|
||||
{ \
|
||||
lua_pushliteral(L, #type); \
|
||||
return 1; \
|
||||
|
@ -534,7 +534,7 @@ luaA_wtable_newindex(lua_State *L)
|
|||
/* get current key value in content table */
|
||||
lua_rawget(L, lua_upvalueindex(1));
|
||||
/* if value is a widget, notify change */
|
||||
if(lua_istable(L, -1) || luaA_toudata2(L, -1, "widget"))
|
||||
if(lua_istable(L, -1) || luaA_toudata(L, -1, "widget"))
|
||||
invalid = true;
|
||||
|
||||
lua_pop(L, 1); /* remove value */
|
||||
|
@ -545,7 +545,7 @@ luaA_wtable_newindex(lua_State *L)
|
|||
luaA_table2wtable(L);
|
||||
invalid = true;
|
||||
}
|
||||
else if(!invalid && luaA_toudata2(L, 3, "widget"))
|
||||
else if(!invalid && luaA_toudata(L, 3, "widget"))
|
||||
invalid = true;
|
||||
|
||||
/* upvalue 1 is content table */
|
||||
|
|
2
luaa.h
2
luaa.h
|
@ -114,7 +114,7 @@ luaA_dumpstack(lua_State *L)
|
|||
* \return A pointer to the object, NULL otherwise.
|
||||
*/
|
||||
static inline void *
|
||||
luaA_toudata2(lua_State *L, int ud, const char *tname)
|
||||
luaA_toudata(lua_State *L, int ud, const char *tname)
|
||||
{
|
||||
void *p = lua_touserdata(L, ud);
|
||||
if(p) /* value is a userdata? */
|
||||
|
|
2
mouse.c
2
mouse.c
|
@ -136,7 +136,7 @@ luaA_button_new(lua_State *L)
|
|||
button_t *button, *orig;
|
||||
luaA_ref press = LUA_REFNIL, release = LUA_REFNIL;
|
||||
|
||||
if((orig = luaA_toudata2(L, 2, "button")))
|
||||
if((orig = luaA_toudata(L, 2, "button")))
|
||||
{
|
||||
button_t *copy = button_new(L);
|
||||
copy->mod = orig->mod;
|
||||
|
|
Loading…
Reference in New Issue