From b94789d65449527a17187cf00fc2ed887f40df58 Mon Sep 17 00:00:00 2001 From: OpportunityLiu Date: Tue, 2 Jul 2019 11:59:11 +0800 Subject: remove unused code --- core/src/xmake/io/std.c | 7 ++++--- core/src/xmake/machine.c | 12 ------------ 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/core/src/xmake/io/std.c b/core/src/xmake/io/std.c index d97ae3ef8..6830f85d6 100644 --- a/core/src/xmake/io/std.c +++ b/core/src/xmake/io/std.c @@ -29,7 +29,7 @@ * includes */ #include "file.h" -#include "prefix.h" +#include "prefix.h" #include #ifdef TB_CONFIG_OS_WINDOWS # include @@ -71,8 +71,9 @@ static void xm_init(lua_State* lua, tb_size_t type) { tb_assert_and_check_return(lua); - tb_char_t const *name, *path; - FILE* fp; + tb_char_t const* name = tb_null; + tb_char_t const* path = tb_null; + FILE* fp = tb_null; switch (type) { case XM_IO_FILE_TYPE_STDIN: diff --git a/core/src/xmake/machine.c b/core/src/xmake/machine.c index f09f941e1..098966f24 100644 --- a/core/src/xmake/machine.c +++ b/core/src/xmake/machine.c @@ -167,12 +167,6 @@ tb_int_t xm_curses_register(lua_State* lua); * globals */ -// the global functions -static luaL_Reg const g_functions[] = -{ - { tb_null, tb_null } -}; - // the os functions static luaL_Reg const g_os_functions[] = { @@ -639,12 +633,6 @@ xm_machine_ref_t xm_machine_init() lua_setglobal(machine->lua, "curses"); #endif - // bind global functions - for (tb_size_t i = 0; g_functions[i].name != tb_null && g_functions[i].func != tb_null; i++) - { - lua_register(machine->lua, g_functions[i].name, g_functions[i].func); - } - // init host #if defined(TB_CONFIG_OS_WINDOWS) lua_pushstring(machine->lua, "windows"); -- cgit v1.3.1