From d87fee05a9e18b04688006291021e03f3c8eb6eb Mon Sep 17 00:00:00 2001 From: Vitor Kiguchi Date: Fri, 24 Jul 2020 00:34:43 -0300 Subject: [PATCH] Resolve some variable hiding warnings (C4456: variable hides previous local declaration) --- src/citra_qt/camera/camera_util.cpp | 6 +++--- src/citra_qt/debugger/ipc/recorder.cpp | 6 +++--- src/citra_qt/debugger/wait_tree.cpp | 6 +++--- src/citra_qt/main.cpp | 1 - src/citra_qt/multiplayer/state.cpp | 5 ++--- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/citra_qt/camera/camera_util.cpp b/src/citra_qt/camera/camera_util.cpp index 8e67ca452..878ac910c 100644 --- a/src/citra_qt/camera/camera_util.cpp +++ b/src/citra_qt/camera/camera_util.cpp @@ -175,9 +175,9 @@ std::vector Rgb2Yuv(const QImage& source, int width, int height) { auto dest = buffer.begin(); bool write = false; int py, pu, pv; - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - QRgb rgb = source.pixel(x, y); + for (int j = 0; j < height; ++j) { + for (int i = 0; i < width; ++i) { + QRgb rgb = source.pixel(i, j); int r = qRed(rgb); int g = qGreen(rgb); int b = qBlue(rgb); diff --git a/src/citra_qt/debugger/ipc/recorder.cpp b/src/citra_qt/debugger/ipc/recorder.cpp index 4226e74fe..b4ed84ad0 100644 --- a/src/citra_qt/debugger/ipc/recorder.cpp +++ b/src/citra_qt/debugger/ipc/recorder.cpp @@ -73,16 +73,16 @@ void IPCRecorderWidget::OnEntryUpdated(IPCDebugger::RequestRecord record) { 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)}}; const int row_id = record.id - id_offset; if (ui->main->invisibleRootItem()->childCount() > row_id) { records[row_id] = record; - (*ui->main->invisibleRootItem()->child(row_id)) = item; + (*ui->main->invisibleRootItem()->child(row_id)) = entry; } else { records.emplace_back(record); - ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(item)); + ui->main->invisibleRootItem()->addChild(new QTreeWidgetItem(entry)); } if (record.status == IPCDebugger::RequestStatus::HLEUnimplemented || diff --git a/src/citra_qt/debugger/wait_tree.cpp b/src/citra_qt/debugger/wait_tree.cpp index 907c5f6bb..d46d99758 100644 --- a/src/citra_qt/debugger/wait_tree.cpp +++ b/src/citra_qt/debugger/wait_tree.cpp @@ -83,9 +83,9 @@ std::vector> WaitTreeItem::MakeThreadItemList() const auto& threads = Core::System::GetInstance().Kernel().GetThreadManager(i).GetThreadList(); item_list.reserve(item_list.size() + threads.size()); - for (std::size_t i = 0; i < threads.size(); ++i) { - item_list.push_back(std::make_unique(*threads[i])); - item_list.back()->row = i; + for (std::size_t j = 0; j < threads.size(); ++j) { + item_list.push_back(std::make_unique(*threads[j])); + item_list.back()->row = j; } } return item_list; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index a804bfb98..1c1374349 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1454,7 +1454,6 @@ void GMainWindow::InstallCIA(QStringList filepaths) { progress_bar->setMaximum(INT_MAX); QtConcurrent::run([&, filepaths] { - QString current_path; Service::AM::InstallStatus status; const auto cia_progress = [&](std::size_t written, std::size_t total) { emit UpdateProgress(written, total); diff --git a/src/citra_qt/multiplayer/state.cpp b/src/citra_qt/multiplayer/state.cpp index 6fa6d1809..28f884a12 100644 --- a/src/citra_qt/multiplayer/state.cpp +++ b/src/citra_qt/multiplayer/state.cpp @@ -232,9 +232,8 @@ bool MultiplayerState::OnCloseRoom() { return true; } // 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(); announce_multiplayer_session->Stop(); LOG_DEBUG(Frontend, "Closed the room (as a server)");