Convert SOCKET to int to prevent compiler warnings under MSVC.

From kernel objects at msdn:
    Kernel object handles are process specific. That is, a process must either create the object or open an existing object to obtain a kernel object handle. The per-process limit on kernel handles is 2^24.

Windows Internals by Russinovich and Solomon as well says that the high bits are zero.
This commit is contained in:
Paul Bakker 2013-10-14 16:33:24 +02:00 committed by Paul Bakker
parent 9ccb2116a7
commit 4c9301a7af

View file

@ -130,7 +130,7 @@ int net_connect( int *fd, const char *host, int port )
if( ( server_host = gethostbyname( host ) ) == NULL )
return( POLARSSL_ERR_NET_UNKNOWN_HOST );
if( ( *fd = socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
return( POLARSSL_ERR_NET_SOCKET_FAILED );
memcpy( (void *) &server_addr.sin_addr,
@ -172,7 +172,7 @@ int net_bind( int *fd, const char *bind_ip, int port )
signal( SIGPIPE, SIG_IGN );
#endif
if( ( *fd = socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
if( ( *fd = (int) socket( AF_INET, SOCK_STREAM, IPPROTO_IP ) ) < 0 )
return( POLARSSL_ERR_NET_SOCKET_FAILED );
n = 1;
@ -252,8 +252,8 @@ int net_accept( int bind_fd, int *client_fd, void *client_ip )
int n = (int) sizeof( client_addr );
#endif
*client_fd = accept( bind_fd, (struct sockaddr *)
&client_addr, &n );
*client_fd = (int) accept( bind_fd, (struct sockaddr *)
&client_addr, &n );
if( *client_fd < 0 )
{