From b1d088f39cf2e7730ea1b5433be1b76893f2725b Mon Sep 17 00:00:00 2001 From: Brenton Bostick Date: Fri, 18 Aug 2023 08:31:08 -0400 Subject: [PATCH] fix examples warnings warning: incompatible pointer types passing 'int *' to parameter of type 'unsigned short *' [-Wincompatible-pointer-types] --- examples/c/nonblockingserver.c | 2 +- examples/c/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/c/nonblockingserver.c b/examples/c/nonblockingserver.c index 228bcb22..8b5c3120 100644 --- a/examples/c/nonblockingserver.c +++ b/examples/c/nonblockingserver.c @@ -95,7 +95,7 @@ int main(int argc, char** argv) // zts_bsd_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen) char remote_ipstr[ZTS_INET6_ADDRSTRLEN] = { 0 }; - unsigned int port = 0; + unsigned short port = 0; printf("Accepting on listening socket...\n"); if ((accfd = zts_accept(fd, remote_ipstr, ZTS_INET6_ADDRSTRLEN, &port)) < 0) { printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno); diff --git a/examples/c/server.c b/examples/c/server.c index b3c606ca..e43a00f7 100644 --- a/examples/c/server.c +++ b/examples/c/server.c @@ -75,7 +75,7 @@ int main(int argc, char** argv) // Can also use traditional: zts_bsd_socket(), zts_bsd_bind(), zts_bsd_listen(), zts_bsd_accept(), etc. char remote_addr[ZTS_INET6_ADDRSTRLEN] = { 0 }; - int remote_port = 0; + unsigned short remote_port = 0; int len = ZTS_INET6_ADDRSTRLEN; if ((accfd = zts_tcp_server(local_addr, local_port, remote_addr, len, &remote_port)) < 0) { printf("Error (fd=%d, zts_errno=%d). Exiting.\n", accfd, zts_errno);