summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-21 10:59:37 -0400
committerGravatar Lioncash2018-08-21 11:03:14 -0400
commit8dd9cb98ce03bb1fb934fc6fa668e92826449901 (patch)
treed111847fd2fd9473ab9939acb2656124e276907c /src
parentMerge pull request #1143 from lioncash/inc (diff)
downloadyuzu-8dd9cb98ce03bb1fb934fc6fa668e92826449901.tar.gz
yuzu-8dd9cb98ce03bb1fb934fc6fa668e92826449901.tar.xz
yuzu-8dd9cb98ce03bb1fb934fc6fa668e92826449901.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/am.cpp7
1 files 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 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <array>
5#include <cinttypes> 6#include <cinttypes>
6#include <stack> 7#include <stack>
7#include "core/core.h" 8#include "core/core.h"
@@ -625,16 +626,16 @@ IApplicationFunctions::IApplicationFunctions() : ServiceFramework("IApplicationF
625} 626}
626 627
627void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { 628void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
628 constexpr u8 data[0x88] = { 629 constexpr std::array<u8, 0x88> data{{
629 0xca, 0x97, 0x94, 0xc7, // Magic 630 0xca, 0x97, 0x94, 0xc7, // Magic
630 1, 0, 0, 0, // IsAccountSelected (bool) 631 1, 0, 0, 0, // IsAccountSelected (bool)
631 1, 0, 0, 0, // User Id (word 0) 632 1, 0, 0, 0, // User Id (word 0)
632 0, 0, 0, 0, // User Id (word 1) 633 0, 0, 0, 0, // User Id (word 1)
633 0, 0, 0, 0, // User Id (word 2) 634 0, 0, 0, 0, // User Id (word 2)
634 0, 0, 0, 0 // User Id (word 3) 635 0, 0, 0, 0 // User Id (word 3)
635 }; 636 }};
636 637
637 std::vector<u8> buffer(data, data + sizeof(data)); 638 std::vector<u8> buffer(data.begin(), data.end());
638 639
639 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 640 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
640 641