From 0c5b91e1fb4b016667c660ea3de55f1d0cc5c80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=A5IGA?= <164882787+Xphalnos@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:38:55 +0200 Subject: [PATCH] Warnings fixes (#541) * Warnings fixes * Warnings fixes --- src/qt_gui/elf_viewer.cpp | 2 -- src/qt_gui/elf_viewer.h | 10 ------- src/qt_gui/game_grid_frame.h | 10 ------- src/qt_gui/game_info.cpp | 3 -- src/qt_gui/game_info.h | 6 ++-- src/qt_gui/game_list_frame.h | 12 -------- src/qt_gui/game_list_utils.h | 5 ---- src/qt_gui/gui_context_menus.h | 12 ++------ src/qt_gui/main.cpp | 7 ++--- src/qt_gui/main_window.cpp | 5 ---- src/qt_gui/main_window.h | 5 ---- src/qt_gui/main_window_ui.h | 30 ++++---------------- src/qt_gui/pkg_viewer.cpp | 5 +--- src/qt_gui/pkg_viewer.h | 9 ------ src/qt_gui/settings_dialog.cpp | 3 +- src/qt_gui/trophy_viewer.h | 2 -- src/video_core/texture_cache/texture_cache.h | 2 +- 17 files changed, 15 insertions(+), 113 deletions(-) diff --git a/src/qt_gui/elf_viewer.cpp b/src/qt_gui/elf_viewer.cpp index 72861d15..e80fa25c 100644 --- a/src/qt_gui/elf_viewer.cpp +++ b/src/qt_gui/elf_viewer.cpp @@ -1,8 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include - #include "elf_viewer.h" ElfViewer::ElfViewer(QWidget* parent) : QTableWidget(parent) { diff --git a/src/qt_gui/elf_viewer.h b/src/qt_gui/elf_viewer.h index a3b85223..1a65d70d 100644 --- a/src/qt_gui/elf_viewer.h +++ b/src/qt_gui/elf_viewer.h @@ -3,17 +3,7 @@ #pragma once -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include "core/loader/elf.h" #include "game_list_frame.h" diff --git a/src/qt_gui/game_grid_frame.h b/src/qt_gui/game_grid_frame.h index ce775315..50b53a58 100644 --- a/src/qt_gui/game_grid_frame.h +++ b/src/qt_gui/game_grid_frame.h @@ -3,17 +3,7 @@ #pragma once -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include #include "common/config.h" #include "game_info.h" diff --git a/src/qt_gui/game_info.cpp b/src/qt_gui/game_info.cpp index 0a472eae..d2bf3bb2 100644 --- a/src/qt_gui/game_info.cpp +++ b/src/qt_gui/game_info.cpp @@ -1,10 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include #include -#include #include "game_info.h" diff --git a/src/qt_gui/game_info.h b/src/qt_gui/game_info.h index b2b102e0..ae02114a 100644 --- a/src/qt_gui/game_info.h +++ b/src/qt_gui/game_info.h @@ -3,10 +3,8 @@ #pragma once -#include -#include -#include -#include +#include +#include #include "common/config.h" #include "core/file_format/psf.h" diff --git a/src/qt_gui/game_list_frame.h b/src/qt_gui/game_list_frame.h index d8bccf46..ab70e6f6 100644 --- a/src/qt_gui/game_list_frame.h +++ b/src/qt_gui/game_list_frame.h @@ -3,19 +3,7 @@ #pragma once -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include #include "game_info.h" #include "game_list_utils.h" diff --git a/src/qt_gui/game_list_utils.h b/src/qt_gui/game_list_utils.h index 2e25f122..8f934388 100644 --- a/src/qt_gui/game_list_utils.h +++ b/src/qt_gui/game_list_utils.h @@ -3,11 +3,6 @@ #pragma once -#include -#include -#include -#include - struct GameInfo { std::string path; // root path of game directory (normaly directory that contains eboot.bin) std::string icon_path; // path of icon0.png diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 2f4b884c..16afdb18 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -4,17 +4,9 @@ #pragma once #include -#include #include -#include -#include -#include #include #include -#include -#include -#include -#include #include #include @@ -84,7 +76,7 @@ public: QTableWidget* tableWidget = new QTableWidget(rows, 2); tableWidget->setAttribute(Qt::WA_DeleteOnClose); connect(widget->parent(), &QWidget::destroyed, tableWidget, - [widget, tableWidget]() { tableWidget->deleteLater(); }); + [tableWidget]() { tableWidget->deleteLater(); }); tableWidget->verticalHeader()->setVisible(false); // Hide vertical header int row = 0; @@ -135,7 +127,7 @@ public: TrophyViewer* trophyViewer = new TrophyViewer(trophyPath, gameTrpPath); trophyViewer->show(); connect(widget->parent(), &QWidget::destroyed, trophyViewer, - [widget, trophyViewer]() { trophyViewer->deleteLater(); }); + [trophyViewer]() { trophyViewer->deleteLater(); }); } if (selected == &createShortcut) { diff --git a/src/qt_gui/main.cpp b/src/qt_gui/main.cpp index cff01cc2..02957c6d 100644 --- a/src/qt_gui/main.cpp +++ b/src/qt_gui/main.cpp @@ -1,14 +1,11 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include - #include "common/config.h" #include "core/file_sys/fs.h" #include "emulator.h" -#include "qt_gui/game_install_dialog.h" -#include "qt_gui/main_window.h" +#include "game_install_dialog.h" +#include "main_window.h" // Custom message handler to ignore Qt logs void customMessageHandler(QtMsgType, const QMessageLogContext&, const QString&) {} diff --git a/src/qt_gui/main_window.cpp b/src/qt_gui/main_window.cpp index 34ef0d86..b6711d71 100644 --- a/src/qt_gui/main_window.cpp +++ b/src/qt_gui/main_window.cpp @@ -1,13 +1,8 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include #include -#include -#include #include -#include -#include #include "about_dialog.h" #include "common/io_file.h" diff --git a/src/qt_gui/main_window.h b/src/qt_gui/main_window.h index 24de15b9..1abe1762 100644 --- a/src/qt_gui/main_window.h +++ b/src/qt_gui/main_window.h @@ -3,13 +3,8 @@ #pragma once -#include #include #include -#include -#include -#include -#include #include "common/config.h" #include "common/path_util.h" diff --git a/src/qt_gui/main_window_ui.h b/src/qt_gui/main_window_ui.h index 7d0c58dd..1a2a560e 100644 --- a/src/qt_gui/main_window_ui.h +++ b/src/qt_gui/main_window_ui.h @@ -1,29 +1,11 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -/******************************************************************************** -** Form generated from reading UI file 'main_window.ui' -** -** Created by: Qt User Interface Compiler version 6.6.1 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ +#pragma once -#ifndef MAIN_WINDOW_UI_H -#define MAIN_WINDOW_UI_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include QT_BEGIN_NAMESPACE @@ -369,6 +351,4 @@ namespace Ui { class MainWindow : public Ui_MainWindow {}; } // namespace Ui -QT_END_NAMESPACE - -#endif // MAIN_WINDOW_UI_H +QT_END_NAMESPACE \ No newline at end of file diff --git a/src/qt_gui/pkg_viewer.cpp b/src/qt_gui/pkg_viewer.cpp index cd2ce2b6..49005c72 100644 --- a/src/qt_gui/pkg_viewer.cpp +++ b/src/qt_gui/pkg_viewer.cpp @@ -1,9 +1,6 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include -#include - #include "pkg_viewer.h" PKGViewer::PKGViewer(std::shared_ptr game_info_get, QWidget* parent, @@ -54,7 +51,7 @@ PKGViewer::PKGViewer(std::shared_ptr game_info_get, QWidget* pare InstallDragDropPkg); }); - connect(parent, &QWidget::destroyed, this, [parent, this]() { this->deleteLater(); }); + connect(parent, &QWidget::destroyed, this, [this]() { this->deleteLater(); }); } PKGViewer::~PKGViewer() {} diff --git a/src/qt_gui/pkg_viewer.h b/src/qt_gui/pkg_viewer.h index e040d595..9598328a 100644 --- a/src/qt_gui/pkg_viewer.h +++ b/src/qt_gui/pkg_viewer.h @@ -3,18 +3,9 @@ #pragma once -#include -#include -#include -#include #include -#include -#include #include #include -#include -#include -#include #include "common/io_file.h" #include "core/file_format/pkg.h" diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index aa2c7338..09247951 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include + #include "settings_dialog.h" #include "ui_settings_dialog.h" @@ -86,7 +87,7 @@ SettingsDialog::SettingsDialog(std::span physical_devices, QWidge [](const QString& text) { Config::setUserName(text.toStdString()); }); connect(ui->consoleLanguageComboBox, QOverload::of(&QComboBox::currentIndexChanged), - this, [this](int index) { + this, [](int index) { if (index >= 0 && index < languageIndexes.size()) { int languageCode = languageIndexes[index]; Config::setLanguage(languageCode); diff --git a/src/qt_gui/trophy_viewer.h b/src/qt_gui/trophy_viewer.h index 2b794593..81b9b1ad 100644 --- a/src/qt_gui/trophy_viewer.h +++ b/src/qt_gui/trophy_viewer.h @@ -10,11 +10,9 @@ #include #include #include -#include #include #include #include -#include #include #include "common/types.h" diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 137b6014..7266d7a5 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -124,7 +124,7 @@ private: using FuncReturn = typename std::invoke_result::type; static constexpr bool BOOL_BREAK = std::is_same_v; boost::container::small_vector images; - ForEachPage(cpu_addr, size, [this, &images, cpu_addr, size, func](u64 page) { + ForEachPage(cpu_addr, size, [this, &images, func](u64 page) { const auto it = page_table.find(page); if (it == nullptr) { if constexpr (BOOL_BREAK) {