diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-08 16:57:31 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-08 16:57:31 -0300 |
commit | 65ec3379b10654f49b7faaf841b308b0cbb7b68b (patch) | |
tree | 7e8acbb37ec5f38c018b2fd35270d419d562f3d1 /loslib.c | |
parent | 85fc9ecd5f5d2af63d48f6ac2bb46217e3fa6a04 (diff) | |
download | lua-65ec3379b10654f49b7faaf841b308b0cbb7b68b.tar.gz lua-65ec3379b10654f49b7faaf841b308b0cbb7b68b.tar.bz2 lua-65ec3379b10654f49b7faaf841b308b0cbb7b68b.zip |
added some casts for the cases when lua_Number != double
Diffstat (limited to 'loslib.c')
-rw-r--r-- | loslib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.46 2014/04/29 17:05:13 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.47 2014/10/01 11:54:56 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 | */ |
@@ -295,7 +295,8 @@ static int os_time (lua_State *L) { | |||
295 | 295 | ||
296 | 296 | ||
297 | static int os_difftime (lua_State *L) { | 297 | static int os_difftime (lua_State *L) { |
298 | lua_pushnumber(L, difftime((l_checktime(L, 1)), (l_checktime(L, 2)))); | 298 | double res = difftime((l_checktime(L, 1)), (l_checktime(L, 2))); |
299 | lua_pushnumber(L, (lua_Number)res); | ||
299 | return 1; | 300 | return 1; |
300 | } | 301 | } |
301 | 302 | ||