diff options
author | Damien George <damien.p.george@gmail.com> | 2017-10-30 15:41:37 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-10-30 15:41:37 +1100 |
commit | 10b76a9620b7407ffed8366d71f5463496f98838 (patch) | |
tree | ddf831fb30c3f62653a6f9d17c32d3a973ae9bbd | |
parent | 74ec52d85758ad9da7a3abb24257511b22d74964 (diff) | |
download | micropython-10b76a9620b7407ffed8366d71f5463496f98838.tar.gz micropython-10b76a9620b7407ffed8366d71f5463496f98838.zip |
extmod/modussl_mbedtls: Allow to compile with unix coverage build.
Fixes a few C warnings. No functional changes.
-rw-r--r-- | extmod/modussl_mbedtls.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/extmod/modussl_mbedtls.c b/extmod/modussl_mbedtls.c index 59dceb6cff..69a64d2f7a 100644 --- a/extmod/modussl_mbedtls.c +++ b/extmod/modussl_mbedtls.c @@ -65,23 +65,30 @@ struct ssl_args { STATIC const mp_obj_type_t ussl_socket_type; -void mbedtls_debug(void *ctx, int level, const char *file, int line, const char *str) { +#ifdef MBEDTLS_DEBUG_C +STATIC void mbedtls_debug(void *ctx, int level, const char *file, int line, const char *str) { + (void)ctx; + (void)level; printf("DBG:%s:%04d: %s\n", file, line, str); } +#endif // TODO: FIXME! -int null_entropy_func(void *data, unsigned char *output, size_t len) { +STATIC int null_entropy_func(void *data, unsigned char *output, size_t len) { + (void)data; + (void)output; + (void)len; // enjoy random bytes return 0; } -int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { +STATIC int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { mp_obj_t sock = *(mp_obj_t*)ctx; const mp_stream_p_t *sock_stream = mp_get_stream_raise(sock, MP_STREAM_OP_WRITE); int err; - int out_sz = sock_stream->write(sock, buf, len, &err); + mp_uint_t out_sz = sock_stream->write(sock, buf, len, &err); if (out_sz == MP_STREAM_ERROR) { if (mp_is_nonblocking_error(err)) { return MBEDTLS_ERR_SSL_WANT_WRITE; @@ -92,13 +99,13 @@ int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) { } } -int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { +STATIC int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) { mp_obj_t sock = *(mp_obj_t*)ctx; const mp_stream_p_t *sock_stream = mp_get_stream_raise(sock, MP_STREAM_OP_READ); int err; - int out_sz = sock_stream->read(sock, buf, len, &err); + mp_uint_t out_sz = sock_stream->read(sock, buf, len, &err); if (out_sz == MP_STREAM_ERROR) { if (mp_is_nonblocking_error(err)) { return MBEDTLS_ERR_SSL_WANT_READ; |