Skip to content
Snippets Groups Projects
Commit 254b1e3d authored by Lioncash's avatar Lioncash
Browse files

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.
parent 1b2872ee
No related branches found
No related tags found
No related merge requests found
...@@ -362,6 +362,11 @@ inline u32 RequestParser::Pop() { ...@@ -362,6 +362,11 @@ inline u32 RequestParser::Pop() {
return cmdbuf[index++]; return cmdbuf[index++];
} }
template <>
inline s32 RequestParser::Pop() {
return static_cast<s32>(Pop<u32>());
}
template <typename T> template <typename T>
void RequestParser::PopRaw(T& value) { void RequestParser::PopRaw(T& value) {
std::memcpy(&value, cmdbuf + index, sizeof(T)); std::memcpy(&value, cmdbuf + index, sizeof(T));
...@@ -392,6 +397,16 @@ inline u64 RequestParser::Pop() { ...@@ -392,6 +397,16 @@ inline u64 RequestParser::Pop() {
return msw << 32 | lsw; return msw << 32 | lsw;
} }
template <>
inline s8 RequestParser::Pop() {
return static_cast<s8>(Pop<u8>());
}
template <>
inline s16 RequestParser::Pop() {
return static_cast<s16>(Pop<u16>());
}
template <> template <>
inline s64 RequestParser::Pop() { inline s64 RequestParser::Pop() {
return static_cast<s64>(Pop<u64>()); return static_cast<s64>(Pop<u64>());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment