diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/plugins/ffi/c-parser/cpp.lua | 3 | ||||
-rw-r--r-- | script/plugins/ffi/c-parser/ctypes.lua | 1 | ||||
-rw-r--r-- | script/plugins/ffi/searchCode.lua | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/script/plugins/ffi/c-parser/cpp.lua b/script/plugins/ffi/c-parser/cpp.lua index f885e724..989bca66 100644 --- a/script/plugins/ffi/c-parser/cpp.lua +++ b/script/plugins/ffi/c-parser/cpp.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-global, assign-type-mismatch local cpp = {} @@ -26,7 +27,7 @@ else ]])() end -local function debug() end +local function debug(...) end --[[ local inspect = require("inspect") local function debug(...) diff --git a/script/plugins/ffi/c-parser/ctypes.lua b/script/plugins/ffi/c-parser/ctypes.lua index 284fbe84..81d0ccf6 100644 --- a/script/plugins/ffi/c-parser/ctypes.lua +++ b/script/plugins/ffi/c-parser/ctypes.lua @@ -107,6 +107,7 @@ local convert_value = typed("TypeList, table -> CType?, string?", function (lst, src.ids = util.expandSingle(src.ids) -- FIXME multiple ids, e.g.: int *x, y, *z; local ok +---@diagnostic disable-next-line: cast-local-type ok, name, ret_pointer, idxs = get_name(src.id or src.ids) if not ok then return nil, name diff --git a/script/plugins/ffi/searchCode.lua b/script/plugins/ffi/searchCode.lua index 9e74e7c0..86dbc680 100644 --- a/script/plugins/ffi/searchCode.lua +++ b/script/plugins/ffi/searchCode.lua @@ -3,6 +3,9 @@ local vm = require 'vm' local function getLiterals(arg) local literals = vm.getLiterals(arg) local res = {} + if not literals then + return res + end for k, v in pairs(literals) do if type(k) == 'string' then res[#res+1] = k |