diff options
Diffstat (limited to 'src/sp/protocol/pair0/pair.c')
| -rw-r--r-- | src/sp/protocol/pair0/pair.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/sp/protocol/pair0/pair.c b/src/sp/protocol/pair0/pair.c index c2407d81..c6470b7b 100644 --- a/src/sp/protocol/pair0/pair.c +++ b/src/sp/protocol/pair0/pair.c @@ -32,7 +32,7 @@ static void pair0_pipe_send(pair0_pipe *, nni_msg *); // pair0_sock is our per-socket protocol private structure. struct pair0_sock { - pair0_pipe * p; + pair0_pipe *p; nni_mtx mtx; nni_lmq wmq; nni_list waq; @@ -44,12 +44,12 @@ struct pair0_sock { bool wr_ready; // pipe ready for write }; -// An pair0_pipe is our per-pipe protocol private structure. We keep +// A pair0_pipe is our per-pipe protocol private structure. We keep // one of these even though in theory we'd only have a single underlying // pipe. The separate data structure is more like other protocols that do // manage multiple pipes. struct pair0_pipe { - nni_pipe * pipe; + nni_pipe *pipe; pair0_sock *pair; nni_aio aio_send; nni_aio aio_recv; @@ -190,8 +190,8 @@ pair0_pipe_recv_cb(void *arg) { pair0_pipe *p = arg; pair0_sock *s = p->pair; - nni_msg * msg; - nni_aio * a; + nni_msg *msg; + nni_aio *a; if (nni_aio_result(&p->aio_recv) != 0) { nni_pipe_close(p->pipe); @@ -231,8 +231,8 @@ static void pair0_send_sched(pair0_sock *s) { pair0_pipe *p; - nni_msg * m; - nni_aio * a = NULL; + nni_msg *m; + nni_aio *a = NULL; size_t l = 0; nni_mtx_lock(&s->mtx); @@ -303,8 +303,8 @@ static void pair0_sock_close(void *arg) { pair0_sock *s = arg; - nni_aio * a; - nni_msg * m; + nni_aio *a; + nni_msg *m; nni_mtx_lock(&s->mtx); while (((a = nni_list_first(&s->raq)) != NULL) || ((a = nni_list_first(&s->waq)) != NULL)) { @@ -334,7 +334,7 @@ static void pair0_sock_send(void *arg, nni_aio *aio) { pair0_sock *s = arg; - nni_msg * m; + nni_msg *m; size_t len; int rv; @@ -384,7 +384,7 @@ pair0_sock_recv(void *arg, nni_aio *aio) { pair0_sock *s = arg; pair0_pipe *p; - nni_msg * m; + nni_msg *m; int rv; if (nni_aio_begin(aio) != 0) { @@ -463,7 +463,7 @@ pair0_get_send_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->wmq); + val = (int) nni_lmq_cap(&s->wmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); @@ -498,7 +498,7 @@ pair0_get_recv_buf_len(void *arg, void *buf, size_t *szp, nni_opt_type t) int val; nni_mtx_lock(&s->mtx); - val = nni_lmq_cap(&s->rmq); + val = (int) nni_lmq_cap(&s->rmq); nni_mtx_unlock(&s->mtx); return (nni_copyout_int(val, buf, szp, t)); @@ -531,28 +531,28 @@ pair0_sock_get_send_fd(void *arg, void *buf, size_t *szp, nni_opt_type t) } static nni_option pair0_sock_options[] = { - { - .o_name = NNG_OPT_RECVFD, - .o_get = pair0_sock_get_recv_fd, - }, - { - .o_name = NNG_OPT_SENDFD, - .o_get = pair0_sock_get_send_fd, - }, - { - .o_name = NNG_OPT_SENDBUF, - .o_get = pair0_get_send_buf_len, - .o_set = pair0_set_send_buf_len, - }, - { - .o_name = NNG_OPT_RECVBUF, - .o_get = pair0_get_recv_buf_len, - .o_set = pair0_set_recv_buf_len, - }, - // terminate list - { - .o_name = NULL, - }, + { + .o_name = NNG_OPT_RECVFD, + .o_get = pair0_sock_get_recv_fd, + }, + { + .o_name = NNG_OPT_SENDFD, + .o_get = pair0_sock_get_send_fd, + }, + { + .o_name = NNG_OPT_SENDBUF, + .o_get = pair0_get_send_buf_len, + .o_set = pair0_set_send_buf_len, + }, + { + .o_name = NNG_OPT_RECVBUF, + .o_get = pair0_get_recv_buf_len, + .o_set = pair0_set_recv_buf_len, + }, + // terminate list + { + .o_name = NULL, + }, }; static nni_proto_pipe_ops pair0_pipe_ops = { |
