From fe2c204a2c0ea0bea1b595781b38c7c668b76892 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 27 Oct 2019 19:07:58 -0300 Subject: [PATCH] Use Data:getFFIPointer instead of Data:getPointer for internal ImageData and SoundData FFI code. --- src/common/runtime.cpp | 2 +- src/modules/image/wrap_ImageData.lua | 2 +- src/modules/sound/wrap_SoundData.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index 36f1ddcea..b4c4efbab 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -941,7 +941,7 @@ void luax_runwrapper(lua_State *L, const char *filedata, size_t datalen, const c { luax_gettypemetatable(L, type); - // Load and execute ImageData.lua, sending the metatable and the ffi + // Load and execute the given Lua file, sending the metatable and the ffi // functions struct pointer as arguments. if (lua_istable(L, -1)) { diff --git a/src/modules/image/wrap_ImageData.lua b/src/modules/image/wrap_ImageData.lua index e671fa924..e40b3d584 100644 --- a/src/modules/image/wrap_ImageData.lua +++ b/src/modules/image/wrap_ImageData.lua @@ -368,7 +368,7 @@ local objectcache = setmetatable({}, { width = width, height = height, format = format, - pointer = ffi.cast(conv.pointer, imagedata:getPointer()), + pointer = ffi.cast(conv.pointer, imagedata:getFFIPointer()), tolua = conv.tolua, fromlua = conv.fromlua, } diff --git a/src/modules/sound/wrap_SoundData.lua b/src/modules/sound/wrap_SoundData.lua index 4bc88361d..f56da9b49 100644 --- a/src/modules/sound/wrap_SoundData.lua +++ b/src/modules/sound/wrap_SoundData.lua @@ -55,7 +55,7 @@ local objectcache = setmetatable({}, { __mode = "k", __index = function(self, sounddata) local bytedepth = _getBitDepth(sounddata) / 8 - local pointer = ffi.cast(datatypes[bytedepth], sounddata:getPointer()) + local pointer = ffi.cast(datatypes[bytedepth], sounddata:getFFIPointer()) local p = { bytedepth = bytedepth,