diff options
author | Philipp Janda <siffiejoe@gmx.net> | 2015-05-01 03:19:12 +0200 |
---|---|---|
committer | Philipp Janda <siffiejoe@gmx.net> | 2015-05-01 03:19:12 +0200 |
commit | df9633cb76c08ab600ded4b3c2b2596edb5ba057 (patch) | |
tree | 76f60adf5f368b1ba934907db4a27389ae243381 | |
parent | 924cdb2a7a6f50688c442e548179a725559572d4 (diff) | |
download | lua-compat-5.3-0.2.tar.gz lua-compat-5.3-0.2.tar.bz2 lua-compat-5.3-0.2.zip |
Fix warnings emitted by luacheck.v0.2
-rw-r--r-- | compat53/init.lua | 4 | ||||
-rw-r--r-- | 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 | |||
46 | 46 | ||
47 | 47 | ||
48 | if not is_luajit then | 48 | if not is_luajit then |
49 | local function helper(st, var_1, ...) | 49 | local function helper(_, var_1, ...) |
50 | if var_1 == nil then | 50 | if var_1 == nil then |
51 | if (...) ~= nil then | 51 | if (...) ~= nil then |
52 | error((...), 2) | 52 | error((...), 2) |
@@ -197,7 +197,7 @@ if lua_version == "5.1" then | |||
197 | msg = msg:gsub("%z+", function(zeros) | 197 | msg = msg:gsub("%z+", function(zeros) |
198 | return "\n\t(..."..#zeros.." tail call(s)...)" | 198 | return "\n\t(..."..#zeros.." tail call(s)...)" |
199 | end) | 199 | end) |
200 | msg = msg:gsub("\001", function(zeros) | 200 | msg = msg:gsub("\001", function() |
201 | return "\n\t..." | 201 | return "\n\t..." |
202 | end) | 202 | end) |
203 | return msg | 203 | 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 | |||
40 | end | 40 | end |
41 | end | 41 | end |
42 | 42 | ||
43 | local function checktype(x, t, i, f) | ||
44 | local xt = type(x) | ||
45 | if xt ~= t then | ||
46 | error("bad argument #"..i.." to '"..f.."' ("..t.. | ||
47 | " expected, got "..xt..")", 0) | ||
48 | end | ||
49 | end | ||
50 | |||
51 | 43 | ||
52 | -- load utf8 library | 44 | -- load utf8 library |
53 | local utf8_ok, utf8lib = pcall(require, "compat53.utf8") | 45 | local utf8_ok, utf8lib = pcall(require, "compat53.utf8") |
@@ -94,7 +86,7 @@ if lua_version < "5.3" then | |||
94 | 86 | ||
95 | -- update math library | 87 | -- update math library |
96 | do | 88 | do |
97 | local maxint, minint = 1, 0 | 89 | local maxint, minint = 1 |
98 | 90 | ||
99 | while maxint+1 > maxint and 2*maxint > maxint do | 91 | while maxint+1 > maxint and 2*maxint > maxint do |
100 | maxint = maxint * 2 | 92 | maxint = maxint * 2 |
@@ -269,10 +261,10 @@ if lua_version < "5.3" then | |||
269 | x, y, a, b = y, x, b, a | 261 | x, y, a, b = y, x, b, a |
270 | end | 262 | end |
271 | if not cmp(y, z) then | 263 | if not cmp(y, z) then |
272 | y, z, b, c = z, y, c, b | 264 | y, b = z, c |
273 | end | 265 | end |
274 | if not cmp(x, y) then | 266 | if not cmp(x, y) then |
275 | x, y, a, b = y, x, b, a | 267 | y, b = x, a |
276 | end | 268 | end |
277 | return b, y | 269 | return b, y |
278 | else | 270 | else |