Skip to content

Commit 570bd8f

Browse files
committed
fix warnning
1 parent 8691625 commit 570bd8f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

script/plugins/ffi/c-parser/cpp.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---@diagnostic disable: undefined-global, assign-type-mismatch
12

23
local cpp = {}
34

@@ -26,7 +27,7 @@ else
2627
]])()
2728
end
2829

29-
local function debug() end
30+
local function debug(...) end
3031
--[[
3132
local inspect = require("inspect")
3233
local function debug(...)

script/plugins/ffi/c-parser/ctypes.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ local convert_value = typed("TypeList, table -> CType?, string?", function (lst,
107107
src.ids = util.expandSingle(src.ids)
108108
-- FIXME multiple ids, e.g.: int *x, y, *z;
109109
local ok
110+
---@diagnostic disable-next-line: cast-local-type
110111
ok, name, ret_pointer, idxs = get_name(src.id or src.ids)
111112
if not ok then
112113
return nil, name

script/plugins/ffi/searchCode.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ local vm = require 'vm'
33
local function getLiterals(arg)
44
local literals = vm.getLiterals(arg)
55
local res = {}
6+
if not literals then
7+
return res
8+
end
69
for k, v in pairs(literals) do
710
if type(k) == 'string' then
811
res[#res+1] = k

0 commit comments

Comments
 (0)