From 50eee9b2185c59c32fb82cf464230a058edd10ea Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 12 Aug 2023 15:18:55 -0400 Subject: fssystem: rework for yuzu style --- src/common/alignment.h | 8 ++++++-- src/common/lz4_compression.cpp | 2 +- src/common/lz4_compression.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/alignment.h b/src/common/alignment.h index 0057052af..fc5c26898 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h @@ -12,7 +12,9 @@ namespace Common { template requires std::is_integral_v -[[nodiscard]] constexpr T AlignUp(T value, size_t size) { +[[nodiscard]] constexpr T AlignUp(T value_, size_t size) { + using U = typename std::make_unsigned_t; + auto value{static_cast(value_)}; auto mod{static_cast(value % size)}; value -= mod; return static_cast(mod == T{0} ? value : value + size); @@ -26,7 +28,9 @@ template template requires std::is_integral_v -[[nodiscard]] constexpr T AlignDown(T value, size_t size) { +[[nodiscard]] constexpr T AlignDown(T value_, size_t size) { + using U = typename std::make_unsigned_t; + const auto value{static_cast(value_)}; return static_cast(value - value % size); } diff --git a/src/common/lz4_compression.cpp b/src/common/lz4_compression.cpp index 6867c03c4..d85ab1742 100644 --- a/src/common/lz4_compression.cpp +++ b/src/common/lz4_compression.cpp @@ -71,7 +71,7 @@ std::vector DecompressDataLZ4(std::span compressed, std::size_t un return uncompressed; } -int DecompressLZ4(void* dst, size_t dst_size, const void* src, size_t src_size) { +int DecompressDataLZ4(void* dst, size_t dst_size, const void* src, size_t src_size) { // This is just a thin wrapper around LZ4. return LZ4_decompress_safe(reinterpret_cast(src), reinterpret_cast(dst), static_cast(src_size), static_cast(dst_size)); diff --git a/src/common/lz4_compression.h b/src/common/lz4_compression.h index 7200e0f22..3ae17c2bb 100644 --- a/src/common/lz4_compression.h +++ b/src/common/lz4_compression.h @@ -56,6 +56,6 @@ namespace Common::Compression { [[nodiscard]] std::vector DecompressDataLZ4(std::span compressed, std::size_t uncompressed_size); -int DecompressLZ4(void* dst, size_t dst_size, const void* src, size_t src_size); +[[nodiscard]] int DecompressDataLZ4(void* dst, size_t dst_size, const void* src, size_t src_size); } // namespace Common::Compression -- cgit v1.2.3