Added explicit casts to prevent compiler warnings when trying to build for iOS
diff --git a/library/net.c b/library/net.c
index de1ec75..ec56800 100644
--- a/library/net.c
+++ b/library/net.c
@@ -497,7 +497,12 @@
{
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 @@
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_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 )
{
diff --git a/library/pk.c b/library/pk.c
index 11faf3c..4aba3aa 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -222,7 +222,7 @@
ret = rsa_rsassa_pss_verify_ext( pk_rsa( *ctx ),
NULL, NULL, RSA_PUBLIC,
- md_alg, hash_len, hash,
+ md_alg, (unsigned int) hash_len, hash,
pss_opts->mgf1_hash_id,
pss_opts->expected_salt_len,
sig );
diff --git a/library/timing.c b/library/timing.c
index 94be0ad..b387bd8 100644
--- a/library/timing.c
+++ b/library/timing.c
@@ -379,7 +379,7 @@
{
(void) get_timer( &hires, 1 );
- m_sleep( 500 * secs );
+ m_sleep( (int)( 500 * secs ) );
millisecs = get_timer( &hires, 0 );
@@ -402,7 +402,7 @@
{
(void) get_timer( &hires, 1 );
- set_alarm( secs );
+ set_alarm( (int) secs );
while( !alarmed )
;
diff --git a/library/x509.c b/library/x509.c
index 13081e3..49f7672 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -876,7 +876,7 @@
((void) sig_opts);
#endif /* POLARSSL_X509_RSASSA_PSS_SUPPORT */
- return( (int) size - n );
+ return( (int)( size - n ) );
}
/*