diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-03-05 19:35:48 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-03-05 19:39:19 -0800 |
| commit | 3649003b4aa65f3d28c04a08e90b84f61313ca67 (patch) | |
| tree | 87bc723f71a5a6c4d7a2d86a17988a2de77bd045 | |
| parent | c4da7817b4c8dd71b2a07d4d1c46b486ec57eeb4 (diff) | |
| download | nng-3649003b4aa65f3d28c04a08e90b84f61313ca67.tar.gz nng-3649003b4aa65f3d28c04a08e90b84f61313ca67.tar.bz2 nng-3649003b4aa65f3d28c04a08e90b84f61313ca67.zip | |
Fix for Windows compilation warnings.
| -rw-r--r-- | src/platform/windows/win_tcp.c | 8 | ||||
| -rw-r--r-- | src/supplemental/tls/none/tls.c | 1 | ||||
| -rw-r--r-- | tests/pollfd.c | 11 |
3 files changed, 11 insertions, 9 deletions
diff --git a/src/platform/windows/win_tcp.c b/src/platform/windows/win_tcp.c index da661588..8062eb3e 100644 --- a/src/platform/windows/win_tcp.c +++ b/src/platform/windows/win_tcp.c @@ -471,14 +471,14 @@ nni_win_tcp_acc_finish(nni_win_event *evt, nni_aio *aio) // Collect the local and peer addresses, because normal getsockname // and getpeername don't work with AcceptEx. - len1 = sizeof(pipe->sockname); - len2 = sizeof(pipe->peername); + len1 = (int) sizeof(pipe->sockname); + len2 = (int) sizeof(pipe->peername); ep->getacceptexsockaddrs( ep->buf, 0, 256, 256, &sa1, &len1, &sa2, &len2); NNI_ASSERT(len1 > 0); - NNI_ASSERT(len1 < sizeof(SOCKADDR_STORAGE)); + NNI_ASSERT(len1 < (int) sizeof(SOCKADDR_STORAGE)); NNI_ASSERT(len2 > 0); - NNI_ASSERT(len2 < sizeof(SOCKADDR_STORAGE)); + NNI_ASSERT(len2 < (int) sizeof(SOCKADDR_STORAGE)); memcpy(&pipe->sockname, sa1, len1); memcpy(&pipe->peername, sa2, len2); diff --git a/src/supplemental/tls/none/tls.c b/src/supplemental/tls/none/tls.c index 8177ff61..a11bd3fa 100644 --- a/src/supplemental/tls/none/tls.c +++ b/src/supplemental/tls/none/tls.c @@ -139,6 +139,7 @@ nng_tls_config_own_cert( nng_tls_config *cfg, const char *cert, const char *key, const char *pass) { NNI_ARG_UNUSED(cfg); + NNI_ARG_UNUSED(cert); NNI_ARG_UNUSED(key); NNI_ARG_UNUSED(pass); return (NNG_ENOTSUP); diff --git a/tests/pollfd.c b/tests/pollfd.c index 7a87fe9b..06c3a15c 100644 --- a/tests/pollfd.c +++ b/tests/pollfd.c @@ -14,6 +14,7 @@ #include <poll.h> #include <unistd.h> #define INVALID_SOCKET -1 +#define SOCKET int #else #define poll WSAPoll @@ -54,7 +55,7 @@ TestMain("Poll FDs", { nng_msleep(50); Convey("We can get a recv FD", { - int fd; + SOCKET fd; size_t sz; sz = sizeof(fd); @@ -92,7 +93,7 @@ TestMain("Poll FDs", { }); Convey("We can get a send FD", { - int fd; + SOCKET fd; size_t sz; sz = sizeof(fd); @@ -102,7 +103,7 @@ TestMain("Poll FDs", { }); Convey("Must have a big enough size", { - int fd; + SOCKET fd; size_t sz; sz = 1; So(nng_getopt(s1, NNG_OPT_RECVFD, &fd, &sz) == @@ -115,7 +116,7 @@ TestMain("Poll FDs", { Convey("We cannot get a send FD for PULL", { nng_socket s3; - int fd; + SOCKET fd; size_t sz; So(nng_pull0_open(&s3) == 0); Reset({ nng_close(s3); }); @@ -125,7 +126,7 @@ TestMain("Poll FDs", { Convey("We cannot get a recv FD for PUSH", { nng_socket s3; - int fd; + SOCKET fd; size_t sz; So(nng_push0_open(&s3) == 0); Reset({ nng_close(s3); }); |
