summaryrefslogtreecommitdiff
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorGravatar comex2020-08-31 10:34:46 -0400
committerGravatar comex2020-12-06 18:59:22 -0500
commit3373149fdc4dd4dc041fcd5501db5b4ccf0af7bb (patch)
tree5c9c158f9ec5804cbec7c63bf7957e1a7280f35d /src/core/hle/service
parentMerge pull request #5146 from comex/xx-num (diff)
downloadyuzu-3373149fdc4dd4dc041fcd5501db5b4ccf0af7bb.tar.gz
yuzu-3373149fdc4dd4dc041fcd5501db5b4ccf0af7bb.tar.xz
yuzu-3373149fdc4dd4dc041fcd5501db5b4ccf0af7bb.zip
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`.
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/vi/vi.cpp4
1 files changed, 2 insertions, 2 deletions
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:
1230 const auto height = rp.Pop<u64>(); 1230 const auto height = rp.Pop<u64>();
1231 LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); 1231 LOG_DEBUG(Service_VI, "called width={}, height={}", width, height);
1232 1232
1233 constexpr std::size_t base_size = 0x20000; 1233 constexpr u64 base_size = 0x20000;
1234 constexpr std::size_t alignment = 0x1000; 1234 constexpr u64 alignment = 0x1000;
1235 const auto texture_size = width * height * 4; 1235 const auto texture_size = width * height * 4;
1236 const auto out_size = (texture_size + base_size - 1) / base_size * base_size; 1236 const auto out_size = (texture_size + base_size - 1) / base_size * base_size;
1237 1237