2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

sockets_translate: Make use of designated initializers

Same behavior, less typing.
This commit is contained in:
Lioncash 2020-09-07 00:53:08 -04:00
parent 188a3cf74c
commit 180fa6859f

View file

@ -131,21 +131,21 @@ u16 TranslatePollEventsToGuest(u16 flags) {
Network::SockAddrIn Translate(SockAddrIn value) {
ASSERT(value.len == 0 || value.len == sizeof(value));
Network::SockAddrIn result;
result.family = Translate(static_cast<Domain>(value.family));
result.ip = value.ip;
result.portno = value.portno >> 8 | value.portno << 8;
return result;
return {
.family = Translate(static_cast<Domain>(value.family)),
.ip = value.ip,
.portno = static_cast<u16>(value.portno >> 8 | value.portno << 8),
};
}
SockAddrIn Translate(Network::SockAddrIn value) {
SockAddrIn result;
result.len = sizeof(result);
result.family = static_cast<u8>(Translate(value.family));
result.portno = value.portno >> 8 | value.portno << 8;
result.ip = value.ip;
result.zeroes = {};
return result;
return {
.len = sizeof(SockAddrIn),
.family = static_cast<u8>(Translate(value.family)),
.portno = static_cast<u16>(value.portno >> 8 | value.portno << 8),
.ip = value.ip,
.zeroes = {},
};
}
Network::ShutdownHow Translate(ShutdownHow how) {