diff --git a/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_serialization.hpp b/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_serialization.hpp index 2de8f6dfb..41a669547 100644 --- a/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_serialization.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/ipc/ipc_serialization.hpp @@ -160,24 +160,11 @@ struct RawDataHelper> { static constexpr size_t size = sizeof(T); }; -template -struct RawSizeElementAdder { - static constexpr size_t GetUpdateElementSize(size_t &size) { - constexpr size_t t_align = RawDataHelper::align; - constexpr size_t t_size = RawDataHelper::size; - if (size % t_align == 0) { - size += t_align - (size % t_align); - } - size += t_size; - return size; - } -}; - template -struct RawDataHelper; +struct RawDataComputer; template -struct RawDataHelper> { +struct RawDataComputer> { /* https://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs,2604 */ static constexpr void QuickSort(std::array &map, std::array &values, int left, int right) { do { @@ -300,11 +287,11 @@ struct CommandMetaInfo, _ReturnType> { static_assert(NumInHandles <= 8, "Methods can take in <= 8 Handles!"); static_assert(NumOutHandles + NumOutSessions <= 8, "Methods can only return <= 8 Handles+Sessions!"); - static constexpr std::array InDataOffsets = RawDataHelper::offsets; + static constexpr std::array InDataOffsets = RawDataComputer::offsets; static constexpr size_t InRawArgSize = InDataOffsets[NumInDatas]; static constexpr size_t InRawArgSizeWithOutPointers = ((InRawArgSize + NumClientSizeOutPointers * sizeof(u16)) + 3) & ~3; - static constexpr std::array OutDataOffsets = RawDataHelper::offsets; + static constexpr std::array OutDataOffsets = RawDataComputer::offsets; static constexpr size_t OutRawArgSize = OutDataOffsets[NumOutDatas]; };