forked from redo/BlockLua
Fix all warnings and errors in C++
This commit is contained in:
@@ -135,8 +135,8 @@ end
|
||||
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
function io.lines(fn)
|
||||
local fi, err, fn2 = io.open(fn, nil, 2)
|
||||
if not fi then error('Error opening file \'' .. fn2 .. '\': ' .. err, 2) end
|
||||
local fi, err, fn2 = io.open(fn, 'r', 2)
|
||||
if not fi then error('Error opening file \'' .. tostring(fn2) .. '\': ' .. tostring(err), 2) end
|
||||
return fi:lines()
|
||||
end
|
||||
|
||||
@@ -156,7 +156,7 @@ function dofile(fn, errn)
|
||||
errn = errn or 1
|
||||
|
||||
local fi, err, fn2 = io.open(fn, 'r', errn + 1)
|
||||
if not fi then error('Error executing file \'' .. fn2 .. '\': ' .. err, errn + 1) end
|
||||
if not fi then error('Error executing file \'' .. tostring(fn2) .. '\': ' .. tostring(err), errn + 1) end
|
||||
|
||||
print('Executing ' .. fn2)
|
||||
local text = fi:read('*a')
|
||||
|
||||
Reference in New Issue
Block a user