diff options
| author | ruki <[email protected]> | 2020-08-04 22:45:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-08-04 22:45:20 +0800 |
| commit | 81c072eaa6eadde5f6427e0109226a7fa04691b0 (patch) | |
| tree | 7243963c4614209145b441144093889fface5102 /core/src/xmake/io/socket_send.c | |
| parent | 8b08fbb9f5f0f54dd1232f4bf387932116dde47f (diff) | |
improve pushpointer
Diffstat (limited to 'core/src/xmake/io/socket_send.c')
| -rw-r--r-- | core/src/xmake/io/socket_send.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/xmake/io/socket_send.c b/core/src/xmake/io/socket_send.c index 81a24bd4b..696a4a4c1 100644 --- a/core/src/xmake/io/socket_send.c +++ b/core/src/xmake/io/socket_send.c @@ -41,7 +41,7 @@ tb_int_t xm_io_socket_send(lua_State* lua) tb_assert_and_check_return_val(lua, 0); // check socket - if (!lua_isuserdata(lua, 1)) + if (!xm_lua_ispointer(lua, 1)) { lua_pushinteger(lua, -1); lua_pushliteral(lua, "invalid socket!"); @@ -49,7 +49,7 @@ tb_int_t xm_io_socket_send(lua_State* lua) } // get socket - tb_socket_ref_t sock = (tb_socket_ref_t)lua_touserdata(lua, 1); + tb_socket_ref_t sock = (tb_socket_ref_t)xm_lua_topointer(lua, 1); tb_check_return_val(sock, 0); // get data |
