From df9633cb76c08ab600ded4b3c2b2596edb5ba057 Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Fri, 1 May 2015 03:19:12 +0200 Subject: Fix warnings emitted by luacheck. --- compat53/init.lua | 4 ++-- compat53/module.lua | 14 +++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/compat53/init.lua b/compat53/init.lua index 31085be..b952003 100644 --- a/compat53/init.lua +++ b/compat53/init.lua @@ -46,7 +46,7 @@ if lua_version == "5.1" then if not is_luajit then - local function helper(st, var_1, ...) + local function helper(_, var_1, ...) if var_1 == nil then if (...) ~= nil then error((...), 2) @@ -197,7 +197,7 @@ if lua_version == "5.1" then msg = msg:gsub("%z+", function(zeros) return "\n\t(..."..#zeros.." tail call(s)...)" end) - msg = msg:gsub("\001", function(zeros) + msg = msg:gsub("\001", function() return "\n\t..." end) return msg diff --git a/compat53/module.lua b/compat53/module.lua index 0dd0317..f278f13 100644 --- a/compat53/module.lua +++ b/compat53/module.lua @@ -40,14 +40,6 @@ if lua_version < "5.3" then end end - local function checktype(x, t, i, f) - local xt = type(x) - if xt ~= t then - error("bad argument #"..i.." to '"..f.."' ("..t.. - " expected, got "..xt..")", 0) - end - end - -- load utf8 library local utf8_ok, utf8lib = pcall(require, "compat53.utf8") @@ -94,7 +86,7 @@ if lua_version < "5.3" then -- update math library do - local maxint, minint = 1, 0 + local maxint, minint = 1 while maxint+1 > maxint and 2*maxint > maxint do maxint = maxint * 2 @@ -269,10 +261,10 @@ if lua_version < "5.3" then x, y, a, b = y, x, b, a end if not cmp(y, z) then - y, z, b, c = z, y, c, b + y, b = z, c end if not cmp(x, y) then - x, y, a, b = y, x, b, a + y, b = x, a end return b, y else -- cgit v1.2.3-55-g6feb