From 0705e7b39f29ad140c2c0deb01ee5d4706f77636 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 9 Feb 2015 15:41:54 -0200 Subject: [PATCH] detail (no need to write 'double' in source) --- loslib.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/loslib.c b/loslib.c index 65aaeaeb..5a8ccacb 100644 --- a/loslib.c +++ b/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.54 2014/12/26 14:46:07 roberto Exp roberto $ +** $Id: loslib.c,v 1.55 2015/01/12 19:32:32 roberto Exp roberto $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -297,8 +297,9 @@ static int os_time (lua_State *L) { static int os_difftime (lua_State *L) { - double res = difftime((l_checktime(L, 1)), (l_checktime(L, 2))); - lua_pushnumber(L, (lua_Number)res); + time_t t1 = l_checktime(L, 1); + time_t t2 = l_checktime(L, 2); + lua_pushnumber(L, (lua_Number)difftime(t1, t2)); return 1; }