diff --git a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp index 476232ace6..96ba9eb7a0 100644 --- a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp @@ -277,7 +277,7 @@ error_code getText(vm::ptr OutputInfo, bool is bool do_copy = OutputInfo->pResultString && (OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK || (is_unload && OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_NO_INPUT_TEXT)); - for (u32 i = 0; i < CELL_OSKDIALOG_STRING_SIZE - 1; i++) + for (s32 i = 0; i < CELL_OSKDIALOG_STRING_SIZE - 1; i++) { osk->osk_text_old[i] = osk->osk_text[i]; diff --git a/rpcs3/Emu/GameInfo.h b/rpcs3/Emu/GameInfo.h index d7b26c8874..8c23891508 100644 --- a/rpcs3/Emu/GameInfo.h +++ b/rpcs3/Emu/GameInfo.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once struct GameInfo { @@ -11,11 +11,11 @@ struct GameInfo std::string category; std::string fw; - u32 attr; - u32 bootable; - u32 parental_lvl; - u32 sound_format; - u32 resolution; + u32 attr = 0; + u32 bootable = 0; + u32 parental_lvl = 0; + u32 sound_format = 0; + u32 resolution = 0; GameInfo() { diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index a1d57aa8ca..01d710a4b5 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -175,7 +175,7 @@ struct Pad // Cable State: 0 - 1 plugged in ? u8 m_cable_state; - // DS4: 0 - 9 while unplugged, 0 - 10 while plugged in, 11 charge complete + // DS4: 0 - 9 while unplugged, 0 - 10 while plugged in, 11 charge complete // XInput: 0 = Empty, 1 = Low, 2 = Medium, 3 = Full u8 m_battery_level; @@ -227,6 +227,9 @@ struct Pad , m_port_status(port_status) , m_device_capability(device_capability) , m_device_type(device_type) + , m_class_type(0) + , m_cable_state(0) + , m_battery_level(0) , m_digital_1(0) , m_digital_2(0) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp index d55e9ff41f..e37974ba25 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_perf_metrics.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "overlays.h" #include "../GSRender.h" @@ -19,7 +19,7 @@ namespace rsx } unsigned long hexval; - const int len = hex_color.length(); + const size_t len = hex_color.length(); try { diff --git a/rpcs3/ds4_pad_handler.cpp b/rpcs3/ds4_pad_handler.cpp index 6c5d8796ad..6c1e1f6cb4 100644 --- a/rpcs3/ds4_pad_handler.cpp +++ b/rpcs3/ds4_pad_handler.cpp @@ -1,4 +1,4 @@ -#include "ds4_pad_handler.h" +#include "ds4_pad_handler.h" #include @@ -494,7 +494,7 @@ void ds4_pad_handler::ProcessDataToPad(const std::shared_ptr& device, #endif // used to get the absolute value of an axis - s32 stick_val[4]; + s32 stick_val[4]{0}; // Translate any corresponding keycodes to our two sticks. (ignoring thresholds for now) for (int i = 0; i < static_cast(pad->m_sticks.size()); i++) diff --git a/rpcs3/mm_joystick_handler.cpp b/rpcs3/mm_joystick_handler.cpp index 483ffbf3f6..88c1fcca09 100644 --- a/rpcs3/mm_joystick_handler.cpp +++ b/rpcs3/mm_joystick_handler.cpp @@ -1,4 +1,4 @@ -#ifdef _WIN32 +#ifdef _WIN32 #include "mm_joystick_handler.h" mm_joystick_handler::mm_joystick_handler() : PadHandlerBase(pad_handler::mm) @@ -244,7 +244,7 @@ void mm_joystick_handler::ThreadProc() TranslateButtonPress(btn.m_keyCode, btn.m_pressed, btn.m_value); } - s32 stick_val[4]; + s32 stick_val[4]{0}; // Translate any corresponding keycodes to our two sticks. (ignoring thresholds for now) for (int i = 0; i < static_cast(pad->m_sticks.size()); i++) diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index f130f1130f..287f7b8aab 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -310,5 +310,5 @@ private: QSize m_Icon_Size = gui::gl_icon_size_min; // ensure a valid size qreal m_Margin_Factor; qreal m_Text_Factor; - bool m_drawCompatStatusToGrid; + bool m_drawCompatStatusToGrid = false; }; diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index bbb57e8766..daaac4c4ff 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1417,7 +1417,7 @@ void main_window::CreateConnects() connect(m_categoryVisibleActGroup, &QActionGroup::triggered, [=](QAction* act) { QStringList categories; - int id; + int id = 0; const bool& checked = act->isChecked(); if (act == ui->showCatHDDGameAct) categories += category::hdd_game, id = Category::HDD_Game; @@ -1432,8 +1432,11 @@ void main_window::CreateConnects() else if (act == ui->showCatOtherAct) categories += category::others, id = Category::Others; else LOG_WARNING(GENERAL, "categoryVisibleActGroup: category action not found"); - m_gameListFrame->ToggleCategoryFilter(categories, checked); - guiSettings->SetCategoryVisibility(id, checked); + if (!categories.isEmpty()) + { + m_gameListFrame->ToggleCategoryFilter(categories, checked); + guiSettings->SetCategoryVisibility(id, checked); + } }); connect(ui->aboutAct, &QAction::triggered, [this] diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index c2ef26de03..51f86298e1 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -29,7 +29,7 @@ class main_window : public QMainWindow Ui::main_window *ui; - bool m_sys_menu_opened; + bool m_sys_menu_opened = false; bool m_is_list_mode = true; bool m_save_slider_pos = false; int m_other_slider_pos = 0; @@ -130,17 +130,17 @@ private: q_pair_list m_rg_entries; QList m_recentGameActs; - QActionGroup* m_iconSizeActGroup; - QActionGroup* m_listModeActGroup; - QActionGroup* m_categoryVisibleActGroup; + QActionGroup* m_iconSizeActGroup = nullptr; + QActionGroup* m_listModeActGroup = nullptr; + QActionGroup* m_categoryVisibleActGroup = nullptr; QMessageBox::StandardButton m_install_bulk = QMessageBox::NoButton; // Dockable widget frames - QMainWindow *m_mw; - log_frame *m_logFrame; - debugger_frame *m_debuggerFrame; - game_list_frame *m_gameListFrame; + QMainWindow *m_mw = nullptr; + log_frame* m_logFrame = nullptr; + debugger_frame* m_debuggerFrame = nullptr; + game_list_frame* m_gameListFrame = nullptr; std::shared_ptr guiSettings; std::shared_ptr emuSettings; }; diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.cpp b/rpcs3/rpcs3qt/pad_settings_dialog.cpp index df19f5092d..5a3a9234a5 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.cpp +++ b/rpcs3/rpcs3qt/pad_settings_dialog.cpp @@ -416,7 +416,7 @@ void pad_settings_dialog::InitButtons() continue; } const pad_info info = ui->chooseDevice->itemData(i).value(); - m_handler->GetNextButtonPress(info.name, [=](u16 val, std::string name, std::string pad_name, int preview_values[6]) { SwitchPadInfo(pad_name, true); }, [=](std::string pad_name) { SwitchPadInfo(pad_name, false); }, false); + m_handler->GetNextButtonPress(info.name, [=](u16, std::string, std::string pad_name, int[6]) { SwitchPadInfo(pad_name, true); }, [=](std::string pad_name) { SwitchPadInfo(pad_name, false); }, false); } }); } @@ -670,7 +670,7 @@ void pad_settings_dialog::mouseReleaseEvent(QMouseEvent* event) ReactivateButtons(); } -void pad_settings_dialog::mouseMoveEvent(QMouseEvent* event) +void pad_settings_dialog::mouseMoveEvent(QMouseEvent*/* event*/) { if (m_handler->m_type != pad_handler::keyboard) { @@ -960,7 +960,7 @@ void pad_settings_dialog::ChangeInputType() continue; } const pad_info info = ui->chooseDevice->itemData(i).value(); - m_handler->GetNextButtonPress(info.name, [=](u16 val, std::string name, std::string pad_name, int preview_values[6]) { SwitchPadInfo(pad_name, true); }, [=](std::string pad_name) { SwitchPadInfo(pad_name, false); }, false); + m_handler->GetNextButtonPress(info.name, [=](u16, std::string, std::string pad_name, int[6]) { SwitchPadInfo(pad_name, true); }, [=](std::string pad_name) { SwitchPadInfo(pad_name, false); }, false); if (info.name == device) { ui->chooseDevice->setCurrentIndex(i); diff --git a/rpcs3/rpcs3qt/pad_settings_dialog.h b/rpcs3/rpcs3qt/pad_settings_dialog.h index 0541b7589d..1504619694 100644 --- a/rpcs3/rpcs3qt/pad_settings_dialog.h +++ b/rpcs3/rpcs3qt/pad_settings_dialog.h @@ -18,7 +18,7 @@ namespace Ui struct pad_info { std::string name; - bool is_connected; + bool is_connected{false}; }; Q_DECLARE_METATYPE(pad_info); @@ -104,7 +104,7 @@ private: std::string m_title_id; // TabWidget - QTabWidget* m_tabs; + QTabWidget* m_tabs = nullptr; // Capabilities bool m_enable_buttons{ false }; @@ -113,7 +113,7 @@ private: bool m_enable_led{ false }; // Button Mapping - QButtonGroup* m_padButtons; + QButtonGroup* m_padButtons = nullptr; u32 m_button_id = id_pad_begin; std::map m_cfg_entries; @@ -124,8 +124,8 @@ private: int ry = 0; // Rumble - s32 m_min_force; - s32 m_max_force; + s32 m_min_force = 0; + s32 m_max_force = 0; // Backup for standard button palette QPalette m_palette; diff --git a/rpcs3/rpcs3qt/rsx_debugger.cpp b/rpcs3/rpcs3qt/rsx_debugger.cpp index be52339d2b..1ffe387606 100644 --- a/rpcs3/rpcs3qt/rsx_debugger.cpp +++ b/rpcs3/rpcs3qt/rsx_debugger.cpp @@ -1,4 +1,4 @@ - + #include "rsx_debugger.h" #include "qt_utils.h" @@ -633,7 +633,7 @@ void rsx_debugger::GetMemory() int item_count = m_list_commands->rowCount(); // Write information - for(u32 i=0, addr = m_addr; i < item_count; i++, addr += 4) + for (int i = 0, addr = m_addr; i < item_count; i++, addr += 4) { QTableWidgetItem* address_item = new QTableWidgetItem(qstr(fmt::format("%07x", addr))); address_item->setData(Qt::UserRole, addr); diff --git a/rpcs3/xinput_pad_handler.cpp b/rpcs3/xinput_pad_handler.cpp index 03704933b4..0436066e94 100644 --- a/rpcs3/xinput_pad_handler.cpp +++ b/rpcs3/xinput_pad_handler.cpp @@ -1,4 +1,4 @@ - + #ifdef _WIN32 #include "xinput_pad_handler.h" @@ -369,7 +369,7 @@ void xinput_pad_handler::ThreadProc() } // used to get the absolute value of an axis - s32 stick_val[4]; + s32 stick_val[4]{0}; // Translate any corresponding keycodes to our two sticks. (ignoring thresholds for now) for (int i = 0; i < static_cast(pad->m_sticks.size()); i++)