diff options
| author | ruki <[email protected]> | 2021-10-10 00:02:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-10-10 00:02:03 +0800 |
| commit | 37efd34d9f539e1b98404ad1134aa83b9baee0e4 (patch) | |
| tree | 44b5cb8c045d09e5680e3a0b243b64365188de90 | |
| parent | ff96f6c08fcf72b44226626e1d04be60e92ac37c (diff) | |
fix more unpack
| -rw-r--r-- | xmake/core/base/interpreter.lua | 4 | ||||
| -rw-r--r-- | xmake/core/base/scopeinfo.lua | 8 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/utils.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/clang_cl/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/dmd/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/fpc/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/go/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/rustc/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/sdcc/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/swiftc/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/zig/has_flags.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/lua/main.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/cuda/gencodes/xmake.lua | 2 |
13 files changed, 18 insertions, 18 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index 32602c4c4..13225ccd5 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -1306,7 +1306,7 @@ function interpreter:api_register_set_paths(scope_kind, ...) end -- translate paths - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) local paths = self:_api_translate_paths(values, "set_" .. name) -- save values @@ -1378,7 +1378,7 @@ function interpreter:api_register_add_paths(scope_kind, ...) end -- translate paths - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) local paths = self:_api_translate_paths(values, "add_" .. name) -- save values diff --git a/xmake/core/base/scopeinfo.lua b/xmake/core/base/scopeinfo.lua index 6c0563da2..9d4888f1c 100644 --- a/xmake/core/base/scopeinfo.lua +++ b/xmake/core/base/scopeinfo.lua @@ -109,7 +109,7 @@ function _instance:_api_set_values(name, ...) end -- expand values - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) -- handle values local handled_values = self:_api_handle(values) @@ -148,7 +148,7 @@ function _instance:_api_add_values(name, ...) end -- expand values - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) -- save values scope[name] = self:_api_handle(table.join2(table.wrap(scope[name]), values)) @@ -311,7 +311,7 @@ function _instance:_api_set_paths(name, ...) end -- expand values - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) -- translate paths local paths = interp:_api_translate_paths(values, "set_" .. name, 5) @@ -351,7 +351,7 @@ function _instance:_api_add_paths(name, ...) end -- expand values - values = table.join(unpack(values)) + values = table.join(table.unpack(values)) -- translate paths local paths = interp:_api_translate_paths(values, "add_" .. name, 5) diff --git a/xmake/core/sandbox/modules/utils.lua b/xmake/core/sandbox/modules/utils.lua index 59b4cf628..b2f9a682a 100644 --- a/xmake/core/sandbox/modules/utils.lua +++ b/xmake/core/sandbox/modules/utils.lua @@ -55,10 +55,10 @@ function sandbox_utils._print(...) end -- print multi-variables with raw lua action - utils._print(unpack(args)) + utils._print(table.unpack(args)) -- write to the log file - log:printv(unpack(args)) + log:printv(table.unpack(args)) end -- print format string with newline diff --git a/xmake/modules/detect/tools/clang_cl/has_flags.lua b/xmake/modules/detect/tools/clang_cl/has_flags.lua index 27728697f..4917fb665 100644 --- a/xmake/modules/detect/tools/clang_cl/has_flags.lua +++ b/xmake/modules/detect/tools/clang_cl/has_flags.lua @@ -61,7 +61,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- try running to check flags diff --git a/xmake/modules/detect/tools/dmd/has_flags.lua b/xmake/modules/detect/tools/dmd/has_flags.lua index 459db9228..235e99d4c 100644 --- a/xmake/modules/detect/tools/dmd/has_flags.lua +++ b/xmake/modules/detect/tools/dmd/has_flags.lua @@ -40,7 +40,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/fpc/has_flags.lua b/xmake/modules/detect/tools/fpc/has_flags.lua index 9f66939cc..109e1014b 100644 --- a/xmake/modules/detect/tools/fpc/has_flags.lua +++ b/xmake/modules/detect/tools/fpc/has_flags.lua @@ -26,7 +26,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/go/has_flags.lua b/xmake/modules/detect/tools/go/has_flags.lua index 267d4de8a..e1acf3769 100644 --- a/xmake/modules/detect/tools/go/has_flags.lua +++ b/xmake/modules/detect/tools/go/has_flags.lua @@ -35,7 +35,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/rustc/has_flags.lua b/xmake/modules/detect/tools/rustc/has_flags.lua index e7c55a180..904a3c85a 100644 --- a/xmake/modules/detect/tools/rustc/has_flags.lua +++ b/xmake/modules/detect/tools/rustc/has_flags.lua @@ -26,7 +26,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/sdcc/has_flags.lua b/xmake/modules/detect/tools/sdcc/has_flags.lua index 1198b6f44..c7c440a8a 100644 --- a/xmake/modules/detect/tools/sdcc/has_flags.lua +++ b/xmake/modules/detect/tools/sdcc/has_flags.lua @@ -41,7 +41,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/swiftc/has_flags.lua b/xmake/modules/detect/tools/swiftc/has_flags.lua index 541b897a9..fc4ff6540 100644 --- a/xmake/modules/detect/tools/swiftc/has_flags.lua +++ b/xmake/modules/detect/tools/swiftc/has_flags.lua @@ -26,7 +26,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/modules/detect/tools/zig/has_flags.lua b/xmake/modules/detect/tools/zig/has_flags.lua index b12f3defb..1dea91cfe 100644 --- a/xmake/modules/detect/tools/zig/has_flags.lua +++ b/xmake/modules/detect/tools/zig/has_flags.lua @@ -34,7 +34,7 @@ function _try_running(...) local argv = {...} local errors = nil - return try { function () os.runv(unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors + return try { function () os.runv(table.unpack(argv)); return true end, catch { function (errs) errors = (errs or ""):trim() end }}, errors end -- attempt to check it from the argument list diff --git a/xmake/plugins/lua/main.lua b/xmake/plugins/lua/main.lua index 40b16249e..cf0ed80a1 100644 --- a/xmake/plugins/lua/main.lua +++ b/xmake/plugins/lua/main.lua @@ -122,7 +122,7 @@ function _run_script(script, args) if _is_callable(func) then local result = table.pack(func(table.unpack(args, 1, args.n))) if printresult and result and result.n ~= 0 then - utils.dump(unpack(result, 1, result.n)) + utils.dump(table.unpack(result, 1, result.n)) end else -- dump variables directly diff --git a/xmake/rules/cuda/gencodes/xmake.lua b/xmake/rules/cuda/gencodes/xmake.lua index b5ebc22d1..e208c1f4f 100644 --- a/xmake/rules/cuda/gencodes/xmake.lua +++ b/xmake/rules/cuda/gencodes/xmake.lua @@ -112,7 +112,7 @@ rule("cuda.gencodes") if v_arch then table.insert(r_archs, v_arch) else - v_arch = math.min(unpack(r_archs)) + v_arch = math.min(table.unpack(r_archs)) end r_archs = table.unique(r_archs) |
