diff options
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.78 2003/02/27 11:52:30 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.79 2003/03/11 12:24:34 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -27,7 +27,7 @@ static void settabss (lua_State *L, const char *i, const char *v) { | |||
27 | 27 | ||
28 | static void settabsi (lua_State *L, const char *i, int v) { | 28 | static void settabsi (lua_State *L, const char *i, int v) { |
29 | lua_pushstring(L, i); | 29 | lua_pushstring(L, i); |
30 | lua_pushnumber(L, v); | 30 | lua_pushnumber(L, (lua_Number)v); |
31 | lua_rawset(L, -3); | 31 | lua_rawset(L, -3); |
32 | } | 32 | } |
33 | 33 | ||
@@ -143,7 +143,8 @@ static void hookf (lua_State *L, lua_Debug *ar) { | |||
143 | lua_rawget(L, LUA_REGISTRYINDEX); | 143 | lua_rawget(L, LUA_REGISTRYINDEX); |
144 | if (lua_isfunction(L, -1)) { | 144 | if (lua_isfunction(L, -1)) { |
145 | lua_pushstring(L, hooknames[(int)ar->event]); | 145 | lua_pushstring(L, hooknames[(int)ar->event]); |
146 | if (ar->currentline >= 0) lua_pushnumber(L, ar->currentline); | 146 | if (ar->currentline >= 0) |
147 | lua_pushnumber(L, (lua_Number)ar->currentline); | ||
147 | else lua_pushnil(L); | 148 | else lua_pushnil(L); |
148 | lua_assert(lua_getinfo(L, "lS", ar)); | 149 | lua_assert(lua_getinfo(L, "lS", ar)); |
149 | lua_call(L, 2, 0); | 150 | lua_call(L, 2, 0); |
@@ -202,7 +203,7 @@ static int gethook (lua_State *L) { | |||
202 | lua_rawget(L, LUA_REGISTRYINDEX); /* get hook */ | 203 | lua_rawget(L, LUA_REGISTRYINDEX); /* get hook */ |
203 | } | 204 | } |
204 | lua_pushstring(L, unmakemask(mask, buff)); | 205 | lua_pushstring(L, unmakemask(mask, buff)); |
205 | lua_pushnumber(L, lua_gethookcount(L)); | 206 | lua_pushnumber(L, (lua_Number)lua_gethookcount(L)); |
206 | return 3; | 207 | return 3; |
207 | } | 208 | } |
208 | 209 | ||