Added explicit casts to prevent compiler warnings when trying to build for iOS

This commit is contained in:
Sander Niemeijer 2014-08-16 12:45:52 +02:00 committed by Manuel Pégourié-Gonnard
parent 8ef7088bb9
commit ef5087d150
6 changed files with 14 additions and 8 deletions

View file

@ -497,7 +497,12 @@ void net_usleep( unsigned long usec )
{
struct timeval tv;
tv.tv_sec = 0;
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || \
(defined(__APPLE__) && defined(__MACH__)))
tv.tv_usec = (suseconds_t) usec;
#else
tv.tv_usec = usec;
#endif
select( 0, NULL, NULL, NULL, &tv );
}
#endif /* POLARSSL_HAVE_TIME */
@ -508,7 +513,7 @@ void net_usleep( unsigned long usec )
int net_recv( void *ctx, unsigned char *buf, size_t len )
{
int fd = *((int *) ctx);
int ret = read( fd, buf, len );
int ret = (int) read( fd, buf, len );
if( ret < 0 )
{
@ -539,7 +544,7 @@ int net_recv( void *ctx, unsigned char *buf, size_t len )
int net_send( void *ctx, const unsigned char *buf, size_t len )
{
int fd = *((int *) ctx);
int ret = write( fd, buf, len );
int ret = (int) write( fd, buf, len );
if( ret < 0 )
{