From 2ddb62319803f6a3f3246a52b4e009d9ae1daaed Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 18 Dec 2022 17:51:35 +0000 Subject: Use in_port_t instead of int/unsigned int/long. --- include/socket.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/socket.h') diff --git a/include/socket.h b/include/socket.h index 47b503a0c..f306a7706 100644 --- a/include/socket.h +++ b/include/socket.h @@ -35,6 +35,7 @@ # include #else # include +typedef USHORT in_port_t; typedef ADDRESS_FAMILY sa_family_t; #endif @@ -83,7 +84,7 @@ namespace irc * @param port A TCP port. * @return True if the IP/port was stored in this socket address; otherwise, false. */ - bool from_ip_port(const std::string& addr, int port); + bool from_ip_port(const std::string& addr, in_port_t port); /** Store a UNIX socket path in this socket address. * @param path A path to a UNIX socket. @@ -95,7 +96,7 @@ namespace irc bool is_local() const; /** Returns the TCP port number of the socket address or 0 if not relevant to this family. */ - int port() const; + in_port_t port() const; /** Returns the size of the structure for use in networking syscalls. */ socklen_t sa_size() const; -- cgit v1.3.1-10-gc9f91