Network: Replace unsigned int by size_t for size

Former-commit-id: efa7e2f50ae370f96871726be7906332ca8969a4
This commit is contained in:
Lynix 2016-02-04 13:27:06 +01:00
parent 33e2bb905b
commit f723d6a29c
8 changed files with 15 additions and 14 deletions

View File

@ -33,7 +33,7 @@ namespace Nz
inline bool IsBlockingEnabled() const;
unsigned int QueryAvailableBytes() const;
std::size_t QueryAvailableBytes() const;
AbstractSocket& operator=(const AbstractSocket&) = delete;
AbstractSocket& operator=(AbstractSocket&& abstractSocket);

View File

@ -34,7 +34,7 @@ namespace Nz
inline bool IsBroadcastingEnabled() const;
unsigned int QueryMaxDatagramSize();
std::size_t QueryMaxDatagramSize();
bool Receive(void* buffer, std::size_t size, IpAddress* from, std::size_t* received);

View File

@ -63,7 +63,7 @@ namespace Nz
}
}
unsigned int AbstractSocket::QueryAvailableBytes() const
std::size_t AbstractSocket::QueryAvailableBytes() const
{
if (m_handle == SocketImpl::InvalidHandle)
return 0;

View File

@ -224,7 +224,7 @@ namespace Nz
return code;
}
SocketState SocketImpl::Listen(SocketHandle handle, const IpAddress& address, unsigned queueSize, SocketError* error)
SocketState SocketImpl::Listen(SocketHandle handle, const IpAddress& address, unsigned int queueSize, SocketError* error)
{
NazaraAssert(handle != InvalidHandle, "Invalid handle");
NazaraAssert(address.IsValid(), "Invalid address");
@ -254,7 +254,7 @@ namespace Nz
return SocketState_Bound;
}
unsigned int SocketImpl::QueryAvailableBytes(SocketHandle handle, SocketError* error)
std::size_t SocketImpl::QueryAvailableBytes(SocketHandle handle, SocketError* error)
{
NazaraAssert(handle != InvalidHandle, "Invalid handle");
@ -311,7 +311,7 @@ namespace Nz
return code;
}
unsigned int SocketImpl::QueryMaxDatagramSize(SocketHandle handle, SocketError* error)
std::size_t SocketImpl::QueryMaxDatagramSize(SocketHandle handle, SocketError* error)
{
unsigned int code;
unsigned int codeLength = sizeof(code);

View File

@ -32,12 +32,12 @@ namespace Nz
static int GetLastErrorCode();
static int GetLastErrorCode(SocketHandle handle, SocketError* error = nullptr);
static SocketState Listen(SocketHandle handle, const IpAddress& address, unsigned queueSize, SocketError* error);
static SocketState Listen(SocketHandle handle, const IpAddress& address, unsigned int queueSize, SocketError* error);
static unsigned int QueryAvailableBytes(SocketHandle handle, SocketError* error = nullptr);
static std::size_t QueryAvailableBytes(SocketHandle handle, SocketError* error = nullptr);
static bool QueryBroadcasting(SocketHandle handle, SocketError* error = nullptr);
static bool QueryKeepAlive(SocketHandle handle, SocketError* error = nullptr);
static unsigned int QueryMaxDatagramSize(SocketHandle handle, SocketError* error = nullptr);
static std::size_t QueryMaxDatagramSize(SocketHandle handle, SocketError* error = nullptr);
static bool QueryNoDelay(SocketHandle handle, SocketError* error = nullptr);
static IpAddress QueryPeerAddress(SocketHandle handle, SocketError* error = nullptr);
static IpAddress QuerySocketAddress(SocketHandle handle, SocketError* error = nullptr);

View File

@ -3,7 +3,6 @@
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Network/UdpSocket.hpp>
#include <Nazara/Network/Debug.hpp>
#if defined(NAZARA_PLATFORM_WINDOWS)
#include <Nazara/Network/Win32/SocketImpl.hpp>
@ -13,6 +12,8 @@
#error Missing implementation: Socket
#endif
#include <Nazara/Network/Debug.hpp>
namespace Nz
{
SocketState UdpSocket::Bind(const IpAddress& address)
@ -39,7 +40,7 @@ namespace Nz
}
}
unsigned int UdpSocket::QueryMaxDatagramSize()
std::size_t UdpSocket::QueryMaxDatagramSize()
{
NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket hasn't been created");

View File

@ -256,7 +256,7 @@ namespace Nz
return SocketState_Bound;
}
unsigned int SocketImpl::QueryAvailableBytes(SocketHandle handle, SocketError* error)
std::size_t SocketImpl::QueryAvailableBytes(SocketHandle handle, SocketError* error)
{
NazaraAssert(handle != InvalidHandle, "Invalid handle");

View File

@ -35,10 +35,10 @@ namespace Nz
static SocketState Listen(SocketHandle handle, const IpAddress& address, unsigned queueSize, SocketError* error);
static unsigned int QueryAvailableBytes(SocketHandle handle, SocketError* error = nullptr);
static std::size_t QueryAvailableBytes(SocketHandle handle, SocketError* error = nullptr);
static bool QueryBroadcasting(SocketHandle handle, SocketError* error = nullptr);
static bool QueryKeepAlive(SocketHandle handle, SocketError* error = nullptr);
static unsigned int QueryMaxDatagramSize(SocketHandle handle, SocketError* error = nullptr);
static std::size_t QueryMaxDatagramSize(SocketHandle handle, SocketError* error = nullptr);
static bool QueryNoDelay(SocketHandle handle, SocketError* error = nullptr);
static IpAddress QueryPeerAddress(SocketHandle handle, SocketError* error = nullptr);
static IpAddress QuerySocketAddress(SocketHandle handle, SocketError* error = nullptr);