summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/sockets/sfdnsres.cpp
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2023-06-26 04:23:23 +0200
committercomex <comexk@gmail.com>2023-06-26 04:24:49 +0200
commitd885dd5b642807d0587acad43668cfccfdf06d1e (patch)
treeb3f4ac530883702313901f9d48453577ce060175 /src/core/hle/service/sockets/sfdnsres.cpp
parentnetwork.cpp: include expected.h (diff)
downloadyuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar.gz
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar.bz2
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar.lz
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar.xz
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.tar.zst
yuzu-d885dd5b642807d0587acad43668cfccfdf06d1e.zip
Diffstat (limited to 'src/core/hle/service/sockets/sfdnsres.cpp')
-rw-r--r--src/core/hle/service/sockets/sfdnsres.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp
index c5eaec920..45f0f526a 100644
--- a/src/core/hle/service/sockets/sfdnsres.cpp
+++ b/src/core/hle/service/sockets/sfdnsres.cpp
@@ -88,15 +88,15 @@ static Errno GetAddrInfoErrorToErrno(GetAddrInfoError result) {
template <typename T>
static void Append(std::vector<u8>& vec, T t) {
- size_t off = vec.size();
- vec.resize(off + sizeof(T));
- std::memcpy(vec.data() + off, &t, sizeof(T));
+ const size_t offset = vec.size();
+ vec.resize(offset + sizeof(T));
+ std::memcpy(vec.data() + offset, &t, sizeof(T));
}
static void AppendNulTerminated(std::vector<u8>& vec, std::string_view str) {
- size_t off = vec.size();
- vec.resize(off + str.size() + 1);
- std::memmove(vec.data() + off, str.data(), str.size());
+ const size_t offset = vec.size();
+ vec.resize(offset + str.size() + 1);
+ std::memmove(vec.data() + offset, str.data(), str.size());
}
// We implement gethostbyname using the host's getaddrinfo rather than the
@@ -154,8 +154,8 @@ static std::pair<u32, GetAddrInfoError> GetHostByNameRequestImpl(HLERequestConte
return {0, Translate(res.error())};
}
- std::vector<u8> data = SerializeAddrInfoAsHostEnt(res.value(), host);
- u32 data_size = static_cast<u32>(data.size());
+ const std::vector<u8> data = SerializeAddrInfoAsHostEnt(res.value(), host);
+ const u32 data_size = static_cast<u32>(data.size());
ctx.WriteBuffer(data, 0);
return {data_size, GetAddrInfoError::SUCCESS};
@@ -243,7 +243,7 @@ static std::pair<u32, GetAddrInfoError> GetAddrInfoRequestImpl(HLERequestContext
std::optional<std::string> service = std::nullopt;
if (ctx.CanReadBuffer(1)) {
- std::span<const u8> service_buffer = ctx.ReadBuffer(1);
+ const std::span<const u8> service_buffer = ctx.ReadBuffer(1);
service = Common::StringFromBuffer(service_buffer);
}
@@ -254,8 +254,8 @@ static std::pair<u32, GetAddrInfoError> GetAddrInfoRequestImpl(HLERequestContext
return {0, Translate(res.error())};
}
- std::vector<u8> data = SerializeAddrInfo(res.value(), host);
- u32 data_size = static_cast<u32>(data.size());
+ const std::vector<u8> data = SerializeAddrInfo(res.value(), host);
+ const u32 data_size = static_cast<u32>(data.size());
ctx.WriteBuffer(data, 0);
return {data_size, GetAddrInfoError::SUCCESS};