diff options
Diffstat (limited to 'src/nng_compat.c')
| -rw-r--r-- | src/nng_compat.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nng_compat.c b/src/nng_compat.c index e9a3e3a3..f8a7ceb0 100644 --- a/src/nng_compat.c +++ b/src/nng_compat.c @@ -92,18 +92,19 @@ static const struct { uint16_t p_id; int (*p_open)(nng_socket *); } nn_protocols[] = { - { NNG_PROTO_BUS_V0, nng_bus0_open }, - { NNG_PROTO_PAIR_V0, nng_pair0_open }, - { NNG_PROTO_PAIR_V0, nng_pair1_open }, - { NNG_PROTO_PUSH_V0, nng_push0_open }, - { NNG_PROTO_PULL_V0, nng_pull0_open }, - { NNG_PROTO_PUB_V0, nng_pub0_open }, - { NNG_PROTO_SUB_V0, nng_sub0_open }, - { NNG_PROTO_REQ_V0, nng_req0_open }, - { NNG_PROTO_REP_V0, nng_rep0_open }, - { NNG_PROTO_SURVEYOR_V0, nng_surveyor0_open }, - { NNG_PROTO_RESPONDENT_V0, nng_respondent0_open }, - { NNG_PROTO_NONE, NULL }, + // clang-format off + { NN_BUS, nng_bus0_open }, + { NN_PAIR, nng_pair0_open }, + { NN_PUSH, nng_push0_open }, + { NN_PULL, nng_pull0_open }, + { NN_PUB, nng_pub0_open }, + { NN_SUB, nng_sub0_open }, + { NN_REQ, nng_req0_open }, + { NN_REP, nng_rep0_open }, + { NN_SURVEYOR, nng_surveyor0_open }, + { NN_RESPONDENT, nng_respondent0_open }, + { 0, NULL }, + // clang-format on }; int @@ -118,7 +119,7 @@ nn_socket(int domain, int protocol) return (-1); } - for (i = 0; nn_protocols[i].p_id != NNG_PROTO_NONE; i++) { + for (i = 0; nn_protocols[i].p_id != 0; i++) { if (nn_protocols[i].p_id == protocol) { break; } |
