From 1ea299542745643cbdb02340a272750ea613b174 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Wed, 21 Feb 2018 21:39:47 +0000 Subject: [PATCH] lualoader: Remove nasty hack for not printing out ".0" luaconf.h has a LUA_COMPAT_FLOATSTRING option that may be defined to do this instead of needing intstring. Reported by: Dan Nelson --- stand/liblua/luaconf.h | 1 + stand/lua/screen.lua | 13 +------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/stand/liblua/luaconf.h b/stand/liblua/luaconf.h index 4cbc14f5e9f..7ed0e85db3a 100644 --- a/stand/liblua/luaconf.h +++ b/stand/liblua/luaconf.h @@ -405,6 +405,7 @@ ** because this is not really an incompatibility. */ /* #define LUA_COMPAT_FLOATSTRING */ +#define LUA_COMPAT_FLOATSTRING /* }================================================================== */ diff --git a/stand/lua/screen.lua b/stand/lua/screen.lua index 2856a1e963d..f3cc52d0f09 100644 --- a/stand/lua/screen.lua +++ b/stand/lua/screen.lua @@ -31,17 +31,6 @@ local core = require("core") local screen = {} --- XXX TODO: This should be fixed in the interpreter to not print decimals -local intstring = function(num) - local str = tostring(num) - local decimal = str:find("%.") - - if decimal then - return str:sub(1, decimal - 1) - end - return str -end - -- Module exports function screen.clear() if core.isSerialBoot() then @@ -55,7 +44,7 @@ function screen.setcursor(x, y) return end - loader.printc("\027[" .. intstring(y) .. ";" .. intstring(x) .. "H") + loader.printc("\027[" .. y .. ";" .. x .. "H") end function screen.setforeground(c)