diff options
| author | 2018-03-25 00:01:13 -0400 | |
|---|---|---|
| committer | 2018-03-26 21:17:01 -0400 | |
| commit | d4fb8a887cd88f2cbbf34b3f97e595070e231997 (patch) | |
| tree | 1db030a0d59de6a4718eeba686f366bc2aafb910 /src/core/memory.cpp | |
| parent | maxwel_to_gl: Fix string formatting in log statements. (diff) | |
| download | yuzu-d4fb8a887cd88f2cbbf34b3f97e595070e231997.tar.gz yuzu-d4fb8a887cd88f2cbbf34b3f97e595070e231997.tar.xz yuzu-d4fb8a887cd88f2cbbf34b3f97e595070e231997.zip | |
memory: Fix cast for ReadBlock/WriteBlock/ZeroBlock/CopyBlock.
Diffstat (limited to 'src/core/memory.cpp')
| -rw-r--r-- | src/core/memory.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 47c4828f7..291bf066f 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -439,7 +439,8 @@ void ReadBlock(const Kernel::Process& process, const VAddr src_addr, void* dest_ | |||
| 439 | size_t page_offset = src_addr & PAGE_MASK; | 439 | size_t page_offset = src_addr & PAGE_MASK; |
| 440 | 440 | ||
| 441 | while (remaining_size > 0) { | 441 | while (remaining_size > 0) { |
| 442 | const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); | 442 | const size_t copy_amount = |
| 443 | std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size); | ||
| 443 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); | 444 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); |
| 444 | 445 | ||
| 445 | switch (page_table.attributes[page_index]) { | 446 | switch (page_table.attributes[page_index]) { |
| @@ -501,7 +502,8 @@ void WriteBlock(const Kernel::Process& process, const VAddr dest_addr, const voi | |||
| 501 | size_t page_offset = dest_addr & PAGE_MASK; | 502 | size_t page_offset = dest_addr & PAGE_MASK; |
| 502 | 503 | ||
| 503 | while (remaining_size > 0) { | 504 | while (remaining_size > 0) { |
| 504 | const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); | 505 | const size_t copy_amount = |
| 506 | std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size); | ||
| 505 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); | 507 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); |
| 506 | 508 | ||
| 507 | switch (page_table.attributes[page_index]) { | 509 | switch (page_table.attributes[page_index]) { |
| @@ -548,7 +550,8 @@ void ZeroBlock(const Kernel::Process& process, const VAddr dest_addr, const size | |||
| 548 | static const std::array<u8, PAGE_SIZE> zeros = {}; | 550 | static const std::array<u8, PAGE_SIZE> zeros = {}; |
| 549 | 551 | ||
| 550 | while (remaining_size > 0) { | 552 | while (remaining_size > 0) { |
| 551 | const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); | 553 | const size_t copy_amount = |
| 554 | std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size); | ||
| 552 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); | 555 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); |
| 553 | 556 | ||
| 554 | switch (page_table.attributes[page_index]) { | 557 | switch (page_table.attributes[page_index]) { |
| @@ -587,7 +590,8 @@ void CopyBlock(const Kernel::Process& process, VAddr dest_addr, VAddr src_addr, | |||
| 587 | size_t page_offset = src_addr & PAGE_MASK; | 590 | size_t page_offset = src_addr & PAGE_MASK; |
| 588 | 591 | ||
| 589 | while (remaining_size > 0) { | 592 | while (remaining_size > 0) { |
| 590 | const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); | 593 | const size_t copy_amount = |
| 594 | std::min(static_cast<size_t>(PAGE_SIZE) - page_offset, remaining_size); | ||
| 591 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); | 595 | const VAddr current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset); |
| 592 | 596 | ||
| 593 | switch (page_table.attributes[page_index]) { | 597 | switch (page_table.attributes[page_index]) { |