shithub: lu9-lua

Download patch

ref: 3115a8132fa180084608bd7486c599fc326ffd7b
parent: b569724604d5cae4611894aefde5578333e95f22
author: kvik <kvik@a-b.xyz>
date: Mon Feb 22 11:34:21 EST 2021

los9lib: consistently return Lua integers for timestamp values

--- a/los9lib.c
+++ b/los9lib.c
@@ -236,7 +236,7 @@
 		t = tmnorm(&tm);
 		setallfields(L, &tm);
 	}
-	lua_pushnumber(L, t);
+	lua_pushinteger(L, t);
 	return 1;
 }
 
@@ -245,7 +245,7 @@
 {
 	vlong t1 = luaL_checkinteger(L, 1);
 	vlong t2 = luaL_checkinteger(L, 2);
-	lua_pushnumber(L, (lua_Number)(t1 - t2));
+	lua_pushinteger(L, t1 - t2);
 	return 1;
 }