We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 721061d commit 6d3217eCopy full SHA for 6d3217e
evdev/util.lua
@@ -43,6 +43,12 @@ local mod = {
43
enum = enum,
44
}
45
46
+---@param bits number|number[]
47
+---@return number
48
+function mod.bit_or(bits)
49
+ return type(bits) == "number" and bits or bit.bor(table.unpack(bits))
50
+end
51
+
52
---@param str_ptr ffi.cdata* pointer to string
53
---@return string
54
function mod.to_string(str_ptr)
@@ -53,7 +59,7 @@ end
59
---@param flags number[]
60
---@return number fd file descriptor
55
61
function mod.open_file(pathname, flags)
56
- return open(pathname, bit.bor(table.unpack(flags)))
62
+ return open(pathname, mod.bit_or(flags))
57
63
end
58
64
65
---@param errnum number
0 commit comments