mirror of
https://github.com/yuzu-emu/yuzu-android
synced 2024-12-26 07:21:21 -08:00
sockets_translate: Make use of designated initializers
Same behavior, less typing.
This commit is contained in:
parent
188a3cf74c
commit
180fa6859f
@ -131,21 +131,21 @@ u16 TranslatePollEventsToGuest(u16 flags) {
|
|||||||
Network::SockAddrIn Translate(SockAddrIn value) {
|
Network::SockAddrIn Translate(SockAddrIn value) {
|
||||||
ASSERT(value.len == 0 || value.len == sizeof(value));
|
ASSERT(value.len == 0 || value.len == sizeof(value));
|
||||||
|
|
||||||
Network::SockAddrIn result;
|
return {
|
||||||
result.family = Translate(static_cast<Domain>(value.family));
|
.family = Translate(static_cast<Domain>(value.family)),
|
||||||
result.ip = value.ip;
|
.ip = value.ip,
|
||||||
result.portno = value.portno >> 8 | value.portno << 8;
|
.portno = static_cast<u16>(value.portno >> 8 | value.portno << 8),
|
||||||
return result;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
SockAddrIn Translate(Network::SockAddrIn value) {
|
SockAddrIn Translate(Network::SockAddrIn value) {
|
||||||
SockAddrIn result;
|
return {
|
||||||
result.len = sizeof(result);
|
.len = sizeof(SockAddrIn),
|
||||||
result.family = static_cast<u8>(Translate(value.family));
|
.family = static_cast<u8>(Translate(value.family)),
|
||||||
result.portno = value.portno >> 8 | value.portno << 8;
|
.portno = static_cast<u16>(value.portno >> 8 | value.portno << 8),
|
||||||
result.ip = value.ip;
|
.ip = value.ip,
|
||||||
result.zeroes = {};
|
.zeroes = {},
|
||||||
return result;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
Network::ShutdownHow Translate(ShutdownHow how) {
|
Network::ShutdownHow Translate(ShutdownHow how) {
|
||||||
|
Loading…
Reference in New Issue
Block a user