luaa: rename luaA_toudata2() to luaA_toudata()

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-04-11 13:39:15 +02:00
parent 7da55e899b
commit a4a745d505
4 changed files with 6 additions and 6 deletions

6
luaa.c
View File

@ -413,7 +413,7 @@ luaAe_type(lua_State *L)
luaL_checkany(L, 1); luaL_checkany(L, 1);
#define CHECK_TYPE(type) \ #define CHECK_TYPE(type) \
do { \ do { \
if(luaA_toudata2(L, 1, #type)) \ if(luaA_toudata(L, 1, #type)) \
{ \ { \
lua_pushliteral(L, #type); \ lua_pushliteral(L, #type); \
return 1; \ return 1; \
@ -534,7 +534,7 @@ luaA_wtable_newindex(lua_State *L)
/* get current key value in content table */ /* get current key value in content table */
lua_rawget(L, lua_upvalueindex(1)); lua_rawget(L, lua_upvalueindex(1));
/* if value is a widget, notify change */ /* 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; invalid = true;
lua_pop(L, 1); /* remove value */ lua_pop(L, 1); /* remove value */
@ -545,7 +545,7 @@ luaA_wtable_newindex(lua_State *L)
luaA_table2wtable(L); luaA_table2wtable(L);
invalid = true; invalid = true;
} }
else if(!invalid && luaA_toudata2(L, 3, "widget")) else if(!invalid && luaA_toudata(L, 3, "widget"))
invalid = true; invalid = true;
/* upvalue 1 is content table */ /* upvalue 1 is content table */

2
luaa.h
View File

@ -114,7 +114,7 @@ luaA_dumpstack(lua_State *L)
* \return A pointer to the object, NULL otherwise. * \return A pointer to the object, NULL otherwise.
*/ */
static inline void * 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); void *p = lua_touserdata(L, ud);
if(p) /* value is a userdata? */ if(p) /* value is a userdata? */

View File

@ -136,7 +136,7 @@ luaA_button_new(lua_State *L)
button_t *button, *orig; button_t *button, *orig;
luaA_ref press = LUA_REFNIL, release = LUA_REFNIL; 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); button_t *copy = button_new(L);
copy->mod = orig->mod; copy->mod = orig->mod;

View File

@ -115,7 +115,7 @@ luaA_table2widgets(lua_State *L, widget_node_array_t *widgets)
} }
else else
{ {
widget_t *widget = luaA_toudata2(L, -1, "widget"); widget_t *widget = luaA_toudata(L, -1, "widget");
if(widget) if(widget)
{ {
widget_node_t w; widget_node_t w;