From 255e46e6d2073371c36198ded0dcb1ce887a216f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 8 Dec 2019 12:35:07 -0800 Subject: [PATCH] sf: correct size calculation for In/OutArray --- .../include/stratosphere/sf/sf_buffers.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp index 9497d1707..01f096408 100644 --- a/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp +++ b/stratosphere/libstratosphere/include/stratosphere/sf/sf_buffers.hpp @@ -96,8 +96,9 @@ namespace ams::sf { return this->pas.GetAddress(); } - constexpr size_t GetSizeImpl() const { - return this->pas.GetSize(); + template + constexpr inline size_t GetSizeImpl() const { + return this->pas.GetSize() / sizeof(Entry); } public: constexpr BufferBase() : pas() { /* ... */ } @@ -153,7 +154,7 @@ namespace ams::sf { } constexpr size_t GetSize() const { - return this->GetSizeImpl(); + return this->GetSizeImpl(); } }; @@ -177,7 +178,7 @@ namespace ams::sf { } constexpr size_t GetSize() const { - return this->GetSizeImpl(); + return this->GetSizeImpl(); } }; @@ -200,7 +201,7 @@ namespace ams::sf { } constexpr size_t GetSize() const { - return this->GetSizeImpl(); + return this->GetSizeImpl(); } constexpr const T &operator[](size_t i) const { @@ -227,7 +228,7 @@ namespace ams::sf { } constexpr size_t GetSize() const { - return this->GetSizeImpl(); + return this->GetSizeImpl(); } constexpr T &operator[](size_t i) const {