Fix compile error on openwrt-x64

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2018-03-18 10:47:04 +08:00
parent d9ef540473
commit ecb3ea962f
1 changed files with 2 additions and 4 deletions

View File

@ -550,12 +550,10 @@ static int uh_lua_send(lua_State *L)
buf = luaL_checklstring(L, 1, &len); buf = luaL_checklstring(L, 1, &len);
if (len > 0) { if (len > 0) {
LUA_INTEGER p;
struct uh_client *cl; struct uh_client *cl;
lua_getglobal(L, "__cl"); lua_getglobal(L, "__cl");
p = lua_tointeger(L, -1); cl = lua_touserdata(L, -1);
cl = (struct uh_client *)(*(void **)&p);
cl->chunk_send(cl, buf, len); cl->chunk_send(cl, buf, len);
} }
@ -597,7 +595,7 @@ void uh_template(struct uh_client *cl)
lua_setglobal(L, "uh_send"); lua_setglobal(L, "uh_send");
} }
lua_pushinteger(L, (lua_Integer)(lua_Integer *)cl); lua_pushlightuserdata(L, cl);
lua_setglobal(L, "__cl"); lua_setglobal(L, "__cl");
lua_newtable(L); lua_newtable(L);