summaryrefslogtreecommitdiff
path: root/xmake/core/base
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-10 00:01:01 +0800
committerruki <[email protected]>2021-10-10 00:01:01 +0800
commitff96f6c08fcf72b44226626e1d04be60e92ac37c (patch)
tree772bc2adb964e9488ea54c59da642c59710c69b4 /xmake/core/base
parent1af0820871a06217312fcee22b68e15954fc553a (diff)
fix some unpack
Diffstat (limited to 'xmake/core/base')
-rw-r--r--xmake/core/base/os.lua2
-rw-r--r--xmake/core/base/pipe.lua2
-rw-r--r--xmake/core/base/scopeinfo.lua8
-rw-r--r--xmake/core/base/socket.lua4
-rw-r--r--xmake/core/base/table.lua4
5 files changed, 10 insertions, 10 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index 312d5705d..a4fdb570e 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -377,7 +377,7 @@ end
-- match directories
--
--- @note only return {} without count to simplify code, e.g. unpack(os.dirs(""))
+-- @note only return {} without count to simplify code, e.g. table.unpack(os.dirs(""))
--
function os.dirs(pattern, callback)
return (os.match(pattern, 'd', callback))
diff --git a/xmake/core/base/pipe.lua b/xmake/core/base/pipe.lua
index 5f7c46c06..92ad42bc6 100644
--- a/xmake/core/base/pipe.lua
+++ b/xmake/core/base/pipe.lua
@@ -67,7 +67,7 @@ function _instance:write(data, opt)
return -1, errors
end
- -- data is bytes? unpack the raw address
+ -- data is bytes? table.unpack the raw address
local datasize = #data
if type(data) == "table" and data.caddr then
datasize = data:size()
diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua
index 1f07e236f..6c0563da2 100644
--- a/xmake/core/base/scopeinfo.lua
+++ b/xmake/core/base/scopeinfo.lua
@@ -451,7 +451,7 @@ function _instance:apival_set(name, ...)
local array = name
for _, dict in ipairs(array) do
for k, v in pairs(dict) do
- self:apival_set(k, unpack(table.wrap(v)))
+ self:apival_set(k, table.unpack(table.wrap(v)))
end
end
@@ -459,7 +459,7 @@ function _instance:apival_set(name, ...)
elseif table.is_dictionary(name) then
local dict = name
for k, v in pairs(dict) do
- self:apival_set(k, unpack(table.wrap(v)))
+ self:apival_set(k, table.unpack(table.wrap(v)))
end
elseif name ~= nil then
os.raise("unknown type(%s) for %s:set(%s, ...)", type(name), self:kind(), name)
@@ -487,7 +487,7 @@ function _instance:apival_add(name, ...)
local array = name
for _, dict in ipairs(array) do
for k, v in pairs(dict) do
- self:apival_add(k, unpack(table.wrap(v)))
+ self:apival_add(k, table.unpack(table.wrap(v)))
end
end
@@ -495,7 +495,7 @@ function _instance:apival_add(name, ...)
elseif table.is_dictionary(name) then
local dict = name
for k, v in pairs(dict) do
- self:apival_add(k, unpack(table.wrap(v)))
+ self:apival_add(k, table.unpack(table.wrap(v)))
end
elseif name ~= nil then
os.raise("unknown type(%s) for %s:add(%s, ...)", type(name), self:kind(), name)
diff --git a/xmake/core/base/socket.lua b/xmake/core/base/socket.lua
index 7269cb504..4e6435c09 100644
--- a/xmake/core/base/socket.lua
+++ b/xmake/core/base/socket.lua
@@ -244,7 +244,7 @@ function _instance:send(data, opt)
return -1, errors
end
- -- data is bytes? unpack the raw address
+ -- data is bytes? table.unpack the raw address
local datasize = #data
if type(data) == "table" and data.caddr then
datasize = data:size()
@@ -442,7 +442,7 @@ function _instance:sendto(data, addr, port, opt)
return -1, string.format("%s: sendto empty address!", self)
end
- -- data is bytes? unpack the raw address
+ -- data is bytes? table.unpack the raw address
if type(data) == "table" and data.caddr then
data = {data = data:caddr(), size = data:size()}
end
diff --git a/xmake/core/base/table.lua b/xmake/core/base/table.lua
index 372e5f975..72987c1b6 100644
--- a/xmake/core/base/table.lua
+++ b/xmake/core/base/table.lua
@@ -327,9 +327,9 @@ function table.pack(...)
return { n = select("#", ...), ... }
end
--- unpack table values
+-- table.unpack table values
-- polyfill of lua 5.2, @see https://www.lua.org/manual/5.2/manual.html#pdf-table.unpack
-table.unpack = table.unpack or unpack
+table.unpack = table.unpack or table.unpack
-- get keys of a table
function table.keys(tab)