From eee51492e26bc295d2b67b91aa7bdb97a21e3623 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 Apr 2013 15:48:35 -0300 Subject: dumping and undumping integers --- lundump.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lundump.c') diff --git a/lundump.c b/lundump.c index 2bd8e197..0a8db845 100644 --- a/lundump.c +++ b/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 2.21 2012/03/19 22:58:09 roberto Exp roberto $ +** $Id: lundump.c,v 2.22 2012/05/08 13:53:33 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -69,6 +69,13 @@ static lua_Number LoadNumber(LoadState* S) return x; } +static lua_Integer LoadInteger(LoadState* S) +{ + lua_Integer x; + LoadVar(S,x); + return x; +} + static TString* LoadString(LoadState* S) { size_t size; @@ -112,10 +119,13 @@ static void LoadConstants(LoadState* S, Proto* f) case LUA_TBOOLEAN: setbvalue(o,LoadChar(S)); break; - case LUA_TNUMBER: + case LUA_TNUMFLT: setnvalue(o,LoadNumber(S)); break; - case LUA_TSTRING: + case LUA_TNUMINT: + setivalue(o,LoadInteger(S)); + break; + case LUA_TSHRSTR: case LUA_TLNGSTR: setsvalue2n(S->L,o,LoadString(S)); break; default: lua_assert(0); -- cgit v1.2.3-55-g6feb