summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-07-02 11:59:11 +0800
committerOpportunityLiu <[email protected]>2019-07-02 11:59:11 +0800
commitb94789d65449527a17187cf00fc2ed887f40df58 (patch)
treeabff79951084489923ee4e9196bd95c802803b3b
parent25533776832f2624622917e2ac1a96c243e67b6c (diff)
remove unused code
-rw-r--r--core/src/xmake/io/std.c7
-rw-r--r--core/src/xmake/machine.c12
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 <stdio.h>
#ifdef TB_CONFIG_OS_WINDOWS
# include <io.h>
@@ -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");