From 197aef23ce36844e86e732f26af1df9fc5f149da Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 1 Jul 2004 05:35:35 +0000 Subject: Compiles with g++. --- src/except.c | 9 +++++---- src/tcp.c | 4 ++-- src/unix.c | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/except.c b/src/except.c index ad03817..80d7e5d 100644 --- a/src/except.c +++ b/src/except.c @@ -4,8 +4,9 @@ * * RCS ID: $Id$ \*=========================================================================*/ -#include #include +#include +#include #include "except.h" @@ -14,7 +15,7 @@ \*=========================================================================*/ static int global_protect(lua_State *L); static int global_newtry(lua_State *L); -static int protected(lua_State *L); +static int protected_(lua_State *L); static int finalize(lua_State *L); static int do_nothing(lua_State *L); @@ -53,7 +54,7 @@ static int global_newtry(lua_State *L) { /*-------------------------------------------------------------------------*\ * Protect factory \*-------------------------------------------------------------------------*/ -static int protected(lua_State *L) { +static int protected_(lua_State *L) { lua_pushvalue(L, lua_upvalueindex(1)); lua_insert(L, 1); if (lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0) != 0) { @@ -64,7 +65,7 @@ static int protected(lua_State *L) { } static int global_protect(lua_State *L) { - lua_pushcclosure(L, protected, 1); + lua_pushcclosure(L, protected_, 1); return 1; } diff --git a/src/tcp.c b/src/tcp.c index 8ab7d62..037a23a 100644 --- a/src/tcp.c +++ b/src/tcp.c @@ -117,7 +117,7 @@ static int meth_receive(lua_State *L) \*-------------------------------------------------------------------------*/ static int meth_setoption(lua_State *L) { - p_tcp tcp = aux_checkgroup(L, "tcp{any}", 1); + p_tcp tcp = (p_tcp) aux_checkgroup(L, "tcp{any}", 1); return opt_meth_setoption(L, opt, &tcp->sock); } @@ -158,7 +158,7 @@ static int meth_accept(lua_State *L) const char *err = sock_accept(&server->sock, &sock, NULL, NULL, tm); /* if successful, push client socket */ if (!err) { - p_tcp clnt = lua_newuserdata(L, sizeof(t_tcp)); + p_tcp clnt = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); aux_setclass(L, "tcp{client}", -1); /* initialize structure fields */ sock_setnonblocking(&sock); diff --git a/src/unix.c b/src/unix.c index 34d2da1..407f85d 100644 --- a/src/unix.c +++ b/src/unix.c @@ -111,7 +111,7 @@ static int meth_receive(lua_State *L) { * Just call option handler \*-------------------------------------------------------------------------*/ static int meth_setoption(lua_State *L) { - p_unix unix = aux_checkgroup(L, "unix{any}", 1); + p_unix unix = (p_unix) aux_checkgroup(L, "unix{any}", 1); return opt_meth_setoption(L, opt, &unix->sock); } @@ -148,7 +148,7 @@ static int meth_accept(lua_State *L) { const char *err = sock_accept(&server->sock, &sock, NULL, NULL, tm); /* if successful, push client socket */ if (!err) { - p_unix clnt = lua_newuserdata(L, sizeof(t_unix)); + p_unix clnt = (p_unix) lua_newuserdata(L, sizeof(t_unix)); aux_setclass(L, "unix{client}", -1); /* initialize structure fields */ sock_setnonblocking(&sock); -- cgit v1.2.3-55-g6feb