From 4a24ebe175bc3eebf7fbf2ac581b2339a809ace1 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 20 Jan 2017 17:47:02 -0800 Subject: Dangling compiler warnings from sock handle change. --- src/nng.c | 23 ++--------------------- src/nng.h | 8 +++----- 2 files changed, 5 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/nng.c b/src/nng.c index 03d5a98c..587900bd 100644 --- a/src/nng.c +++ b/src/nng.c @@ -18,17 +18,6 @@ // Pretty much every function calls the nni_platform_init to check against // fork related activity. -#define NNI_INIT_INT() \ - do { \ - if (nni_init() != 0) { \ - return (NNG_ENOMEM); \ - } \ - } \ - while (0) - -#define NNI_INIT_VOID() \ - (void) nni_init() - int nng_open(nng_socket *sidp, uint16_t proto) { @@ -351,7 +340,6 @@ nng_pipe_getopt(nng_pipe *pipe, int opt, void *val, size_t *sizep) { int rv; - NNI_INIT_INT(); rv = nni_pipe_getopt(pipe, opt, val, sizep); if (rv == ENOTSUP) { // Maybe its a generic socket option. @@ -364,7 +352,6 @@ nng_pipe_getopt(nng_pipe *pipe, int opt, void *val, size_t *sizep) int nng_pipe_close(nng_pipe *pipe) { - NNI_INIT_INT(); nni_pipe_close(pipe); return (0); } @@ -377,7 +364,6 @@ nng_pipe_close(nng_pipe *pipe) int nng_msg_alloc(nng_msg **msgp, size_t size) { - NNI_INIT_VOID(); return (nni_msg_alloc(msgp, size)); } @@ -488,10 +474,9 @@ nng_msg_getopt(nng_msg *msg, int opt, void *ptr, size_t *szp) int -nng_snapshot_create(nng_snapshot **snapp) +nng_snapshot_create(nng_socket sock, nng_snapshot **snapp) { // Stats TBD. - NNI_INIT_INT(); return (NNG_ENOTSUP); } @@ -499,16 +484,14 @@ nng_snapshot_create(nng_snapshot **snapp) void nng_snapshot_destroy(nng_snapshot *snap) { - NNI_INIT_VOID(); // Stats TBD. } int -nng_snapshot_update(nng_socket sock, nng_snapshot *snap) +nng_snapshot_update(nng_snapshot *snap) { // Stats TBD. - NNI_INIT_INT(); return (NNG_ENOTSUP); } @@ -517,7 +500,6 @@ int nng_snapshot_next(nng_snapshot *snap, nng_stat **statp) { // Stats TBD. - NNI_INIT_INT(); *statp = NULL; return (NNG_ENOTSUP); } @@ -551,6 +533,5 @@ int nng_device(nng_socket sock1, nng_socket sock2) { // Device TBD. - NNI_INIT_INT(); return (NNG_ENOTSUP); } diff --git a/src/nng.h b/src/nng.h index 5eb0edea..0c7abde2 100644 --- a/src/nng.h +++ b/src/nng.h @@ -150,7 +150,7 @@ NNG_DECL int nng_dial(nng_socket, const char *, nng_endpoint *, int); // nng_endpoint_create creates an endpoint on the socket, but does not // start it either dialing or listening. -NNG_DECL int nng_endpoint_create(nng_endpoint *, nng_socket, const char *); +NNG_DECL int nng_endpoint_create(nng_socket, const char *, nng_endpoint *); // nng_endpoint_dial starts the endpoint dialing. This is only possible if // the endpoint is not already dialing or listening. @@ -296,7 +296,7 @@ NNG_DECL int nng_pipe_close(nng_pipe); // object must be deallocated expressly by the user, and may persist beyond // the lifetime of any socket object used to update it. Note that the // values of the statistics are initially unset. -NNG_DECL int nng_snapshot_create(nng_snapshot **); +NNG_DECL int nng_snapshot_create(nng_socket, nng_snapshot **); // nng_snapshot_free frees a snapshot object. All statistic objects // contained therein are destroyed as well. @@ -304,9 +304,7 @@ NNG_DECL void nng_snapshot_free(nng_snapshot *); // nng_snapshot_update updates a snapshot of all the statistics // relevant to a particular socket. All prior values are overwritten. -// It is acceptable to use the same snapshot object with different -// sockets. -NNG_DECL int nng_snapshot_update(nng_socket, nng_snapshot *); +NNG_DECL int nng_snapshot_update(nng_snapshot *); // nng_snapshot_next is used to iterate over the individual statistic // objects inside the snapshot. Note that the statistic object, and the -- cgit v1.2.3-70-g09d2