Merge #19314: refactor: Use uint16_t instead of unsigned short

1cabbddbca refactor: Use uint16_t instead of unsigned short (Aaron Hook)

Pull request description:

  I wanted to see if the `up for grabs` label works and looked at PR #17822 originally opend by ahook I saw it had many acks for example by jonatack and practicalswift but needed rebasing.

  So I checked out the remote branch rebased it resolved three conflicts and continued the rebase.

  Hope everything is as expected (:

ACKs for top commit:
  sipsorcery:
    ACK 1cabbddbca.
  practicalswift:
    ACK 1cabbddbca -- patch looks correct :)
  laanwj:
    ACK 1cabbddbca
  hebasto:
    ACK 1cabbddbca, I have reviewed the code and it looks OK, I agree it can be merged.

Tree-SHA512: 0e6bf64f274aae5dacb188358b4d5f65ccb207d4f70922f039bc4ed7934709418ddad19f8bfb7462517427837c3d2bb3f86ef284bb40e87119aad2a1e148d9d6
This commit is contained in:
Wladimir J. van der Laan
2020-07-09 16:33:26 +02:00
9 changed files with 28 additions and 22 deletions

View File

@@ -12,7 +12,7 @@
#include <compat.h>
#include <serialize.h>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <vector>
@@ -143,10 +143,10 @@ class CService : public CNetAddr
public:
CService();
CService(const CNetAddr& ip, unsigned short port);
CService(const struct in_addr& ipv4Addr, unsigned short port);
CService(const CNetAddr& ip, uint16_t port);
CService(const struct in_addr& ipv4Addr, uint16_t port);
explicit CService(const struct sockaddr_in& addr);
unsigned short GetPort() const;
uint16_t GetPort() const;
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
bool SetSockAddr(const struct sockaddr* paddr);
friend bool operator==(const CService& a, const CService& b);
@@ -157,7 +157,7 @@ class CService : public CNetAddr
std::string ToStringPort() const;
std::string ToStringIPPort() const;
CService(const struct in6_addr& ipv6Addr, unsigned short port);
CService(const struct in6_addr& ipv6Addr, uint16_t port);
explicit CService(const struct sockaddr_in6& addr);
SERIALIZE_METHODS(CService, obj) { READWRITE(obj.ip, Using<BigEndianFormatter<2>>(obj.port)); }