From 254b1e3df731dd47f73b9a0267bfb6b9858fd849 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Feb 2019 18:04:45 -0500 Subject: core/ipc_helper: Allow popping all signed value types with RequestParser There's no real reason this shouldn't be allowed, given some values sent via a request can be signed. This also makes it less annoying to work with popping enum values, given an enum class with no type specifier will work out of the box now. It's also kind of an oversight to allow popping s64 values, but nothing else. --- src/core/hle/ipc_helpers.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/core/hle/ipc_helpers.h') diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 90f276ee8..d0721074d 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -362,6 +362,11 @@ inline u32 RequestParser::Pop() { return cmdbuf[index++]; } +template <> +inline s32 RequestParser::Pop() { + return static_cast(Pop()); +} + template void RequestParser::PopRaw(T& value) { std::memcpy(&value, cmdbuf + index, sizeof(T)); @@ -392,6 +397,16 @@ inline u64 RequestParser::Pop() { return msw << 32 | lsw; } +template <> +inline s8 RequestParser::Pop() { + return static_cast(Pop()); +} + +template <> +inline s16 RequestParser::Pop() { + return static_cast(Pop()); +} + template <> inline s64 RequestParser::Pop() { return static_cast(Pop()); -- cgit v1.2.3