Fix shadowing variables in labmdas

GCC generates warnings about these, although the variable being shadowed is not captured by the lambda.
This commit is contained in:
Pokechu22
2022-01-16 21:30:53 -08:00
parent 0e23dfbb25
commit a6d516dc94
2 changed files with 18 additions and 16 deletions

View File

@ -1747,18 +1747,20 @@ bool NetPlayClient::StartGame(const std::string& path)
// boot game // boot game
auto boot_session_data = std::make_unique<BootSessionData>(); auto boot_session_data = std::make_unique<BootSessionData>();
boot_session_data->SetWiiSyncData( boot_session_data->SetWiiSyncData(std::move(m_wii_sync_fs), std::move(m_wii_sync_titles),
std::move(m_wii_sync_fs), std::move(m_wii_sync_titles), std::move(m_wii_sync_redirect_folder), std::move(m_wii_sync_redirect_folder), [] {
[] { // on emulation end clean up the Wii save sync directory --
// on emulation end clean up the Wii save sync directory -- see OnSyncSaveDataWii() // see OnSyncSaveDataWii()
const std::string path = File::GetUserPath(D_USER_IDX) + "Wii" GC_MEMCARD_NETPLAY DIR_SEP; const std::string wii_path = File::GetUserPath(D_USER_IDX) +
if (File::Exists(path)) "Wii" GC_MEMCARD_NETPLAY DIR_SEP;
File::DeleteDirRecursively(path); if (File::Exists(wii_path))
const std::string redirect_path = File::DeleteDirRecursively(wii_path);
File::GetUserPath(D_USER_IDX) + "Redirect" GC_MEMCARD_NETPLAY DIR_SEP; const std::string redirect_path =
if (File::Exists(redirect_path)) File::GetUserPath(D_USER_IDX) +
File::DeleteDirRecursively(redirect_path); "Redirect" GC_MEMCARD_NETPLAY DIR_SEP;
}); if (File::Exists(redirect_path))
File::DeleteDirRecursively(redirect_path);
});
m_dialog->BootGame(path, std::move(boot_session_data)); m_dialog->BootGame(path, std::move(boot_session_data));
UpdateDevices(); UpdateDevices();

View File

@ -207,10 +207,10 @@ void RiivolutionBootWidget::MakeGUIForParsedFile(std::string path, std::string r
connect(selection, qOverload<int>(&QComboBox::currentIndexChanged), this, connect(selection, qOverload<int>(&QComboBox::currentIndexChanged), this,
[this, selection](int idx) { [this, selection](int idx) {
const auto gui_index = selection->currentData().value<GuiRiivolutionPatchIndex>(); const auto gui_index = selection->currentData().value<GuiRiivolutionPatchIndex>();
auto& disc = m_discs[gui_index.m_disc_index].disc; auto& selected_disc = m_discs[gui_index.m_disc_index].disc;
auto& section = disc.m_sections[gui_index.m_section_index]; auto& selected_section = selected_disc.m_sections[gui_index.m_section_index];
auto& option = section.m_options[gui_index.m_option_index]; auto& selected_option = selected_section.m_options[gui_index.m_option_index];
option.m_selected_choice = static_cast<u32>(gui_index.m_choice_index); selected_option.m_selected_choice = static_cast<u32>(gui_index.m_choice_index);
}); });
grid_layout->addWidget(label, row, 0, 1, 1); grid_layout->addWidget(label, row, 0, 1, 1);