Skip to content

Commit

Permalink
Resolve compilation warnings: pointer-to-int-cast and int-to-pointer-…
Browse files Browse the repository at this point in the history
…cast

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
  • Loading branch information
Jianhui Zhao committed Mar 12, 2018
1 parent ace982c commit d2439b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
@@ -1,5 +1,5 @@

add_definitions(-O -Wall -Werror --std=gnu99 -D_GNU_SOURCE -Wno-misleading-indentation -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
add_definitions(-O -Wall -Werror --std=gnu99 -D_GNU_SOURCE -Wno-misleading-indentation)

# The version number.
set(UHTTPD_VERSION_MAJOR 2)
Expand Down
6 changes: 4 additions & 2 deletions src/lua_template.c
Expand Up @@ -549,10 +549,12 @@ static int uh_lua_send(lua_State *L)

buf = luaL_checklstring(L, 1, &len);
if (len > 0) {
LUA_INTEGER p;
struct uh_client *cl;

lua_getglobal(L, "__cl");
cl = (struct uh_client *)lua_tointeger(L, -1);
p = lua_tointeger(L, -1);
cl = (struct uh_client *)(*(void **)&p);
cl->chunk_send(cl, buf, len);
}

Expand Down Expand Up @@ -594,7 +596,7 @@ void uh_template(struct uh_client *cl)
lua_setglobal(L, "uh_send");
}

lua_pushinteger(L, (uint32_t)cl);
lua_pushinteger(L, (lua_Integer)(lua_Integer *)cl);
lua_setglobal(L, "__cl");

lua_newtable(L);
Expand Down

0 comments on commit d2439b6

Please sign in to comment.