Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 10b76a9

Browse files
committed
extmod/modussl_mbedtls: Allow to compile with unix coverage build.
Fixes a few C warnings. No functional changes.
1 parent 74ec52d commit 10b76a9

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

extmod/modussl_mbedtls.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,30 @@ struct ssl_args {
6565

6666
STATIC const mp_obj_type_t ussl_socket_type;
6767

68-
void mbedtls_debug(void *ctx, int level, const char *file, int line, const char *str) {
68+
#ifdef MBEDTLS_DEBUG_C
69+
STATIC void mbedtls_debug(void *ctx, int level, const char *file, int line, const char *str) {
70+
(void)ctx;
71+
(void)level;
6972
printf("DBG:%s:%04d: %s\n", file, line, str);
7073
}
74+
#endif
7175

7276
// TODO: FIXME!
73-
int null_entropy_func(void *data, unsigned char *output, size_t len) {
77+
STATIC int null_entropy_func(void *data, unsigned char *output, size_t len) {
78+
(void)data;
79+
(void)output;
80+
(void)len;
7481
// enjoy random bytes
7582
return 0;
7683
}
7784

78-
int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) {
85+
STATIC int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) {
7986
mp_obj_t sock = *(mp_obj_t*)ctx;
8087

8188
const mp_stream_p_t *sock_stream = mp_get_stream_raise(sock, MP_STREAM_OP_WRITE);
8289
int err;
8390

84-
int out_sz = sock_stream->write(sock, buf, len, &err);
91+
mp_uint_t out_sz = sock_stream->write(sock, buf, len, &err);
8592
if (out_sz == MP_STREAM_ERROR) {
8693
if (mp_is_nonblocking_error(err)) {
8794
return MBEDTLS_ERR_SSL_WANT_WRITE;
@@ -92,13 +99,13 @@ int _mbedtls_ssl_send(void *ctx, const byte *buf, size_t len) {
9299
}
93100
}
94101

95-
int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) {
102+
STATIC int _mbedtls_ssl_recv(void *ctx, byte *buf, size_t len) {
96103
mp_obj_t sock = *(mp_obj_t*)ctx;
97104

98105
const mp_stream_p_t *sock_stream = mp_get_stream_raise(sock, MP_STREAM_OP_READ);
99106
int err;
100107

101-
int out_sz = sock_stream->read(sock, buf, len, &err);
108+
mp_uint_t out_sz = sock_stream->read(sock, buf, len, &err);
102109
if (out_sz == MP_STREAM_ERROR) {
103110
if (mp_is_nonblocking_error(err)) {
104111
return MBEDTLS_ERR_SSL_WANT_READ;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy