diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-01-16 00:43:03 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-01-16 00:43:03 -0800 |
| commit | 39dbff5615631522d3ef98b83141957038502c0d (patch) | |
| tree | 89becbf88ebb79df9c9202450acd476bd790bde0 /src/platform/windows/win_ipc.c | |
| parent | f71209a0b429cddcd44f1f2473c49e986c9b4be7 (diff) | |
| download | nng-39dbff5615631522d3ef98b83141957038502c0d.tar.gz nng-39dbff5615631522d3ef98b83141957038502c0d.tar.bz2 nng-39dbff5615631522d3ef98b83141957038502c0d.zip | |
Various complaints found in AppVeyor build.
Diffstat (limited to 'src/platform/windows/win_ipc.c')
| -rw-r--r-- | src/platform/windows/win_ipc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/platform/windows/win_ipc.c b/src/platform/windows/win_ipc.c index 42590ee9..86a4be03 100644 --- a/src/platform/windows/win_ipc.c +++ b/src/platform/windows/win_ipc.c @@ -11,6 +11,8 @@ #ifdef PLATFORM_WINDOWS +#include <stdio.h> + // Windows has infinite numbers of error codes it seems. We only bother // with the ones that are relevant to us (we think). static struct { @@ -73,7 +75,7 @@ nni_plat_ipc_send(nni_plat_ipcsock *s, nni_iov *iovs, int cnt) OVERLAPPED *olp = &s->send_olpd; NNI_ASSERT(cnt <= 4); - for (i = 0, resid = 0; i < cnt; resid += iov[i].iov_len, i++) { + for (i = 0, resid = 0; i < cnt; resid += (DWORD) iov[i].iov_len, i++) { iov[i].iov_len = iovs[i].iov_len; iov[i].iov_buf = iovs[i].iov_buf; } @@ -84,7 +86,8 @@ nni_plat_ipc_send(nni_plat_ipcsock *s, nni_iov *iovs, int cnt) nsent = 0; // We limit ourselves to writing 16MB at a time. Named Pipes // on Windows have limits of between 31 and 64MB. - len = iov[i].iov_len > 0x1000000 ? 0x1000000 : iov[i].iov_len; + len = iov[i].iov_len > 0x1000000 ? 0x1000000 : + (DWORD) iov[i].iov_len; buf = iov[i].iov_buf; if (!WriteFile(s->p, buf, len, NULL, olp)) { @@ -123,7 +126,7 @@ nni_plat_ipc_recv(nni_plat_ipcsock *s, nni_iov *iovs, int cnt) OVERLAPPED *olp = &s->recv_olpd; NNI_ASSERT(cnt <= 4); - for (i = 0, resid = 0; i < cnt; resid += iov[i].iov_len, i++) { + for (i = 0, resid = 0; i < cnt; resid += (DWORD) iov[i].iov_len, i++) { iov[i].iov_len = iovs[i].iov_len; iov[i].iov_buf = iovs[i].iov_buf; } @@ -134,7 +137,8 @@ nni_plat_ipc_recv(nni_plat_ipcsock *s, nni_iov *iovs, int cnt) nrecv = 0; // We limit ourselves to writing 16MB at a time. Named Pipes // on Windows have limits of between 31 and 64MB. - len = iov[i].iov_len > 0x1000000 ? 0x1000000 : iov[i].iov_len; + len = iov[i].iov_len > 0x1000000 ? 0x1000000 : + (DWORD) iov[i].iov_len; buf = iov[i].iov_buf; if (!ReadFile(s->p, buf, len, NULL, olp)) { @@ -262,7 +266,6 @@ nni_plat_ipc_accept(nni_plat_ipcsock *s, nni_plat_ipcsock *server) { int rv; OVERLAPPED *olp = &s->conn_olpd; - HANDLE newp; DWORD nbytes; s->server = 1; |
