Resolve some variable hiding warnings

(C4456: variable hides previous local declaration)
This commit is contained in:
Vitor Kiguchi 2020-07-24 00:34:43 -03:00
parent e331fac004
commit d87fee05a9
5 changed files with 11 additions and 13 deletions

View File

@ -175,9 +175,9 @@ std::vector<u16> Rgb2Yuv(const QImage& source, int width, int height) {
auto dest = buffer.begin(); auto dest = buffer.begin();
bool write = false; bool write = false;
int py, pu, pv; int py, pu, pv;
for (int y = 0; y < height; ++y) { for (int j = 0; j < height; ++j) {
for (int x = 0; x < width; ++x) { for (int i = 0; i < width; ++i) {
QRgb rgb = source.pixel(x, y); QRgb rgb = source.pixel(i, j);
int r = qRed(rgb); int r = qRed(rgb);
int g = qGreen(rgb); int g = qGreen(rgb);
int b = qBlue(rgb); int b = qBlue(rgb);

View File

@ -73,16 +73,16 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) {
service = QStringLiteral("%1 (%2)").arg(service, record.is_hle ? tr("HLE") : tr("LLE")); service = QStringLiteral("%1 (%2)").arg(service, record.is_hle ? tr("HLE") : tr("LLE"));
} }
QTreeWidgetItem item{ QTreeWidgetItem entry{
{QString::number(record.id), GetStatusStr(record), service, GetFunctionName(record)}}; {QString::number(record.id), GetStatusStr(record), service, GetFunctionName(record)}};
const int row_id = record.id - id_offset; const int row_id = record.id - id_offset;
if (ui->main->invisibleRootItem()->childCount() > row_id) { if (ui->main->invisibleRootItem()->childCount() > row_id) {
records[row_id] = record; records[row_id] = record;
(*ui->main->invisibleRootItem()->child(row_id)) = item; (*ui->main->invisibleRootItem()->child(row_id)) = entry;
} else { } else {
records.emplace_back(record); records.emplace_back(record);
ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(item)); ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(entry));
} }
if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented || if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented ||

View File

@ -83,9 +83,9 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList()
const auto& threads = const auto& threads =
Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList(); Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList();
item_list.reserve(item_list.size() + threads.size()); item_list.reserve(item_list.size() + threads.size());
for (std::size_t i = 0; i < threads.size(); ++i) { for (std::size_t j = 0; j < threads.size(); ++j) {
item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i])); item_list.push_back(std::make_unique<WaitTreeThread>(*threads[j]));
item_list.back()->row = i; item_list.back()->row = j;
} }
} }
return item_list; return item_list;

View File

@ -1454,7 +1454,6 @@ void GMainWindow::InstallCIA(QStringList filepaths) {
progress_bar->setMaximum(INT_MAX); progress_bar->setMaximum(INT_MAX);
QtConcurrent::run([&, filepaths] { QtConcurrent::run([&, filepaths] {
QString current_path;
Service::AM::InstallStatus status; Service::AM::InstallStatus status;
const auto cia_progress = [&](std::size_t written, std::size_t total) { const auto cia_progress = [&](std::size_t written, std::size_t total) {
emit UpdateProgress(written, total); emit UpdateProgress(written, total);

View File

@ -232,9 +232,8 @@ bool MultiplayerState::OnCloseRoom() {
return true; return true;
} }
// Save ban list // Save ban list
if (auto room = Network::GetRoom().lock()) { UISettings::values.ban_list = std::move(room->GetBanList());
UISettings::values.ban_list = std::move(room->GetBanList());
}
room->Destroy(); room->Destroy();
announce_multiplayer_session->Stop(); announce_multiplayer_session->Stop();
LOG_DEBUG(Frontend, "Closed the room (as a server)"); LOG_DEBUG(Frontend, "Closed the room (as a server)");