From 180fa6859fcb0a4e1ef1b24d6bcbf051b6c0b286 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 7 Sep 2020 00:53:08 -0400 Subject: sockets_translate: Make use of designated initializers Same behavior, less typing. --- src/core/hle/service/sockets/sockets_translate.cpp | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/core/hle/service/sockets') diff --git a/src/core/hle/service/sockets/sockets_translate.cpp b/src/core/hle/service/sockets/sockets_translate.cpp index 2be8f642d..139743e1d 100644 --- a/src/core/hle/service/sockets/sockets_translate.cpp +++ b/src/core/hle/service/sockets/sockets_translate.cpp @@ -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(value.family)); - result.ip = value.ip; - result.portno = value.portno >> 8 | value.portno << 8; - return result; + return { + .family = Translate(static_cast(value.family)), + .ip = value.ip, + .portno = static_cast(value.portno >> 8 | value.portno << 8), + }; } SockAddrIn Translate(Network::SockAddrIn value) { - SockAddrIn result; - result.len = sizeof(result); - result.family = static_cast(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(Translate(value.family)), + .portno = static_cast(value.portno >> 8 | value.portno << 8), + .ip = value.ip, + .zeroes = {}, + }; } Network::ShutdownHow Translate(ShutdownHow how) { -- cgit v1.2.3