summaryrefslogtreecommitdiff
path: root/core/src/xmake/io/poller_insert.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/xmake/io/poller_insert.c')
-rw-r--r--core/src/xmake/io/poller_insert.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/core/src/xmake/io/poller_insert.c b/core/src/xmake/io/poller_insert.c
index e78c3c18f..81f66cce9 100644
--- a/core/src/xmake/io/poller_insert.c
+++ b/core/src/xmake/io/poller_insert.c
@@ -22,8 +22,8 @@
/* //////////////////////////////////////////////////////////////////////////////////////
* trace
*/
-#define TB_TRACE_MODULE_NAME "poller_insert"
-#define TB_TRACE_MODULE_DEBUG (0)
+#define TB_TRACE_MODULE_NAME "poller_insert"
+#define TB_TRACE_MODULE_DEBUG (0)
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
@@ -36,14 +36,11 @@
*/
// io.poller_insert(obj:otype(), obj:cdata(), events)
-tb_int_t xm_io_poller_insert(lua_State* lua)
-{
- // check
+tb_int_t xm_io_poller_insert(lua_State *lua) {
tb_assert_and_check_return_val(lua, 0);
// is pointer?
- if (!xm_lua_ispointer(lua, 2))
- {
+ if (!xm_lua_ispointer(lua, 2)) {
lua_pushboolean(lua, tb_false);
lua_pushfstring(lua, "invalid poller object!");
return 2;
@@ -53,8 +50,8 @@ tb_int_t xm_io_poller_insert(lua_State* lua)
tb_uint8_t otype = (tb_uint8_t)luaL_checknumber(lua, 1);
// get cdata
- tb_char_t const* cdata_str = tb_null;
- tb_pointer_t cdata = (tb_pointer_t)xm_lua_topointer2(lua, 2, &cdata_str);
+ tb_char_t const *cdata_str = tb_null;
+ tb_pointer_t cdata = (tb_pointer_t)xm_lua_topointer2(lua, 2, &cdata_str);
tb_check_return_val(cdata, 0);
// get events
@@ -67,4 +64,3 @@ tb_int_t xm_io_poller_insert(lua_State* lua)
lua_pushboolean(lua, tb_poller_insert(xm_io_poller(lua), &object, events, cdata_str));
return 1;
}
-