diff options
| author | ruki <[email protected]> | 2025-11-09 23:22:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-09 23:22:44 +0800 |
| commit | 831447a51da0b094e08bb047247bf269a6e6cf71 (patch) | |
| tree | f345e66e3d9882cbb4d49d588c3080d88bc17cd8 /core/src/xmake/fwatcher | |
| parent | bf2da8a3d7f04bf5ffcdce8fd4c334d5421d3494 (diff) | |
format more if-else
Diffstat (limited to 'core/src/xmake/fwatcher')
| -rw-r--r-- | core/src/xmake/fwatcher/add.c | 3 | ||||
| -rw-r--r-- | core/src/xmake/fwatcher/close.c | 3 | ||||
| -rw-r--r-- | core/src/xmake/fwatcher/open.c | 5 | ||||
| -rw-r--r-- | core/src/xmake/fwatcher/remove.c | 3 | ||||
| -rw-r--r-- | core/src/xmake/fwatcher/wait.c | 3 |
5 files changed, 11 insertions, 6 deletions
diff --git a/core/src/xmake/fwatcher/add.c b/core/src/xmake/fwatcher/add.c index 77c23ea48..10c31b6b0 100644 --- a/core/src/xmake/fwatcher/add.c +++ b/core/src/xmake/fwatcher/add.c @@ -39,8 +39,9 @@ tb_int_t xm_fwatcher_add(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get the fwatcher tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)xm_lua_topointer(lua, 1); diff --git a/core/src/xmake/fwatcher/close.c b/core/src/xmake/fwatcher/close.c index a5501d906..61c78868a 100644 --- a/core/src/xmake/fwatcher/close.c +++ b/core/src/xmake/fwatcher/close.c @@ -39,8 +39,9 @@ tb_int_t xm_fwatcher_close(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get the fwatcher tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)xm_lua_topointer(lua, 1); diff --git a/core/src/xmake/fwatcher/open.c b/core/src/xmake/fwatcher/open.c index 13ab91d5a..032921fb3 100644 --- a/core/src/xmake/fwatcher/open.c +++ b/core/src/xmake/fwatcher/open.c @@ -38,9 +38,10 @@ tb_int_t xm_fwatcher_open(lua_State *lua) { // init fwatcher tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)tb_fwatcher_init(); - if (fwatcher) + if (fwatcher) { xm_lua_pushpointer(lua, (tb_pointer_t)fwatcher); - else + } else { lua_pushnil(lua); + } return 1; } diff --git a/core/src/xmake/fwatcher/remove.c b/core/src/xmake/fwatcher/remove.c index 6285b0649..a3636dbe3 100644 --- a/core/src/xmake/fwatcher/remove.c +++ b/core/src/xmake/fwatcher/remove.c @@ -39,8 +39,9 @@ tb_int_t xm_fwatcher_remove(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get the fwatcher tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)xm_lua_topointer(lua, 1); diff --git a/core/src/xmake/fwatcher/wait.c b/core/src/xmake/fwatcher/wait.c index 42b01b8aa..0602c931c 100644 --- a/core/src/xmake/fwatcher/wait.c +++ b/core/src/xmake/fwatcher/wait.c @@ -39,8 +39,9 @@ tb_int_t xm_fwatcher_wait(lua_State *lua) { tb_assert_and_check_return_val(lua, 0); // is pointer? - if (!xm_lua_ispointer(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { return 0; + } // get the fwatcher tb_fwatcher_ref_t fwatcher = (tb_fwatcher_ref_t)xm_lua_topointer(lua, 1); |
