love2d / love

LÖVE is an awesome 2D game framework for Lua.
https://love2d.org
Other
5.18k stars 405 forks source link

love.filesystem.newFile deprecated message when calling love.thread.newThread #1811

Closed EngineerSmith closed 2 years ago

EngineerSmith commented 2 years ago

Love 12; latest commit 4a1d01c

When calling love.thread.newThread("thread.lua") it will cause a deprecated message to show:

LOVE - Warning: Using deprecated function love.filesystem.newFile (renamed to love.filesystem.openFile)

Note the missing file name and line number unlike the usual deprecated message format LOVE - Warning: dir/file.lua:99: ...

Reproduce:

--main.lua
local thread = love.thread.newThread("thread.lua")
--thread.lua
return
-- conf.lua
love.setDeprecationOutput(true)
love.conf = function(t)
  t.console = true
end
modcos commented 2 years ago

I get same warning when use love.filesystem.newFileData(filepath)

LOVE - Warning: Using deprecated function love.filesystem.newFile (renamed to love.filesystem.openFile)

Probably because of this? https://github.com/love2d/love/blob/5175b0d1b599ea4c7b929f6b4282dd379fa116b8/src/modules/filesystem/wrap_Filesystem.cpp#L310

EngineerSmith commented 2 years ago

Most likely, as love.thread.newThread also calls upon newFileData

slime73 commented 2 years ago

Fixed. Thanks!