diff options
| -rw-r--r-- | src/core/file_sys/romfs_factory.cpp | 10 | ||||
| -rw-r--r-- | src/core/file_sys/savedata_factory.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/sdmc_factory.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/result.h | 20 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 21 | ||||
| -rw-r--r-- | src/core/hle/service/glue/glue_manager.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_manager.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ns/ns.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/sm/sm.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/spl/spl_module.cpp | 26 | ||||
| -rw-r--r-- | src/core/hle/service/vi/vi.cpp | 10 |
13 files changed, 48 insertions, 69 deletions
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp index 638c6cea8..3d9ce863b 100644 --- a/src/core/file_sys/romfs_factory.cpp +++ b/src/core/file_sys/romfs_factory.cpp | |||
| @@ -39,13 +39,12 @@ void RomFSFactory::SetPackedUpdate(VirtualFile update_raw_file) { | |||
| 39 | 39 | ||
| 40 | ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { | 40 | ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_title_id) const { |
| 41 | if (!updatable) { | 41 | if (!updatable) { |
| 42 | return MakeResult<VirtualFile>(file); | 42 | return file; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | const PatchManager patch_manager{current_process_title_id, filesystem_controller, | 45 | const PatchManager patch_manager{current_process_title_id, filesystem_controller, |
| 46 | content_provider}; | 46 | content_provider}; |
| 47 | return MakeResult<VirtualFile>( | 47 | return patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw); |
| 48 | patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); | ||
| 49 | } | 48 | } |
| 50 | 49 | ||
| 51 | ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const { | 50 | ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const { |
| @@ -58,8 +57,7 @@ ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecor | |||
| 58 | 57 | ||
| 59 | const PatchManager patch_manager{title_id, filesystem_controller, content_provider}; | 58 | const PatchManager patch_manager{title_id, filesystem_controller, content_provider}; |
| 60 | 59 | ||
| 61 | return MakeResult<VirtualFile>( | 60 | return patch_manager.PatchRomFS(nca->GetRomFS(), nca->GetBaseIVFCOffset(), type); |
| 62 | patch_manager.PatchRomFS(nca->GetRomFS(), nca->GetBaseIVFCOffset(), type)); | ||
| 63 | } | 61 | } |
| 64 | 62 | ||
| 65 | ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFSWithProgramIndex( | 63 | ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFSWithProgramIndex( |
| @@ -83,7 +81,7 @@ ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, | |||
| 83 | return ResultUnknown; | 81 | return ResultUnknown; |
| 84 | } | 82 | } |
| 85 | 83 | ||
| 86 | return MakeResult<VirtualFile>(romfs); | 84 | return romfs; |
| 87 | } | 85 | } |
| 88 | 86 | ||
| 89 | std::shared_ptr<NCA> RomFSFactory::GetEntry(u64 title_id, StorageId storage, | 87 | std::shared_ptr<NCA> RomFSFactory::GetEntry(u64 title_id, StorageId storage, |
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp index b5254dd75..0c8ec4ba2 100644 --- a/src/core/file_sys/savedata_factory.cpp +++ b/src/core/file_sys/savedata_factory.cpp | |||
| @@ -94,7 +94,7 @@ ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space, | |||
| 94 | return ResultUnknown; | 94 | return ResultUnknown; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | return MakeResult<VirtualDir>(std::move(out)); | 97 | return out; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, | 100 | ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, |
| @@ -115,7 +115,7 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space, | |||
| 115 | return ResultUnknown; | 115 | return ResultUnknown; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | return MakeResult<VirtualDir>(std::move(out)); | 118 | return out; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | VirtualDir SaveDataFactory::GetSaveDataSpaceDirectory(SaveDataSpaceId space) const { | 121 | VirtualDir SaveDataFactory::GetSaveDataSpaceDirectory(SaveDataSpaceId space) const { |
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index e5c72cd4d..c0e13e56f 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp | |||
| @@ -25,7 +25,7 @@ SDMCFactory::SDMCFactory(VirtualDir sd_dir_, VirtualDir sd_mod_dir_) | |||
| 25 | SDMCFactory::~SDMCFactory() = default; | 25 | SDMCFactory::~SDMCFactory() = default; |
| 26 | 26 | ||
| 27 | ResultVal<VirtualDir> SDMCFactory::Open() const { | 27 | ResultVal<VirtualDir> SDMCFactory::Open() const { |
| 28 | return MakeResult<VirtualDir>(sd_dir); | 28 | return sd_dir; |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | VirtualDir SDMCFactory::GetSDMCModificationLoadRoot(u64 title_id) const { | 31 | VirtualDir SDMCFactory::GetSDMCModificationLoadRoot(u64 title_id) const { |
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index 5e0b620c2..526b87241 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp | |||
| @@ -859,7 +859,7 @@ ResultVal<VAddr> KPageTable::SetHeapSize(std::size_t size) { | |||
| 859 | current_heap_addr = heap_region_start + size; | 859 | current_heap_addr = heap_region_start + size; |
| 860 | } | 860 | } |
| 861 | 861 | ||
| 862 | return MakeResult<VAddr>(heap_region_start); | 862 | return heap_region_start; |
| 863 | } | 863 | } |
| 864 | 864 | ||
| 865 | ResultVal<VAddr> KPageTable::AllocateAndMapMemory(std::size_t needed_num_pages, std::size_t align, | 865 | ResultVal<VAddr> KPageTable::AllocateAndMapMemory(std::size_t needed_num_pages, std::size_t align, |
| @@ -893,7 +893,7 @@ ResultVal<VAddr> KPageTable::AllocateAndMapMemory(std::size_t needed_num_pages, | |||
| 893 | 893 | ||
| 894 | block_manager->Update(addr, needed_num_pages, state, perm); | 894 | block_manager->Update(addr, needed_num_pages, state, perm); |
| 895 | 895 | ||
| 896 | return MakeResult<VAddr>(addr); | 896 | return addr; |
| 897 | } | 897 | } |
| 898 | 898 | ||
| 899 | ResultCode KPageTable::LockForDeviceAddressSpace(VAddr addr, std::size_t size) { | 899 | ResultCode KPageTable::LockForDeviceAddressSpace(VAddr addr, std::size_t size) { |
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index a1917d32b..3807b9aa8 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -168,7 +168,7 @@ constexpr ResultCode ResultUnknown(UINT32_MAX); | |||
| 168 | * return ResultCode{ErrorModule::Common, 1}; | 168 | * return ResultCode{ErrorModule::Common, 1}; |
| 169 | * } else { | 169 | * } else { |
| 170 | * // Frobnicated! Give caller a cookie | 170 | * // Frobnicated! Give caller a cookie |
| 171 | * return MakeResult(42); | 171 | * return 42; |
| 172 | * } | 172 | * } |
| 173 | * } | 173 | * } |
| 174 | * \endcode | 174 | * \endcode |
| @@ -280,24 +280,6 @@ private: | |||
| 280 | }; | 280 | }; |
| 281 | 281 | ||
| 282 | /** | 282 | /** |
| 283 | * This function is a helper used to construct `ResultVal`s. It receives the arguments to construct | ||
| 284 | * `T` with and creates a `ResultVal` that contains the constructed value. | ||
| 285 | */ | ||
| 286 | template <typename T, typename... Args> | ||
| 287 | [[nodiscard]] ResultVal<T> MakeResult(Args&&... args) { | ||
| 288 | return ResultVal<T>{std::forward<Args>(args)...}; | ||
| 289 | } | ||
| 290 | |||
| 291 | /** | ||
| 292 | * Deducible overload of MakeResult, allowing the template parameter to be ommited if you're just | ||
| 293 | * copy or move constructing. | ||
| 294 | */ | ||
| 295 | template <typename T> | ||
| 296 | [[nodiscard]] ResultVal<std::remove_cvref_t<T>> MakeResult(T&& val) { | ||
| 297 | return ResultVal<std::remove_cvref_t<T>>{std::forward<T>(val)}; | ||
| 298 | } | ||
| 299 | |||
| 300 | /** | ||
| 301 | * Check for the success of `source` (which must evaluate to a ResultVal). If it succeeds, unwraps | 283 | * Check for the success of `source` (which must evaluate to a ResultVal). If it succeeds, unwraps |
| 302 | * the contained value and assigns it to `target`, which can be either an l-value expression or a | 284 | * the contained value and assigns it to `target`, which can be either an l-value expression or a |
| 303 | * variable declaration. If it fails the return code is returned from the current function. Thus it | 285 | * variable declaration. If it fails the return code is returned from the current function. Thus it |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index f8f9e32f7..42e468ce2 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -226,11 +226,10 @@ ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std:: | |||
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | if (mode == FileSys::Mode::Append) { | 228 | if (mode == FileSys::Mode::Append) { |
| 229 | return MakeResult<FileSys::VirtualFile>( | 229 | return std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize()); |
| 230 | std::make_shared<FileSys::OffsetVfsFile>(file, 0, file->GetSize())); | ||
| 231 | } | 230 | } |
| 232 | 231 | ||
| 233 | return MakeResult<FileSys::VirtualFile>(file); | 232 | return file; |
| 234 | } | 233 | } |
| 235 | 234 | ||
| 236 | ResultVal<FileSys::VirtualDir> VfsDirectoryServiceWrapper::OpenDirectory(const std::string& path_) { | 235 | ResultVal<FileSys::VirtualDir> VfsDirectoryServiceWrapper::OpenDirectory(const std::string& path_) { |
| @@ -240,7 +239,7 @@ ResultVal<FileSys::VirtualDir> VfsDirectoryServiceWrapper::OpenDirectory(const s | |||
| 240 | // TODO(DarkLordZach): Find a better error code for this | 239 | // TODO(DarkLordZach): Find a better error code for this |
| 241 | return FileSys::ERROR_PATH_NOT_FOUND; | 240 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 242 | } | 241 | } |
| 243 | return MakeResult(dir); | 242 | return dir; |
| 244 | } | 243 | } |
| 245 | 244 | ||
| 246 | ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( | 245 | ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( |
| @@ -252,12 +251,12 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( | |||
| 252 | auto filename = Common::FS::GetFilename(path); | 251 | auto filename = Common::FS::GetFilename(path); |
| 253 | // TODO(Subv): Some games use the '/' path, find out what this means. | 252 | // TODO(Subv): Some games use the '/' path, find out what this means. |
| 254 | if (filename.empty()) | 253 | if (filename.empty()) |
| 255 | return MakeResult(FileSys::EntryType::Directory); | 254 | return FileSys::EntryType::Directory; |
| 256 | 255 | ||
| 257 | if (dir->GetFile(filename) != nullptr) | 256 | if (dir->GetFile(filename) != nullptr) |
| 258 | return MakeResult(FileSys::EntryType::File); | 257 | return FileSys::EntryType::File; |
| 259 | if (dir->GetSubdirectory(filename) != nullptr) | 258 | if (dir->GetSubdirectory(filename) != nullptr) |
| 260 | return MakeResult(FileSys::EntryType::Directory); | 259 | return FileSys::EntryType::Directory; |
| 261 | return FileSys::ERROR_PATH_NOT_FOUND; | 260 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 262 | } | 261 | } |
| 263 | 262 | ||
| @@ -270,7 +269,7 @@ ResultVal<FileSys::FileTimeStampRaw> VfsDirectoryServiceWrapper::GetFileTimeStam | |||
| 270 | if (GetEntryType(path).Failed()) { | 269 | if (GetEntryType(path).Failed()) { |
| 271 | return FileSys::ERROR_PATH_NOT_FOUND; | 270 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 272 | } | 271 | } |
| 273 | return MakeResult(dir->GetFileTimeStamp(Common::FS::GetFilename(path))); | 272 | return dir->GetFileTimeStamp(Common::FS::GetFilename(path)); |
| 274 | } | 273 | } |
| 275 | 274 | ||
| 276 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} | 275 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} |
| @@ -395,7 +394,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( | |||
| 395 | return FileSys::ERROR_ENTITY_NOT_FOUND; | 394 | return FileSys::ERROR_ENTITY_NOT_FOUND; |
| 396 | } | 395 | } |
| 397 | 396 | ||
| 398 | return MakeResult(save_data_factory->GetSaveDataSpaceDirectory(space)); | 397 | return save_data_factory->GetSaveDataSpaceDirectory(space); |
| 399 | } | 398 | } |
| 400 | 399 | ||
| 401 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() const { | 400 | ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() const { |
| @@ -421,7 +420,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition( | |||
| 421 | return FileSys::ERROR_INVALID_ARGUMENT; | 420 | return FileSys::ERROR_INVALID_ARGUMENT; |
| 422 | } | 421 | } |
| 423 | 422 | ||
| 424 | return MakeResult<FileSys::VirtualDir>(std::move(part)); | 423 | return part; |
| 425 | } | 424 | } |
| 426 | 425 | ||
| 427 | ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( | 426 | ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( |
| @@ -437,7 +436,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( | |||
| 437 | return FileSys::ERROR_INVALID_ARGUMENT; | 436 | return FileSys::ERROR_INVALID_ARGUMENT; |
| 438 | } | 437 | } |
| 439 | 438 | ||
| 440 | return MakeResult<FileSys::VirtualFile>(std::move(part)); | 439 | return part; |
| 441 | } | 440 | } |
| 442 | 441 | ||
| 443 | u64 FileSystemController::GetFreeSpaceSize(FileSys::StorageId id) const { | 442 | u64 FileSystemController::GetFreeSpaceSize(FileSys::StorageId id) const { |
diff --git a/src/core/hle/service/glue/glue_manager.cpp b/src/core/hle/service/glue/glue_manager.cpp index aa9d48c0c..48e133b48 100644 --- a/src/core/hle/service/glue/glue_manager.cpp +++ b/src/core/hle/service/glue/glue_manager.cpp | |||
| @@ -26,7 +26,7 @@ ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) | |||
| 26 | return ERR_NOT_REGISTERED; | 26 | return ERR_NOT_REGISTERED; |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | return MakeResult<ApplicationLaunchProperty>(iter->second.launch); | 29 | return iter->second.launch; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { | 32 | ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { |
| @@ -39,7 +39,7 @@ ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { | |||
| 39 | return ERR_NOT_REGISTERED; | 39 | return ERR_NOT_REGISTERED; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | return MakeResult<std::vector<u8>>(iter->second.control); | 42 | return iter->second.control; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | ResultCode ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, | 45 | ResultCode ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, |
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 24b7e4435..e4b97c1f6 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -335,7 +335,7 @@ public: | |||
| 335 | CASCADE_CODE(result); | 335 | CASCADE_CODE(result); |
| 336 | 336 | ||
| 337 | if (ValidateRegionForMap(page_table, addr, size)) { | 337 | if (ValidateRegionForMap(page_table, addr, size)) { |
| 338 | return MakeResult<VAddr>(addr); | 338 | return addr; |
| 339 | } | 339 | } |
| 340 | } | 340 | } |
| 341 | 341 | ||
| @@ -371,7 +371,7 @@ public: | |||
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | if (ValidateRegionForMap(page_table, addr, size)) { | 373 | if (ValidateRegionForMap(page_table, addr, size)) { |
| 374 | return MakeResult<VAddr>(addr); | 374 | return addr; |
| 375 | } | 375 | } |
| 376 | } | 376 | } |
| 377 | 377 | ||
diff --git a/src/core/hle/service/mii/mii_manager.cpp b/src/core/hle/service/mii/mii_manager.cpp index 4fef2aea4..ca4ed35bb 100644 --- a/src/core/hle/service/mii/mii_manager.cpp +++ b/src/core/hle/service/mii/mii_manager.cpp | |||
| @@ -443,14 +443,14 @@ ResultVal<std::vector<MiiInfoElement>> MiiManager::GetDefault(SourceFlag source_ | |||
| 443 | std::vector<MiiInfoElement> result; | 443 | std::vector<MiiInfoElement> result; |
| 444 | 444 | ||
| 445 | if ((source_flag & SourceFlag::Default) == SourceFlag::None) { | 445 | if ((source_flag & SourceFlag::Default) == SourceFlag::None) { |
| 446 | return MakeResult(std::move(result)); | 446 | return result; |
| 447 | } | 447 | } |
| 448 | 448 | ||
| 449 | for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) { | 449 | for (std::size_t index = BaseMiiCount; index < DefaultMiiCount; index++) { |
| 450 | result.emplace_back(BuildDefault(index), Source::Default); | 450 | result.emplace_back(BuildDefault(index), Source::Default); |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | return MakeResult(std::move(result)); | 453 | return result; |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | ResultCode MiiManager::GetIndex([[maybe_unused]] const MiiInfo& info, u32& index) { | 456 | ResultCode MiiManager::GetIndex([[maybe_unused]] const MiiInfo& info, u32& index) { |
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 931b48f72..64ffc8572 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -414,7 +414,7 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 414 | for (const auto lang : *priority_list) { | 414 | for (const auto lang : *priority_list) { |
| 415 | const auto supported_flag = GetSupportedLanguageFlag(lang); | 415 | const auto supported_flag = GetSupportedLanguageFlag(lang); |
| 416 | if (supported_languages == 0 || (supported_languages & supported_flag) == supported_flag) { | 416 | if (supported_languages == 0 || (supported_languages & supported_flag) == supported_flag) { |
| 417 | return MakeResult(static_cast<u8>(lang)); | 417 | return static_cast<u8>(lang); |
| 418 | } | 418 | } |
| 419 | } | 419 | } |
| 420 | 420 | ||
| @@ -448,7 +448,7 @@ ResultVal<u64> IApplicationManagerInterface::ConvertApplicationLanguageToLanguag | |||
| 448 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 448 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; |
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | return MakeResult(static_cast<u64>(*language_code)); | 451 | return static_cast<u64>(*language_code); |
| 452 | } | 452 | } |
| 453 | 453 | ||
| 454 | IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_) | 454 | IApplicationVersionInterface::IApplicationVersionInterface(Core::System& system_) |
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index ae4dc4a75..41abb146c 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -87,7 +87,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name | |||
| 87 | auto handler = it->second; | 87 | auto handler = it->second; |
| 88 | port->GetServerPort().SetSessionHandler(std::move(handler)); | 88 | port->GetServerPort().SetSessionHandler(std::move(handler)); |
| 89 | 89 | ||
| 90 | return MakeResult(port); | 90 | return port; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | /** | 93 | /** |
| @@ -165,7 +165,7 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& | |||
| 165 | 165 | ||
| 166 | LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetId()); | 166 | LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetId()); |
| 167 | 167 | ||
| 168 | return MakeResult(session); | 168 | return session; |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | void SM::RegisterService(Kernel::HLERequestContext& ctx) { | 171 | void SM::RegisterService(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp index ed4c06260..10f7d1461 100644 --- a/src/core/hle/service/spl/spl_module.cpp +++ b/src/core/hle/service/spl/spl_module.cpp | |||
| @@ -120,40 +120,40 @@ ResultVal<u64> Module::Interface::GetConfigImpl(ConfigItem config_item) const { | |||
| 120 | return ResultSecureMonitorNotImplemented; | 120 | return ResultSecureMonitorNotImplemented; |
| 121 | case ConfigItem::ExosphereApiVersion: | 121 | case ConfigItem::ExosphereApiVersion: |
| 122 | // Get information about the current exosphere version. | 122 | // Get information about the current exosphere version. |
| 123 | return MakeResult((u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MAJOR} << 56) | | 123 | return (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MAJOR} << 56) | |
| 124 | (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MINOR} << 48) | | 124 | (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MINOR} << 48) | |
| 125 | (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MICRO} << 40) | | 125 | (u64{HLE::ApiVersion::ATMOSPHERE_RELEASE_VERSION_MICRO} << 40) | |
| 126 | (static_cast<u64>(HLE::ApiVersion::GetTargetFirmware()))); | 126 | (static_cast<u64>(HLE::ApiVersion::GetTargetFirmware())); |
| 127 | case ConfigItem::ExosphereNeedsReboot: | 127 | case ConfigItem::ExosphereNeedsReboot: |
| 128 | // We are executing, so we aren't in the process of rebooting. | 128 | // We are executing, so we aren't in the process of rebooting. |
| 129 | return MakeResult(u64{0}); | 129 | return u64{0}; |
| 130 | case ConfigItem::ExosphereNeedsShutdown: | 130 | case ConfigItem::ExosphereNeedsShutdown: |
| 131 | // We are executing, so we aren't in the process of shutting down. | 131 | // We are executing, so we aren't in the process of shutting down. |
| 132 | return MakeResult(u64{0}); | 132 | return u64{0}; |
| 133 | case ConfigItem::ExosphereGitCommitHash: | 133 | case ConfigItem::ExosphereGitCommitHash: |
| 134 | // Get information about the current exosphere git commit hash. | 134 | // Get information about the current exosphere git commit hash. |
| 135 | return MakeResult(u64{0}); | 135 | return u64{0}; |
| 136 | case ConfigItem::ExosphereHasRcmBugPatch: | 136 | case ConfigItem::ExosphereHasRcmBugPatch: |
| 137 | // Get information about whether this unit has the RCM bug patched. | 137 | // Get information about whether this unit has the RCM bug patched. |
| 138 | return MakeResult(u64{0}); | 138 | return u64{0}; |
| 139 | case ConfigItem::ExosphereBlankProdInfo: | 139 | case ConfigItem::ExosphereBlankProdInfo: |
| 140 | // Get whether this unit should simulate a "blanked" PRODINFO. | 140 | // Get whether this unit should simulate a "blanked" PRODINFO. |
| 141 | return MakeResult(u64{0}); | 141 | return u64{0}; |
| 142 | case ConfigItem::ExosphereAllowCalWrites: | 142 | case ConfigItem::ExosphereAllowCalWrites: |
| 143 | // Get whether this unit should allow writing to the calibration partition. | 143 | // Get whether this unit should allow writing to the calibration partition. |
| 144 | return MakeResult(u64{0}); | 144 | return u64{0}; |
| 145 | case ConfigItem::ExosphereEmummcType: | 145 | case ConfigItem::ExosphereEmummcType: |
| 146 | // Get what kind of emummc this unit has active. | 146 | // Get what kind of emummc this unit has active. |
| 147 | return MakeResult(u64{0}); | 147 | return u64{0}; |
| 148 | case ConfigItem::ExospherePayloadAddress: | 148 | case ConfigItem::ExospherePayloadAddress: |
| 149 | // Gets the physical address of the reboot payload buffer, if one exists. | 149 | // Gets the physical address of the reboot payload buffer, if one exists. |
| 150 | return ResultSecureMonitorNotInitialized; | 150 | return ResultSecureMonitorNotInitialized; |
| 151 | case ConfigItem::ExosphereLogConfiguration: | 151 | case ConfigItem::ExosphereLogConfiguration: |
| 152 | // Get the log configuration. | 152 | // Get the log configuration. |
| 153 | return MakeResult(u64{0}); | 153 | return u64{0}; |
| 154 | case ConfigItem::ExosphereForceEnableUsb30: | 154 | case ConfigItem::ExosphereForceEnableUsb30: |
| 155 | // Get whether usb 3.0 should be force-enabled. | 155 | // Get whether usb 3.0 should be force-enabled. |
| 156 | return MakeResult(u64{0}); | 156 | return u64{0}; |
| 157 | default: | 157 | default: |
| 158 | return ResultSecureMonitorInvalidArgument; | 158 | return ResultSecureMonitorInvalidArgument; |
| 159 | } | 159 | } |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 439e7e472..760b528b9 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -1284,15 +1284,15 @@ private: | |||
| 1284 | static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) { | 1284 | static ResultVal<ConvertedScaleMode> ConvertScalingModeImpl(NintendoScaleMode mode) { |
| 1285 | switch (mode) { | 1285 | switch (mode) { |
| 1286 | case NintendoScaleMode::None: | 1286 | case NintendoScaleMode::None: |
| 1287 | return MakeResult(ConvertedScaleMode::None); | 1287 | return ConvertedScaleMode::None; |
| 1288 | case NintendoScaleMode::Freeze: | 1288 | case NintendoScaleMode::Freeze: |
| 1289 | return MakeResult(ConvertedScaleMode::Freeze); | 1289 | return ConvertedScaleMode::Freeze; |
| 1290 | case NintendoScaleMode::ScaleToWindow: | 1290 | case NintendoScaleMode::ScaleToWindow: |
| 1291 | return MakeResult(ConvertedScaleMode::ScaleToWindow); | 1291 | return ConvertedScaleMode::ScaleToWindow; |
| 1292 | case NintendoScaleMode::ScaleAndCrop: | 1292 | case NintendoScaleMode::ScaleAndCrop: |
| 1293 | return MakeResult(ConvertedScaleMode::ScaleAndCrop); | 1293 | return ConvertedScaleMode::ScaleAndCrop; |
| 1294 | case NintendoScaleMode::PreserveAspectRatio: | 1294 | case NintendoScaleMode::PreserveAspectRatio: |
| 1295 | return MakeResult(ConvertedScaleMode::PreserveAspectRatio); | 1295 | return ConvertedScaleMode::PreserveAspectRatio; |
| 1296 | default: | 1296 | default: |
| 1297 | LOG_ERROR(Service_VI, "Invalid scaling mode specified, mode={}", mode); | 1297 | LOG_ERROR(Service_VI, "Invalid scaling mode specified, mode={}", mode); |
| 1298 | return ERR_OPERATION_FAILED; | 1298 | return ERR_OPERATION_FAILED; |