From 8dd9cb98ce03bb1fb934fc6fa668e92826449901 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 21 Aug 2018 10:59:37 -0400 Subject: [PATCH] am: Utilize std::array within PopLaunchParameter() Gets rid of the potential for C array-to-pointer decay, and also makes pointer arithmetic to get the end of the copy range unnecessary. We can just use std::array's begin() and end() member functions. --- src/core/hle/service/am/am.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index c524e7a48..78d551a8a 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include #include "core/core.h" @@ -625,16 +626,16 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF } void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { - constexpr u8 data[0x88] = { + constexpr std::array data{{ 0xca, 0x97, 0x94, 0xc7, // Magic 1, 0, 0, 0, // IsAccountSelected (bool) 1, 0, 0, 0, // User Id (word 0) 0, 0, 0, 0, // User Id (word 1) 0, 0, 0, 0, // User Id (word 2) 0, 0, 0, 0 // User Id (word 3) - }; + }}; - std::vector buffer(data, data + sizeof(data)); + std::vector buffer(data.begin(), data.end()); IPC::ResponseBuilder rb{ctx, 2, 0, 1};