From 89c847f1f52969ee2ae6ed35018eef40366ca061 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 22 Dec 2016 17:38:46 -0800 Subject: Work on endpoints. More C99 & type cleanups. --- src/core/protocol.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'src/core/protocol.c') diff --git a/src/core/protocol.c b/src/core/protocol.c index 113746b1..6399cd41 100644 --- a/src/core/protocol.c +++ b/src/core/protocol.c @@ -1,37 +1,33 @@ -/* - * Copyright 2016 Garrett D'Amore - * - * This software is supplied under the terms of the MIT License, a - * copy of which should be located in the distribution where this - * file was obtained (LICENSE.txt). A copy of the license may also be - * found online at https://opensource.org/licenses/MIT. - */ +// +// Copyright 2016 Garrett D'Amore +// +// This software is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// #include #include "core/nng_impl.h" -/* - * Protocol related stuff - generically. - */ +// Protocol related stuff - generically. -/* - * The list of protocols is hardwired. This is reasonably unlikely to - * change, as adding new protocols is not something intended to be done - * outside of the core. - */ -extern struct nni_protocol nni_pair_protocol; +// The list of protocols is hardwired. This is reasonably unlikely to +// change, as adding new protocols is not something intended to be done +// outside of the core. +extern nni_protocol nni_pair_protocol; -static struct nni_protocol *protocols[] = { +static nni_protocol *protocols[] = { &nni_pair_protocol, NULL }; -struct nni_protocol * +nni_protocol * nni_protocol_find(uint16_t num) { int i; - struct nni_protocol *p; + nni_protocol *p; for (i = 0; (p = protocols[i]) != NULL; i++) { if (p->proto_self == num) { @@ -45,7 +41,7 @@ nni_protocol_find(uint16_t num) const char * nni_protocol_name(uint16_t num) { - struct nni_protocol *p; + nni_protocol *p; if ((p = nni_protocol_find(num)) == NULL) { return (NULL); @@ -57,7 +53,7 @@ nni_protocol_name(uint16_t num) uint16_t nni_protocol_number(const char *name) { - struct nni_protocol *p; + nni_protocol *p; int i; for (i = 0; (p = protocols[i]) != NULL; i++) { -- cgit v1.2.3-70-g09d2