summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2019-02-26 18:04:45 -0500
committerGravatar Lioncash2019-02-26 18:10:36 -0500
commit254b1e3df731dd47f73b9a0267bfb6b9858fd849 (patch)
tree99b87783cfd0ed269d0b2a9e2cc95c2349633b79 /src
parentservice/vi: Remove use of a module class (diff)
downloadyuzu-254b1e3df731dd47f73b9a0267bfb6b9858fd849.tar.gz
yuzu-254b1e3df731dd47f73b9a0267bfb6b9858fd849.tar.xz
yuzu-254b1e3df731dd47f73b9a0267bfb6b9858fd849.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/ipc_helpers.h15
1 files changed, 15 insertions, 0 deletions
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() {
362 return cmdbuf[index++]; 362 return cmdbuf[index++];
363} 363}
364 364
365template <>
366inline s32 RequestParser::Pop() {
367 return static_cast<s32>(Pop<u32>());
368}
369
365template <typename T> 370template <typename T>
366void RequestParser::PopRaw(T& value) { 371void RequestParser::PopRaw(T& value) {
367 std::memcpy(&value, cmdbuf + index, sizeof(T)); 372 std::memcpy(&value, cmdbuf + index, sizeof(T));
@@ -393,6 +398,16 @@ inline u64 RequestParser::Pop() {
393} 398}
394 399
395template <> 400template <>
401inline s8 RequestParser::Pop() {
402 return static_cast<s8>(Pop<u8>());
403}
404
405template <>
406inline s16 RequestParser::Pop() {
407 return static_cast<s16>(Pop<u16>());
408}
409
410template <>
396inline s64 RequestParser::Pop() { 411inline s64 RequestParser::Pop() {
397 return static_cast<s64>(Pop<u64>()); 412 return static_cast<s64>(Pop<u64>());
398} 413}