summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-15 23:33:19 +0800
committerruki <[email protected]>2025-10-15 23:33:19 +0800
commitf0b315e3877a1c8737c8bc4f14bfc8af6c93ec88 (patch)
tree2676202cd0b53e255e67c15abf129c8c36fff42c /core/src
parent701ac0b627ee0c90e0c2e2c95771427c3ea43794 (diff)
fix main file size
Diffstat (limited to 'core/src')
-rw-r--r--core/src/xmake/engine.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c
index 30f48f5e9..0e79140e6 100644
--- a/core/src/xmake/engine.c
+++ b/core/src/xmake/engine.c
@@ -1443,22 +1443,22 @@ static tb_bool_t xm_engine_load_main_script(xm_engine_t* engine, tb_char_t const
}
// get file size
- tb_hong_t size = tb_file_size(file);
- tb_assert_and_check_break(size > 0);
+ tb_size_t size = (tb_size_t)tb_file_size(file);
+ tb_assert_and_check_break(size);
// allocate buffer
- data = (tb_byte_t*)tb_malloc((tb_size_t)size);
+ data = (tb_byte_t*)tb_malloc(size);
tb_assert_and_check_break(data);
// read file content
- if (!tb_file_read(file, data, (tb_size_t)size))
+ if (!tb_file_read(file, data, size))
{
tb_printf("error: cannot read file: %s\n", mainfile);
break;
}
// load lua buffer
- if (luaL_loadbuffer(engine->lua, (tb_char_t const*)data, (tb_size_t)size, mainfile))
+ if (luaL_loadbuffer(engine->lua, (tb_char_t const*)data, size, mainfile))
{
tb_printf("error: %s\n", lua_tostring(engine->lua, -1));
break;