summaryrefslogtreecommitdiff
path: root/src/core/hle/ipc_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/ipc_helpers.h')
-rw-r--r--src/core/hle/ipc_helpers.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index 1b503331f..1c354037d 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -38,10 +38,11 @@ public:
38 explicit RequestHelperBase(Kernel::HLERequestContext& context) 38 explicit RequestHelperBase(Kernel::HLERequestContext& context)
39 : context(&context), cmdbuf(context.CommandBuffer()) {} 39 : context(&context), cmdbuf(context.CommandBuffer()) {}
40 40
41 void Skip(unsigned size_in_words, bool set_to_null) { 41 void Skip(u32 size_in_words, bool set_to_null) {
42 if (set_to_null) 42 if (set_to_null) {
43 memset(cmdbuf + index, 0, size_in_words * sizeof(u32)); 43 memset(cmdbuf + index, 0, size_in_words * sizeof(u32));
44 index += size_in_words; 44 }
45 index += static_cast<ptrdiff_t>(size_in_words);
45 } 46 }
46 47
47 /** 48 /**
@@ -49,15 +50,15 @@ public:
49 */ 50 */
50 void AlignWithPadding() { 51 void AlignWithPadding() {
51 if (index & 3) { 52 if (index & 3) {
52 Skip(4 - (index & 3), true); 53 Skip(static_cast<u32>(4 - (index & 3)), true);
53 } 54 }
54 } 55 }
55 56
56 unsigned GetCurrentOffset() const { 57 u32 GetCurrentOffset() const {
57 return static_cast<unsigned>(index); 58 return static_cast<u32>(index);
58 } 59 }
59 60
60 void SetCurrentOffset(unsigned offset) { 61 void SetCurrentOffset(u32 offset) {
61 index = static_cast<ptrdiff_t>(offset); 62 index = static_cast<ptrdiff_t>(offset);
62 } 63 }
63}; 64};
@@ -89,7 +90,7 @@ public:
89 90
90 // The entire size of the raw data section in u32 units, including the 16 bytes of mandatory 91 // The entire size of the raw data section in u32 units, including the 16 bytes of mandatory
91 // padding. 92 // padding.
92 u32 raw_data_size = sizeof(IPC::DataPayloadHeader) / 4 + 4 + normal_params_size; 93 u64 raw_data_size = sizeof(IPC::DataPayloadHeader) / 4 + 4 + normal_params_size;
93 94
94 u32 num_handles_to_move{}; 95 u32 num_handles_to_move{};
95 u32 num_domain_objects{}; 96 u32 num_domain_objects{};
@@ -105,7 +106,7 @@ public:
105 raw_data_size += sizeof(DomainMessageHeader) / 4 + num_domain_objects; 106 raw_data_size += sizeof(DomainMessageHeader) / 4 + num_domain_objects;
106 } 107 }
107 108
108 header.data_size.Assign(raw_data_size); 109 header.data_size.Assign(static_cast<u32>(raw_data_size));
109 if (num_handles_to_copy || num_handles_to_move) { 110 if (num_handles_to_copy || num_handles_to_move) {
110 header.enable_handle_descriptor.Assign(1); 111 header.enable_handle_descriptor.Assign(1);
111 } 112 }