summaryrefslogtreecommitdiff
path: root/core/src/xmake/fwatcher/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/xmake/fwatcher/open.c')
-rw-r--r--core/src/xmake/fwatcher/open.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/src/xmake/fwatcher/open.c b/core/src/xmake/fwatcher/open.c
index 333c26616..032921fb3 100644
--- a/core/src/xmake/fwatcher/open.c
+++ b/core/src/xmake/fwatcher/open.c
@@ -22,8 +22,8 @@
/* //////////////////////////////////////////////////////////////////////////////////////
* trace
*/
-#define TB_TRACE_MODULE_NAME "fwatcher.open"
-#define TB_TRACE_MODULE_DEBUG (0)
+#define TB_TRACE_MODULE_NAME "fwatcher.open"
+#define TB_TRACE_MODULE_DEBUG (0)
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
@@ -33,14 +33,15 @@
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
-tb_int_t xm_fwatcher_open(lua_State* lua)
-{
- // check
+tb_int_t xm_fwatcher_open(lua_State *lua) {
tb_assert_and_check_return_val(lua, 0);
// init fwatcher
tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)tb_fwatcher_init();
- if (fwatcher) xm_lua_pushpointer(lua, (tb_pointer_t)fwatcher);
- else lua_pushnil(lua);
+ if (fwatcher) {
+ xm_lua_pushpointer(lua, (tb_pointer_t)fwatcher);
+ } else {
+ lua_pushnil(lua);
+ }
return 1;
}