diff options
| author | LC <mathew1800@gmail.com> | 2020-10-20 19:19:12 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-20 19:19:12 -0400 |
| commit | 88d5140cf2f80d51dc297af3a128a4212215149f (patch) | |
| tree | cd524e8ab111fba79f75a48cc672cb875251a32f /src/core/hle/kernel/process.cpp | |
| parent | 940c3bf68deff4f45c2dc3c2549c00cff4e1b586 (diff) | |
| parent | be1954e04cb5a0c3a526f78ed5490a5e65310280 (diff) | |
Merge pull request #4796 from lioncash/clang
core: Fix clang build
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index ff9d9248b..0b39f2955 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -137,9 +137,10 @@ std::shared_ptr<ResourceLimit> Process::GetResourceLimit() const { } u64 Process::GetTotalPhysicalMemoryAvailable() const { - const u64 capacity{resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory) + - page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + - main_thread_stack_size}; + const u64 capacity{ + static_cast<u64>(resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory)) + + page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + + main_thread_stack_size}; if (capacity < memory_usage_capacity) { return capacity; @@ -279,12 +280,12 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, // Set initial resource limits resource_limit->SetLimitValue( ResourceType::PhysicalMemory, - kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application)); + static_cast<s64>(kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application))); resource_limit->SetLimitValue(ResourceType::Threads, 608); resource_limit->SetLimitValue(ResourceType::Events, 700); resource_limit->SetLimitValue(ResourceType::TransferMemory, 128); resource_limit->SetLimitValue(ResourceType::Sessions, 894); - ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, code_size)); + ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(code_size))); // Create TLS region tls_region_address = CreateTLSRegion(); @@ -300,9 +301,9 @@ void Process::Run(s32 main_thread_priority, u64 stack_size) { ChangeStatus(ProcessStatus::Running); - SetupMainThread(system, *this, main_thread_priority, main_thread_stack_top); + SetupMainThread(system, *this, static_cast<u32>(main_thread_priority), main_thread_stack_top); resource_limit->Reserve(ResourceType::Threads, 1); - resource_limit->Reserve(ResourceType::PhysicalMemory, main_thread_stack_size); + resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(main_thread_stack_size)); } void Process::PrepareForTermination() { @@ -363,7 +364,7 @@ VAddr Process::CreateTLSRegion() { ->AllocateAndMapMemory(1, Memory::PageSize, true, start, size / Memory::PageSize, Memory::MemoryState::ThreadLocal, Memory::MemoryPermission::ReadAndWrite, tls_map_addr) - .ValueOr(0)}; + .ValueOr(0U)}; ASSERT(tls_page_addr); |
