Merge pull request #1065 from tvandijck/fix-luasocket
Fixes a few luasocket compile warnings.
This commit is contained in:
commit
8d0dce9c65
@ -30,6 +30,7 @@ project "luasocket"
|
||||
}
|
||||
|
||||
links { 'ws2_32' }
|
||||
characterset "MBCS"
|
||||
|
||||
defines { "LUASOCKET_API=__declspec(dllexport)" }
|
||||
|
||||
|
@ -64,7 +64,7 @@ static luaL_Reg func[] = {
|
||||
* Skip a few arguments
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int global_skip(lua_State *L) {
|
||||
int amount = luaL_checkinteger(L, 1);
|
||||
int amount = (int)luaL_checkinteger(L, 1);
|
||||
int ret = lua_gettop(L) - amount - 1;
|
||||
return ret >= 0 ? ret : 0;
|
||||
}
|
||||
|
@ -654,7 +654,7 @@ static int eolprocess(int c, int last, const char *marker,
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int mime_global_eol(lua_State *L)
|
||||
{
|
||||
int ctx = luaL_checkinteger(L, 1);
|
||||
int ctx = (int)luaL_checkinteger(L, 1);
|
||||
size_t isize = 0;
|
||||
const char *input = luaL_optlstring(L, 2, NULL, &isize);
|
||||
const char *last = input + isize;
|
||||
|
@ -131,11 +131,11 @@ int socket_connect(p_socket ps, SA *addr, socklen_t len, p_timeout tm) {
|
||||
/* we wait until something happens */
|
||||
err = socket_waitfd(ps, WAITFD_C, tm);
|
||||
if (err == IO_CLOSED) {
|
||||
int len = sizeof(err);
|
||||
int err_len = sizeof(err);
|
||||
/* give windows time to set the error (yes, disgusting) */
|
||||
Sleep(10);
|
||||
/* find out why we failed */
|
||||
getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &len);
|
||||
getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *)&err, &err_len);
|
||||
/* we KNOW there was an error. if 'why' is 0, we will return
|
||||
* "unknown error", but it's not really our fault */
|
||||
return err > 0? err: IO_UNKNOWN;
|
||||
|
Reference in New Issue
Block a user