use std::size_t

This commit is contained in:
Max Kellermann
2021-02-09 06:21:58 +01:00
committed by Max Kellermann
parent fe6abe1750
commit 3456b1e50d
4 changed files with 27 additions and 27 deletions

View File

@@ -225,9 +225,9 @@ SocketDescriptor::GetError() noexcept
: errno;
}
size_t
std::size_t
SocketDescriptor::GetOption(int level, int name,
void *value, size_t size) const noexcept
void *value, std::size_t size) const noexcept
{
assert(IsDefined());
@@ -264,7 +264,7 @@ SocketDescriptor::SetNonBlocking() noexcept
bool
SocketDescriptor::SetOption(int level, int name,
const void *value, size_t size) noexcept
const void *value, std::size_t size) noexcept
{
assert(IsDefined());
@@ -431,7 +431,7 @@ SocketDescriptor::GetPeerAddress() const noexcept
}
ssize_t
SocketDescriptor::Read(void *buffer, size_t length) noexcept
SocketDescriptor::Read(void *buffer, std::size_t length) noexcept
{
int flags = 0;
#ifndef _WIN32
@@ -442,7 +442,7 @@ SocketDescriptor::Read(void *buffer, size_t length) noexcept
}
ssize_t
SocketDescriptor::Write(const void *buffer, size_t length) noexcept
SocketDescriptor::Write(const void *buffer, std::size_t length) noexcept
{
int flags = 0;
#ifdef __linux__
@@ -495,7 +495,7 @@ SocketDescriptor::WaitWritable(int timeout_ms) const noexcept
#endif
ssize_t
SocketDescriptor::Read(void *buffer, size_t length,
SocketDescriptor::Read(void *buffer, std::size_t length,
StaticSocketAddress &address) noexcept
{
int flags = 0;
@@ -513,7 +513,7 @@ SocketDescriptor::Read(void *buffer, size_t length,
}
ssize_t
SocketDescriptor::Write(const void *buffer, size_t length,
SocketDescriptor::Write(const void *buffer, std::size_t length,
SocketAddress address) noexcept
{
int flags = 0;

View File

@@ -159,8 +159,8 @@ public:
/**
* @return the value size or 0 on error
*/
size_t GetOption(int level, int name,
void *value, size_t size) const noexcept;
std::size_t GetOption(int level, int name,
void *value, std::size_t size) const noexcept;
#ifdef HAVE_STRUCT_UCRED
/**
@@ -172,7 +172,7 @@ public:
#endif
bool SetOption(int level, int name,
const void *value, size_t size) noexcept;
const void *value, std::size_t size) noexcept;
bool SetBoolOption(int level, int name, bool _value) noexcept {
const int value = _value;
@@ -232,8 +232,8 @@ public:
[[gnu::pure]]
StaticSocketAddress GetPeerAddress() const noexcept;
ssize_t Read(void *buffer, size_t length) noexcept;
ssize_t Write(const void *buffer, size_t length) noexcept;
ssize_t Read(void *buffer, std::size_t length) noexcept;
ssize_t Write(const void *buffer, std::size_t length) noexcept;
#ifdef _WIN32
int WaitReadable(int timeout_ms) const noexcept;
@@ -247,13 +247,13 @@ public:
/**
* Receive a datagram and return the source address.
*/
ssize_t Read(void *buffer, size_t length,
ssize_t Read(void *buffer, std::size_t length,
StaticSocketAddress &address) noexcept;
/**
* Send a datagram to the specified address.
*/
ssize_t Write(const void *buffer, size_t length,
ssize_t Write(const void *buffer, std::size_t length,
SocketAddress address) noexcept;
#ifndef _WIN32