From 3373149fdc4dd4dc041fcd5501db5b4ccf0af7bb Mon Sep 17 00:00:00 2001 From: comex Date: Mon, 31 Aug 2020 10:34:46 -0400 Subject: hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp - Add a type check so that calling Push with an invalid type produces a compile error rather than a linker error. - vi.cpp was calling Push with a variable of type `std::size_t`. There's no explicit overload for `size_t`, but there is one for `u64`, which on most platforms is the same type as `size_t`. On macOS, however, it isn't: both types are 64 bits, but `size_t` is `unsigned long` and `u64` is `unsigned long long`. Regardless, it makes more sense to explicitly use `u64` here instead of `size_t`. --- src/core/hle/service/vi/vi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index af5b8b0b9..422e9e02f 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp @@ -1230,8 +1230,8 @@ private: const auto height = rp.Pop(); LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); - constexpr std::size_t base_size = 0x20000; - constexpr std::size_t alignment = 0x1000; + constexpr u64 base_size = 0x20000; + constexpr u64 alignment = 0x1000; const auto texture_size = width * height * 4; const auto out_size = (texture_size + base_size - 1) / base_size * base_size; -- cgit v1.2.3