diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-08-24 16:27:53 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-08-24 16:27:53 -0700 |
| commit | 2e5f47aed81992a8dba4b27823894507794fc0ad (patch) | |
| tree | 2383f0139d6931efbbc20ac63be6dfbc1f6e1279 /src | |
| parent | c9a68bfe6bea2acc708bf49045f6cb65017a3306 (diff) | |
| download | nng-2e5f47aed81992a8dba4b27823894507794fc0ad.tar.gz nng-2e5f47aed81992a8dba4b27823894507794fc0ad.tar.bz2 nng-2e5f47aed81992a8dba4b27823894507794fc0ad.zip | |
Fix a few warnings and subtle test races.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/idhash.c | 2 | ||||
| -rw-r--r-- | src/core/options.c | 2 | ||||
| -rw-r--r-- | src/core/socket.c | 6 | ||||
| -rw-r--r-- | src/transport/inproc/inproc.c | 3 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/core/idhash.c b/src/core/idhash.c index 6d8c8163..c0030f76 100644 --- a/src/core/idhash.c +++ b/src/core/idhash.c @@ -174,7 +174,7 @@ nni_hash_resize(nni_idhash *h) h->ih_maxload = 5; } for (i = 0; i < oldsize; i++) { - uint32_t index; + size_t index; if (oldents[i].ihe_val == NULL) { continue; } diff --git a/src/core/options.c b/src/core/options.c index 7a5de33d..03002d6c 100644 --- a/src/core/options.c +++ b/src/core/options.c @@ -263,7 +263,7 @@ static int nni_option_set_id(const char *name, int id) { nni_option *opt; - int len; + size_t len; nni_mtx_lock(&nni_option_lk); NNI_LIST_FOREACH (&nni_options, opt) { if (strcmp(name, opt->o_name) == 0) { diff --git a/src/core/socket.c b/src/core/socket.c index be1c2d96..6a242558 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -307,6 +307,10 @@ nni_sock_destroy(nni_sock *s) nni_free_opt(sopt); } + // This exists to silence a false positive in helgrind. + nni_mtx_lock(&s->s_mx); + nni_mtx_unlock(&s->s_mx); + nni_ev_fini(&s->s_send_ev); nni_ev_fini(&s->s_recv_ev); nni_msgq_fini(s->s_urq); @@ -764,7 +768,7 @@ nni_sock_ep_remove(nni_sock *sock, nni_ep *ep) nni_mtx_lock(&sock->s_mx); if (nni_list_active(&sock->s_eps, ep)) { nni_list_remove(&sock->s_eps, ep); - if ((sock->s_closed) && (nni_list_empty(&sock->s_eps))) { + if ((sock->s_closing) && (nni_list_empty(&sock->s_eps))) { nni_cv_wake(&sock->s_cv); } } diff --git a/src/transport/inproc/inproc.c b/src/transport/inproc/inproc.c index 23a74998..e3cc5143 100644 --- a/src/transport/inproc/inproc.c +++ b/src/transport/inproc/inproc.c @@ -179,10 +179,9 @@ nni_inproc_pipe_peer(void *arg) static int nni_inproc_pipe_getopt(void *arg, int option, void *buf, size_t *szp) { +#if 0 nni_inproc_pipe *pipe = arg; - size_t len; -#if 0 switch (option) { case NNG_OPT_LOCALADDR: case NNG_OPT_REMOTEADDR: |
