commit 9e3db70482e927e5992cccdb5a40424b33ad0a29
parent dbec41f34ca26f4762bbda3c6e99ba227508d743
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 9 Mar 2018 16:24:18 -0300
details (casts between 'lua_Number' and 'double')
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ltests.c b/ltests.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltests.c,v 2.241 2018/02/20 16:52:50 roberto Exp roberto $
+** $Id: ltests.c,v 2.242 2018/02/23 13:13:31 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@@ -957,13 +957,13 @@ static int doonnewstack (lua_State *L) {
static int s2d (lua_State *L) {
- lua_pushnumber(L, *cast(const double *, luaL_checkstring(L, 1)));
+ lua_pushnumber(L, cast_num(*cast(const double *, luaL_checkstring(L, 1))));
return 1;
}
static int d2s (lua_State *L) {
- double d = luaL_checknumber(L, 1);
+ double d = cast(double, luaL_checknumber(L, 1));
lua_pushlstring(L, cast_charp(&d), sizeof(d));
return 1;
}