diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-17 08:07:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-17 08:07:26 -0300 |
commit | ea3155e380080095a6f8c63297f0505789cf08b7 (patch) | |
tree | 5042b7d258e89ccaa256b1cde1a61d5304108511 /ldblib.c | |
parent | c172a4f7c2d452035f9cbb4285f2e6761ab7a68b (diff) | |
download | lua-github-ea3155e380080095a6f8c63297f0505789cf08b7.tar.gz |
'debug.sizeof' removed
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 30 |
1 files changed, 1 insertions, 29 deletions
@@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.141 2014/08/22 16:22:42 roberto Exp roberto $ +** $Id: ldblib.c,v 1.142 2014/10/01 11:54:56 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -21,33 +21,6 @@ #define HOOKKEY "_HKEY" -static int db_Csize (lua_State *L) { - static struct { - char c; - unsigned char sz; - } sizes[] = { - {'I', sizeof(lua_Integer)}, - {'F', sizeof(lua_Number)}, - {'h', sizeof(short)}, - {'i', sizeof(int)}, - {'l', sizeof(long)}, - {'z', sizeof(size_t)}, - {'f', sizeof(float)}, - {'d', sizeof(double)}, - {'p', sizeof(void*)} - }; - const char *s = luaL_checkstring(L, 1); - int i; - for (i = 0; i < (int)(sizeof(sizes)/sizeof(sizes[0])); i++) { - if (*s == sizes[i].c) { - lua_pushinteger(L, sizes[i].sz); - return 1; - } - } - return luaL_argerror(L, 1, lua_pushfstring(L, "invalid option '%c'", *s)); -} - - static int db_getregistry (lua_State *L) { lua_pushvalue(L, LUA_REGISTRYINDEX); return 1; @@ -428,7 +401,6 @@ static int db_traceback (lua_State *L) { static const luaL_Reg dblib[] = { - {"sizeof", db_Csize}, {"debug", db_debug}, {"getuservalue", db_getuservalue}, {"gethook", db_gethook}, |