diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 15:41:54 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-02-09 15:41:54 -0200 |
commit | 0705e7b39f29ad140c2c0deb01ee5d4706f77636 (patch) | |
tree | 79121ec721fcc7ba95329d890336f7b557954163 /loslib.c | |
parent | 4ccc4578b395f1a3f881e18cdbafa77b8a8d9b99 (diff) | |
download | lua-0705e7b39f29ad140c2c0deb01ee5d4706f77636.tar.gz lua-0705e7b39f29ad140c2c0deb01ee5d4706f77636.tar.bz2 lua-0705e7b39f29ad140c2c0deb01ee5d4706f77636.zip |
detail (no need to write 'double' in source)
Diffstat (limited to 'loslib.c')
-rw-r--r-- | loslib.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.54 2014/12/26 14:46:07 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.55 2015/01/12 19:32:32 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -297,8 +297,9 @@ static int os_time (lua_State *L) { | |||
297 | 297 | ||
298 | 298 | ||
299 | static int os_difftime (lua_State *L) { | 299 | static int os_difftime (lua_State *L) { |
300 | double res = difftime((l_checktime(L, 1)), (l_checktime(L, 2))); | 300 | time_t t1 = l_checktime(L, 1); |
301 | lua_pushnumber(L, (lua_Number)res); | 301 | time_t t2 = l_checktime(L, 2); |
302 | lua_pushnumber(L, (lua_Number)difftime(t1, t2)); | ||
302 | return 1; | 303 | return 1; |
303 | } | 304 | } |
304 | 305 | ||