aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-08-29 14:17:11 -0700
committerGarrett D'Amore <garrett@damore.org>2017-09-22 12:33:03 -0700
commitf04cfd27e2d67b0fc89b079410fc11b55b6d1979 (patch)
treeb177a2fd79de4f1293e54e7a4d6990a135f0d65b /src/protocol
parent72147bcfbdc568bc58877e0904b92013d82a2acd (diff)
downloadnng-f04cfd27e2d67b0fc89b079410fc11b55b6d1979.tar.gz
nng-f04cfd27e2d67b0fc89b079410fc11b55b6d1979.tar.bz2
nng-f04cfd27e2d67b0fc89b079410fc11b55b6d1979.zip
Add improved getopt functions, pass integers by value.
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/bus/bus.c2
-rw-r--r--src/protocol/pair/pair_v0.c2
-rw-r--r--src/protocol/pair/pair_v1.c6
-rw-r--r--src/protocol/pipeline/pull.c2
-rw-r--r--src/protocol/pipeline/push.c2
-rw-r--r--src/protocol/pubsub/pub.c2
-rw-r--r--src/protocol/pubsub/sub.c2
-rw-r--r--src/protocol/reqrep/rep.c4
-rw-r--r--src/protocol/reqrep/req.c6
-rw-r--r--src/protocol/survey/respond.c4
-rw-r--r--src/protocol/survey/survey.c4
11 files changed, 18 insertions, 18 deletions
diff --git a/src/protocol/bus/bus.c b/src/protocol/bus/bus.c
index c8d759f2..d9189729 100644
--- a/src/protocol/bus/bus.c
+++ b/src/protocol/bus/bus.c
@@ -343,7 +343,7 @@ bus_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/pair/pair_v0.c b/src/protocol/pair/pair_v0.c
index 486ce43b..277d5cb1 100644
--- a/src/protocol/pair/pair_v0.c
+++ b/src/protocol/pair/pair_v0.c
@@ -250,7 +250,7 @@ pair0_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
} else {
rv = NNG_ENOTSUP;
}
diff --git a/src/protocol/pair/pair_v1.c b/src/protocol/pair/pair_v1.c
index d6c8ea75..68dbc6f7 100644
--- a/src/protocol/pair/pair_v1.c
+++ b/src/protocol/pair/pair_v1.c
@@ -432,15 +432,15 @@ pair1_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
if (opt == nng_optid_raw) {
nni_mtx_lock(&s->mtx);
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
nni_mtx_unlock(&s->mtx);
} else if (opt == nng_optid_maxttl) {
nni_mtx_lock(&s->mtx);
- rv = nni_getopt_int(&s->ttl, buf, szp);
+ rv = nni_getopt_int(s->ttl, buf, szp);
nni_mtx_unlock(&s->mtx);
} else if (opt == nng_optid_pair1_poly) {
nni_mtx_lock(&s->mtx);
- rv = nni_getopt_int(&s->poly, buf, szp);
+ rv = nni_getopt_int(s->poly, buf, szp);
nni_mtx_unlock(&s->mtx);
}
return (rv);
diff --git a/src/protocol/pipeline/pull.c b/src/protocol/pipeline/pull.c
index 0d66aab8..21c1613d 100644
--- a/src/protocol/pipeline/pull.c
+++ b/src/protocol/pipeline/pull.c
@@ -189,7 +189,7 @@ pull_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/pipeline/push.c b/src/protocol/pipeline/push.c
index 5e32efee..b28f12c5 100644
--- a/src/protocol/pipeline/push.c
+++ b/src/protocol/pipeline/push.c
@@ -210,7 +210,7 @@ push_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/pubsub/pub.c b/src/protocol/pubsub/pub.c
index b7ac361e..10a9760f 100644
--- a/src/protocol/pubsub/pub.c
+++ b/src/protocol/pubsub/pub.c
@@ -286,7 +286,7 @@ pub_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/pubsub/sub.c b/src/protocol/pubsub/sub.c
index 0dbad081..5f4b497d 100644
--- a/src/protocol/pubsub/sub.c
+++ b/src/protocol/pubsub/sub.c
@@ -274,7 +274,7 @@ sub_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/reqrep/rep.c b/src/protocol/reqrep/rep.c
index 14a3e46b..c26be0b0 100644
--- a/src/protocol/reqrep/rep.c
+++ b/src/protocol/reqrep/rep.c
@@ -362,9 +362,9 @@ rep_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_maxttl) {
- rv = nni_getopt_int(&s->ttl, buf, szp);
+ rv = nni_getopt_int(s->ttl, buf, szp);
} else if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/reqrep/req.c b/src/protocol/reqrep/req.c
index 5da5003f..1b68c6dd 100644
--- a/src/protocol/reqrep/req.c
+++ b/src/protocol/reqrep/req.c
@@ -273,13 +273,13 @@ req_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_req_resendtime) {
- rv = nni_getopt_usec(&s->retry, buf, szp);
+ rv = nni_getopt_usec(s->retry, buf, szp);
} else if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
} else if (opt == nng_optid_maxttl) {
- rv = nni_getopt_int(&s->ttl, buf, szp);
+ rv = nni_getopt_int(s->ttl, buf, szp);
}
return (rv);
diff --git a/src/protocol/survey/respond.c b/src/protocol/survey/respond.c
index c3a9dd81..89e19e91 100644
--- a/src/protocol/survey/respond.c
+++ b/src/protocol/survey/respond.c
@@ -374,9 +374,9 @@ resp_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_maxttl) {
- rv = nni_getopt_int(&s->ttl, buf, szp);
+ rv = nni_getopt_int(s->ttl, buf, szp);
} else if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}
diff --git a/src/protocol/survey/survey.c b/src/protocol/survey/survey.c
index 09fe0768..e90c7f57 100644
--- a/src/protocol/survey/survey.c
+++ b/src/protocol/survey/survey.c
@@ -300,9 +300,9 @@ surv_sock_getopt(void *arg, int opt, void *buf, size_t *szp)
int rv = NNG_ENOTSUP;
if (opt == nng_optid_surveyor_surveytime) {
- rv = nni_getopt_usec(&s->survtime, buf, szp);
+ rv = nni_getopt_usec(s->survtime, buf, szp);
} else if (opt == nng_optid_raw) {
- rv = nni_getopt_int(&s->raw, buf, szp);
+ rv = nni_getopt_int(s->raw, buf, szp);
}
return (rv);
}