ams: replace most remaining operator & with std::addressof
This commit is contained in:
@@ -78,10 +78,10 @@ namespace ams::emummc {
|
||||
struct {
|
||||
char file_path[MaxDirLen + 1];
|
||||
char nintendo_path[MaxDirLen + 1];
|
||||
} *paths = reinterpret_cast<decltype(paths)>(&path_storage);
|
||||
} *paths = reinterpret_cast<decltype(paths)>(std::addressof(path_storage));
|
||||
|
||||
/* Retrieve paths from secure monitor. */
|
||||
AMS_ABORT_UNLESS(spl::smc::AtmosphereGetEmummcConfig(&g_exo_config, paths, 0) == spl::smc::Result::Success);
|
||||
AMS_ABORT_UNLESS(spl::smc::AtmosphereGetEmummcConfig(std::addressof(g_exo_config), paths, 0) == spl::smc::Result::Success);
|
||||
|
||||
const Storage storage = static_cast<Storage>(g_exo_config.base_cfg.type);
|
||||
g_is_emummc = g_exo_config.base_cfg.magic == StorageMagic && storage != Storage_Emmc;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace ams {
|
||||
svc::lp64::MemoryInfo mem_info;
|
||||
svc::PageInfo page_info;
|
||||
if (R_SUCCEEDED(svc::QueryMemory(std::addressof(mem_info), std::addressof(page_info), cur_fp)) && (mem_info.permission & svc::MemoryPermission_Read) == svc::MemoryPermission_Read) {
|
||||
std::memcpy(&cur_frame, reinterpret_cast<void *>(cur_fp), sizeof(cur_frame));
|
||||
std::memcpy(std::addressof(cur_frame), reinterpret_cast<void *>(cur_fp), sizeof(cur_frame));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace ams {
|
||||
}
|
||||
|
||||
/* Just call the user exception handler. */
|
||||
::ams::ExceptionHandler(&ams_ctx);
|
||||
::ams::ExceptionHandler(std::addressof(ams_ctx));
|
||||
}
|
||||
|
||||
NORETURN void AbortImpl();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ams::exosphere {
|
||||
|
||||
ApiInfo GetApiInfo() {
|
||||
u64 exosphere_cfg;
|
||||
if (spl::smc::GetConfig(&exosphere_cfg, 1, spl::ConfigItem::ExosphereApiVersion) != spl::smc::Result::Success) {
|
||||
if (spl::smc::GetConfig(std::addressof(exosphere_cfg), 1, spl::ConfigItem::ExosphereApiVersion) != spl::smc::Result::Success) {
|
||||
R_ABORT_UNLESS(ResultNotPresent());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user