diff options
| author | 2020-10-15 14:49:45 -0400 | |
|---|---|---|
| committer | 2020-10-17 19:50:39 -0400 | |
| commit | be1954e04cb5a0c3a526f78ed5490a5e65310280 (patch) | |
| tree | 267db7ae4be88dbbc288fa605e35d4a2a13839f6 /src/core/hle/kernel/process.cpp | |
| parent | Merge pull request #4787 from lioncash/conversion (diff) | |
| download | yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.gz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.tar.xz yuzu-be1954e04cb5a0c3a526f78ed5490a5e65310280.zip | |
core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.
Fixes #4795
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 { | |||
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | u64 Process::GetTotalPhysicalMemoryAvailable() const { | 139 | u64 Process::GetTotalPhysicalMemoryAvailable() const { |
| 140 | const u64 capacity{resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory) + | 140 | const u64 capacity{ |
| 141 | page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + | 141 | static_cast<u64>(resource_limit->GetCurrentResourceValue(ResourceType::PhysicalMemory)) + |
| 142 | main_thread_stack_size}; | 142 | page_table->GetTotalHeapSize() + GetSystemResourceSize() + image_size + |
| 143 | main_thread_stack_size}; | ||
| 143 | 144 | ||
| 144 | if (capacity < memory_usage_capacity) { | 145 | if (capacity < memory_usage_capacity) { |
| 145 | return capacity; | 146 | return capacity; |
| @@ -279,12 +280,12 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | |||
| 279 | // Set initial resource limits | 280 | // Set initial resource limits |
| 280 | resource_limit->SetLimitValue( | 281 | resource_limit->SetLimitValue( |
| 281 | ResourceType::PhysicalMemory, | 282 | ResourceType::PhysicalMemory, |
| 282 | kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application)); | 283 | static_cast<s64>(kernel.MemoryManager().GetSize(Memory::MemoryManager::Pool::Application))); |
| 283 | resource_limit->SetLimitValue(ResourceType::Threads, 608); | 284 | resource_limit->SetLimitValue(ResourceType::Threads, 608); |
| 284 | resource_limit->SetLimitValue(ResourceType::Events, 700); | 285 | resource_limit->SetLimitValue(ResourceType::Events, 700); |
| 285 | resource_limit->SetLimitValue(ResourceType::TransferMemory, 128); | 286 | resource_limit->SetLimitValue(ResourceType::TransferMemory, 128); |
| 286 | resource_limit->SetLimitValue(ResourceType::Sessions, 894); | 287 | resource_limit->SetLimitValue(ResourceType::Sessions, 894); |
| 287 | ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, code_size)); | 288 | ASSERT(resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(code_size))); |
| 288 | 289 | ||
| 289 | // Create TLS region | 290 | // Create TLS region |
| 290 | tls_region_address = CreateTLSRegion(); | 291 | tls_region_address = CreateTLSRegion(); |
| @@ -300,9 +301,9 @@ void Process::Run(s32 main_thread_priority, u64 stack_size) { | |||
| 300 | 301 | ||
| 301 | ChangeStatus(ProcessStatus::Running); | 302 | ChangeStatus(ProcessStatus::Running); |
| 302 | 303 | ||
| 303 | SetupMainThread(system, *this, main_thread_priority, main_thread_stack_top); | 304 | SetupMainThread(system, *this, static_cast<u32>(main_thread_priority), main_thread_stack_top); |
| 304 | resource_limit->Reserve(ResourceType::Threads, 1); | 305 | resource_limit->Reserve(ResourceType::Threads, 1); |
| 305 | resource_limit->Reserve(ResourceType::PhysicalMemory, main_thread_stack_size); | 306 | resource_limit->Reserve(ResourceType::PhysicalMemory, static_cast<s64>(main_thread_stack_size)); |
| 306 | } | 307 | } |
| 307 | 308 | ||
| 308 | void Process::PrepareForTermination() { | 309 | void Process::PrepareForTermination() { |
| @@ -363,7 +364,7 @@ VAddr Process::CreateTLSRegion() { | |||
| 363 | ->AllocateAndMapMemory(1, Memory::PageSize, true, start, size / Memory::PageSize, | 364 | ->AllocateAndMapMemory(1, Memory::PageSize, true, start, size / Memory::PageSize, |
| 364 | Memory::MemoryState::ThreadLocal, | 365 | Memory::MemoryState::ThreadLocal, |
| 365 | Memory::MemoryPermission::ReadAndWrite, tls_map_addr) | 366 | Memory::MemoryPermission::ReadAndWrite, tls_map_addr) |
| 366 | .ValueOr(0)}; | 367 | .ValueOr(0U)}; |
| 367 | 368 | ||
| 368 | ASSERT(tls_page_addr); | 369 | ASSERT(tls_page_addr); |
| 369 | 370 | ||