aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/pubsub0/xsub_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-10-20 17:01:10 -0700
committerGarrett D'Amore <garrett@damore.org>2024-10-20 17:01:10 -0700
commit693773195dcd877164314d6b4c37cbd980cbb6ab (patch)
tree3c6014205fb75d1e39227ac505dab8964e57a815 /src/sp/protocol/pubsub0/xsub_test.c
parent5830408d11fb19aaf78cb47016ea1692e8f6d2ed (diff)
downloadnng-693773195dcd877164314d6b4c37cbd980cbb6ab.tar.gz
nng-693773195dcd877164314d6b4c37cbd980cbb6ab.tar.bz2
nng-693773195dcd877164314d6b4c37cbd980cbb6ab.zip
Use `const` for nng_stat when possible.
This should help the compiler enforce checks, and may result in better optimizations.
Diffstat (limited to 'src/sp/protocol/pubsub0/xsub_test.c')
-rw-r--r--src/sp/protocol/pubsub0/xsub_test.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/sp/protocol/pubsub0/xsub_test.c b/src/sp/protocol/pubsub0/xsub_test.c
index 19815661..9f2be2be 100644
--- a/src/sp/protocol/pubsub0/xsub_test.c
+++ b/src/sp/protocol/pubsub0/xsub_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
@@ -14,7 +14,7 @@ test_xsub_identity(void)
{
nng_socket s;
int p;
- char * n;
+ char *n;
NUTS_PASS(nng_sub0_open_raw(&s));
NUTS_PASS(nng_socket_get_int(s, NNG_OPT_PROTO, &p));
@@ -93,8 +93,8 @@ test_xsub_recv_late(void)
int fd;
nng_socket pub;
nng_socket sub;
- nng_aio * aio;
- nng_msg * msg;
+ nng_aio *aio;
+ nng_msg *msg;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_pub0_open(&pub));
@@ -146,10 +146,10 @@ test_xsub_no_context(void)
void
test_xsub_validate_peer(void)
{
- nng_socket s1, s2;
- nng_stat * stats;
- nng_stat * reject;
- char * addr;
+ nng_socket s1, s2;
+ nng_stat *stats;
+ const nng_stat *reject;
+ char *addr;
NUTS_ADDR(addr, "inproc");
@@ -178,7 +178,7 @@ static void
test_xsub_recv_closed(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
NUTS_CLOSE(sub);
@@ -192,7 +192,7 @@ static void
test_xsub_close_recv(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -209,7 +209,7 @@ static void
test_xsub_recv_nonblock(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
@@ -341,7 +341,7 @@ static void
test_xsub_recv_aio_stopped(void)
{
nng_socket sub;
- nng_aio * aio;
+ nng_aio *aio;
NUTS_PASS(nng_sub0_open_raw(&sub));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));