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 a7ea6a5a18
commit bbc1007c50

View file

@ -137,7 +137,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,
@ -179,7 +179,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;
@ -259,8 +259,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 )
{