From 554888318af945a677f3e4a1bd8d3c4f4342786c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 21 Jul 2015 10:39:50 +0200 Subject: net/StaticSocketAddress: use SocketAddress::size_type --- src/net/StaticSocketAddress.hxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/net/StaticSocketAddress.hxx') diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index ee0e18414..475c323e0 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -46,7 +46,11 @@ * An OO wrapper for struct sockaddr_storage. */ class StaticSocketAddress { - size_t size; +public: + typedef SocketAddress::size_type size_type; + +private: + size_type size; struct sockaddr_storage address; public: @@ -74,17 +78,17 @@ public: return reinterpret_cast(&address); } - constexpr size_t GetCapacity() const { + constexpr size_type GetCapacity() const { return sizeof(address); } - size_t GetSize() const { + size_type GetSize() const { return size; } - void SetSize(size_t _size) { + void SetSize(size_type _size) { assert(_size > 0); - assert(_size <= sizeof(address)); + assert(size_t(_size) <= sizeof(address)); size = _size; } -- cgit v1.2.3