From 12ed7464771e4c6b1992ef4438be9038fb59b2fc Mon Sep 17 00:00:00 2001 From: Lectem Date: Sat, 18 Mar 2017 11:47:40 +0100 Subject: IPCHelper Skip method + address comments for apt --- src/core/hle/ipc_helpers.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 98c95a7f3..06c4c5a85 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -28,13 +28,19 @@ public: header.raw); } + void Skip(unsigned size_in_words, bool set_to_null) { + if (set_to_null) + memset(cmdbuf + index, 0, size_in_words * sizeof(u32)); + index += size_in_words; + } + /** * @brief Retrieves the address of a static buffer, used when a buffer is needed for output * @param buffer_id The index of the static buffer * @param data_size If non-null, will store the size of the buffer */ VAddr PeekStaticBuffer(u8 buffer_id, size_t* data_size = nullptr) const { - u32* static_buffer = cmdbuf + Kernel::kStaticBuffersOffset / 4 + buffer_id * 2; + u32* static_buffer = cmdbuf + Kernel::kStaticBuffersOffset / sizeof(u32) + buffer_id * 2; if (data_size) *data_size = StaticBufferDescInfo{static_buffer[0]}.size; return static_buffer[1]; -- cgit v1.2.3