summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2023-02-27 00:19:58 +0000
committerDaniel Stenberg <daniel@haxx.se>2023-02-28 08:43:16 +0100
commit51211a31a523e53bab4b57e1e84f81d0532c67c0 (patch)
tree00610649a76a0bdc086cba76cfcc48f80353d941 /lib
parent13afb872686e31c32a0f9bd796679fd5ff5a46a3 (diff)
downloadcurl-51211a31a523e53bab4b57e1e84f81d0532c67c0.tar.gz
quic/schannel: fix compiler warnings
Fixes #10603 Closes #10616
Diffstat (limited to 'lib')
-rw-r--r--lib/vquic/curl_ngtcp2.c7
-rw-r--r--lib/vquic/curl_quiche.c2
-rw-r--r--lib/vquic/vquic.c3
-rw-r--r--lib/vtls/schannel.c10
4 files changed, 14 insertions, 8 deletions
diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c
index aad095c20..58cf129f3 100644
--- a/lib/vquic/curl_ngtcp2.c
+++ b/lib/vquic/curl_ngtcp2.c
@@ -64,6 +64,8 @@
#include "vtls/vtls.h"
#include "curl_ngtcp2.h"
+#include "warnless.h"
+
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
@@ -1762,7 +1764,7 @@ static CURLcode cf_process_ingress(struct Curl_cfilter *cf,
ssize_t recvd;
int rv;
uint8_t buf[65536];
- size_t bufsize = sizeof(buf);
+ int bufsize = (int)sizeof(buf);
size_t pktcount = 0, total_recvd = 0;
struct sockaddr_storage remote_addr;
socklen_t remote_addrlen;
@@ -2176,7 +2178,7 @@ static void cf_ngtcp2_close(struct Curl_cfilter *cf, struct Curl_easy *data)
(uint8_t *)buffer, sizeof(buffer),
&ctx->last_error, ts);
if(rc > 0) {
- while((send(ctx->q.sockfd, buffer, rc, 0) == -1) &&
+ while((send(ctx->q.sockfd, buffer, (SEND_TYPE_ARG3)rc, 0) == -1) &&
SOCKERRNO == EINTR);
}
@@ -2200,6 +2202,7 @@ static void cf_ngtcp2_destroy(struct Curl_cfilter *cf, struct Curl_easy *data)
}
cf->ctx = NULL;
/* No CF_DATA_RESTORE(cf, save) possible */
+ (void)save;
}
/*
diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c
index 54408d75a..c3c3b91e0 100644
--- a/lib/vquic/curl_quiche.c
+++ b/lib/vquic/curl_quiche.c
@@ -444,7 +444,7 @@ static CURLcode cf_process_ingress(struct Curl_cfilter *cf,
struct cf_quiche_ctx *ctx = cf->ctx;
int64_t stream3_id = data->req.p.http? data->req.p.http->stream3_id : -1;
uint8_t buf[65536];
- size_t bufsize = sizeof(buf);
+ int bufsize = (int)sizeof(buf);
struct sockaddr_storage remote_addr;
socklen_t remote_addrlen;
quiche_recv_info recv_info;
diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c
index 5f4f30d71..aac69c7e9 100644
--- a/lib/vquic/vquic.c
+++ b/lib/vquic/vquic.c
@@ -167,7 +167,8 @@ static CURLcode do_sendmsg(struct Curl_cfilter *cf,
*psent = 0;
- while((sent = send(qctx->sockfd, (const char *)pkt, pktlen, 0)) == -1 &&
+ while((sent = send(qctx->sockfd,
+ (const char *)pkt, (SEND_TYPE_ARG3)pktlen, 0)) == -1 &&
SOCKERRNO == EINTR)
;
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 452fa409a..cdd8712aa 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1201,18 +1201,18 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
/* The first four bytes will be an unsigned int indicating number
of bytes of data in the rest of the buffer. */
extension_len = (unsigned int *)(void *)(&alpn_buffer[cur]);
- cur += sizeof(unsigned int);
+ cur += (int)sizeof(unsigned int);
/* The next four bytes are an indicator that this buffer will contain
ALPN data, as opposed to NPN, for example. */
*(unsigned int *)(void *)&alpn_buffer[cur] =
SecApplicationProtocolNegotiationExt_ALPN;
- cur += sizeof(unsigned int);
+ cur += (int)sizeof(unsigned int);
/* The next two bytes will be an unsigned short indicating the number
of bytes used to list the preferred protocols. */
list_len = (unsigned short*)(void *)(&alpn_buffer[cur]);
- cur += sizeof(unsigned short);
+ cur += (int)sizeof(unsigned short);
list_start_index = cur;
@@ -1225,7 +1225,9 @@ schannel_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
cur += proto.len;
*list_len = curlx_uitous(cur - list_start_index);
- *extension_len = *list_len + sizeof(unsigned int) + sizeof(unsigned short);
+ *extension_len = *list_len +
+ (unsigned short)sizeof(unsigned int) +
+ (unsigned short)sizeof(unsigned short);
InitSecBuffer(&inbuf, SECBUFFER_APPLICATION_PROTOCOLS, alpn_buffer, cur);
InitSecBufferDesc(&inbuf_desc, &inbuf, 1);