summaryrefslogtreecommitdiff
path: root/src/lua5/cdlua5.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-08-05 18:44:49 +0000
committerscuri <scuri>2009-08-05 18:44:49 +0000
commit4eb6a7ae0fa0fa11c7e538b948af1417764d4134 (patch)
treea250d2807e85c463ec52eee34d90e9239ec1a384 /src/lua5/cdlua5.c
parente2b3655c339d18b91cc3c824b04fe7a57d51bdfe (diff)
*** empty log message ***
Diffstat (limited to 'src/lua5/cdlua5.c')
-rw-r--r--src/lua5/cdlua5.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lua5/cdlua5.c b/src/lua5/cdlua5.c
index 7b7b617..bff00df 100644
--- a/src/lua5/cdlua5.c
+++ b/src/lua5/cdlua5.c
@@ -900,7 +900,7 @@ static int cdlua5_version(lua_State *L)
\***************************************************************************/
static int cdlua5_registercallback(lua_State *L)
{
- int cb_i, func_lock;
+ int cb_i, func_lock, ret = CD_ERROR;
cdluaCallback* cdCB;
cdluaContext* cdlua_ctx;
@@ -926,7 +926,7 @@ static int cdlua5_registercallback(lua_State *L)
cdCB->lock = func_lock;
if (func_lock == -1)
{
- cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, NULL);
+ ret = cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, NULL);
}
}
else
@@ -934,10 +934,11 @@ static int cdlua5_registercallback(lua_State *L)
if (func_lock != -1)
{
cdContextRegisterCallback(cdlua_ctx->ctx(), cb_i, (cdCallback)cdCB->func);
- cdCB->lock = func_lock;
+ ret = cdCB->lock = func_lock;
}
}
- return 0;
+ lua_pushnumber(L, ret);
+ return 1;
}
@@ -1257,7 +1258,7 @@ static int cdlua5_getscreensize(lua_State *L)
\***************************************************************************/
static int cdlua5_usecontextplus(lua_State *L)
{
- lua_pushnumber(L, cdUseContextPlus(luaL_checkint(L, 1)));
+ lua_pushboolean(L, cdUseContextPlus(lua_toboolean(L, 1)));
return 1;
}