From 45bc175ef9278c175d2fc3a0678b49b18e74c449 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 14 Feb 2018 14:50:04 -0800 Subject: fixes #234 Investigate enabling more verbose compiler warnings We enabled verbose compiler warnings, and found a lot of issues. Some of these were even real bugs. As a bonus, we actually save some initialization steps in the compat layer, and avoid passing some variables we don't need. --- src/platform/posix/posix_udp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/platform/posix/posix_udp.c') diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c index cd7b0561..cde58e7c 100644 --- a/src/platform/posix/posix_udp.c +++ b/src/platform/posix/posix_udp.c @@ -108,7 +108,6 @@ nni_posix_udp_dosend(nni_plat_udp *udp) { nni_aio * aio; nni_list *q = &udp->udp_sendq; - int x = 0; // While we're able to send, do so. while ((aio = nni_list_first(q)) != NULL) { @@ -119,7 +118,7 @@ nni_posix_udp_dosend(nni_plat_udp *udp) int cnt = 0; len = nni_posix_nn2sockaddr(&ss, nni_aio_get_input(aio, 0)); - if (len < 0) { + if (len < 1) { rv = NNG_EADDRINVAL; } else { struct msghdr hdr; @@ -211,7 +210,7 @@ nni_plat_udp_open(nni_plat_udp **upp, nni_sockaddr *bindaddr) struct sockaddr_storage sa; int rv; - if ((salen = nni_posix_nn2sockaddr(&sa, bindaddr)) < 0) { + if ((salen = nni_posix_nn2sockaddr(&sa, bindaddr)) < 1) { return (NNG_EADDRINVAL); } @@ -261,8 +260,6 @@ nni_plat_udp_open(nni_plat_udp **upp, nni_sockaddr *bindaddr) void nni_plat_udp_close(nni_plat_udp *udp) { - nni_aio *aio; - // We're no longer interested in events. nni_posix_pollq_remove(&udp->udp_pitem); -- cgit v1.2.3-70-g09d2