summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-25 00:45:11 +0800
committerruki <[email protected]>2024-10-25 00:45:11 +0800
commitecf4f21dd34c684e74618c95a4186d889badb5d3 (patch)
tree6e72e5d3920283764abd7628c733d9a0ea3848dd /xmake
parentc92b5d009f2421ee3cda1933c5cac519659785f1 (diff)
get linewidth
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/utils.lua2
-rw-r--r--xmake/modules/private/utils/bin2c.lua3
2 files changed, 2 insertions, 3 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua
index 2beab7bce..8f1f9a3d0 100644
--- a/xmake/core/base/utils.lua
+++ b/xmake/core/base/utils.lua
@@ -324,7 +324,7 @@ end
-- generate c/c++ code from the binary file
function utils.bin2c(binaryfile, outputfile, opt)
opt = opt or {}
- return utils._bin2c(binaryfile, outputfile, opt.linewidth, opt.nozeroend)
+ return utils._bin2c(binaryfile, outputfile, opt.linewidth or 0x20, opt.nozeroend or false)
end
-- return module
diff --git a/xmake/modules/private/utils/bin2c.lua b/xmake/modules/private/utils/bin2c.lua
index 31b400954..987a478f7 100644
--- a/xmake/modules/private/utils/bin2c.lua
+++ b/xmake/modules/private/utils/bin2c.lua
@@ -20,7 +20,6 @@
-- imports
import("core.base.bytes")
-import("core.base.utils")
import("core.base.option")
local options = {
@@ -84,7 +83,7 @@ function _do_bin2c(binarypath, outputpath, opt)
-- do dump
if utils.bin2c then
- utils.bin2c(binarydata, outputpath, opt)
+ utils.bin2c(binarypath, outputpath, opt)
else
local binarydata = bytes(io.readfile(binarypath, {encoding = "binary"}))
local outputfile = io.open(outputpath, 'w')