diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-02-14 14:50:04 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-02-14 18:28:36 -0800 |
| commit | 45bc175ef9278c175d2fc3a0678b49b18e74c449 (patch) | |
| tree | b1838778ee898112f28b35178364068c6f48c9b4 /src/supplemental/http | |
| parent | 8f93750ed2a6aaa1749eb689ddf119280f9aac7a (diff) | |
| download | nng-45bc175ef9278c175d2fc3a0678b49b18e74c449.tar.gz nng-45bc175ef9278c175d2fc3a0678b49b18e74c449.tar.bz2 nng-45bc175ef9278c175d2fc3a0678b49b18e74c449.zip | |
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.
Diffstat (limited to 'src/supplemental/http')
| -rw-r--r-- | src/supplemental/http/http_client.c | 4 | ||||
| -rw-r--r-- | src/supplemental/http/http_conn.c | 16 | ||||
| -rw-r--r-- | src/supplemental/http/http_server.c | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/src/supplemental/http/http_client.c b/src/supplemental/http/http_client.c index 9058b6e2..5cab15c9 100644 --- a/src/supplemental/http/http_client.c +++ b/src/supplemental/http/http_client.c @@ -197,6 +197,8 @@ nni_http_client_set_tls(nni_http_client *c, nng_tls_config *tls) } return (0); #else + NNI_ARG_UNUSED(c); + NNI_ARG_UNUSED(tls); return (NNG_EINVAL); #endif } @@ -214,6 +216,8 @@ nni_http_client_get_tls(nni_http_client *c, nng_tls_config **tlsp) nni_mtx_unlock(&c->mtx); return (0); #else + NNI_ARG_UNUSED(c); + NNI_ARG_UNUSED(tlsp); return (NNG_ENOTSUP); #endif } diff --git a/src/supplemental/http/http_conn.c b/src/supplemental/http/http_conn.c index 726f3ea3..525bd6b5 100644 --- a/src/supplemental/http/http_conn.c +++ b/src/supplemental/http/http_conn.c @@ -200,10 +200,10 @@ http_rd_buf(nni_http_conn *conn, nni_aio *aio) conn->rd_get = conn->rd_put = 0; } if (rv == NNG_EAGAIN) { - nni_iov iov; - iov.iov_buf = conn->rd_buf + conn->rd_put; - iov.iov_len = conn->rd_bufsz - conn->rd_put; - nni_aio_set_iov(conn->rd_aio, 1, &iov); + nni_iov iov1; + iov1.iov_buf = conn->rd_buf + conn->rd_put; + iov1.iov_len = conn->rd_bufsz - conn->rd_put; + nni_aio_set_iov(conn->rd_aio, 1, &iov1); nni_aio_set_data(conn->rd_aio, 1, aio); conn->rd(conn->sock, conn->rd_aio); } @@ -217,10 +217,10 @@ http_rd_buf(nni_http_conn *conn, nni_aio *aio) conn->rd_get = conn->rd_put = 0; } if (rv == NNG_EAGAIN) { - nni_iov iov; - iov.iov_buf = conn->rd_buf + conn->rd_put; - iov.iov_len = conn->rd_bufsz - conn->rd_put; - nni_aio_set_iov(conn->rd_aio, 1, &iov); + nni_iov iov1; + iov1.iov_buf = conn->rd_buf + conn->rd_put; + iov1.iov_len = conn->rd_bufsz - conn->rd_put; + nni_aio_set_iov(conn->rd_aio, 1, &iov1); nni_aio_set_data(conn->rd_aio, 1, aio); conn->rd(conn->sock, conn->rd_aio); } diff --git a/src/supplemental/http/http_server.c b/src/supplemental/http/http_server.c index 4c89708d..69774bd5 100644 --- a/src/supplemental/http/http_server.c +++ b/src/supplemental/http/http_server.c @@ -1494,6 +1494,8 @@ nni_http_server_set_tls(nni_http_server *s, nng_tls_config *tcfg) } return (0); #else + NNI_ARG_UNUSED(s); + NNI_ARG_UNUSED(tcfg); return (NNG_ENOTSUP); #endif } @@ -1511,6 +1513,8 @@ nni_http_server_get_tls(nni_http_server *s, nng_tls_config **tp) nni_mtx_unlock(&s->mtx); return (0); #else + NNI_ARG_UNUSED(s); + NNI_ARG_UNUSED(tp); return (NNG_ENOTSUP); #endif } |
