From b492d43e63a80d926ca0bb35577761cabee2d13c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 12 Oct 2018 10:57:28 -0400 Subject: thread: Remove unnecessary memset from ResetThreadContext() Regular value initialization is adequate here for zeroing out data. It also has the benefit of not invoking undefined behavior if a non-trivial type is ever added to the struct for whatever reason. --- src/core/hle/kernel/thread.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 33aed8c23..352ce1725 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -183,13 +183,10 @@ void Thread::ResumeFromWait() { */ static void ResetThreadContext(Core::ARM_Interface::ThreadContext& context, VAddr stack_top, VAddr entry_point, u64 arg) { - memset(&context, 0, sizeof(Core::ARM_Interface::ThreadContext)); - + context = {}; context.cpu_registers[0] = arg; context.pc = entry_point; context.sp = stack_top; - context.pstate = 0; - context.fpcr = 0; } ResultVal> Thread::Create(KernelCore& kernel, std::string name, VAddr entry_point, -- cgit v1.2.3