diff --git a/rpcs3/Emu/Io/MouseHandler.h b/rpcs3/Emu/Io/MouseHandler.h index 77ea3a7824..2222512586 100644 --- a/rpcs3/Emu/Io/MouseHandler.h +++ b/rpcs3/Emu/Io/MouseHandler.h @@ -63,6 +63,7 @@ struct MouseRawData MouseRawData() : len(0) + , data() { } }; @@ -94,11 +95,8 @@ struct MouseTabletData MouseTabletData() : len(0) + , data() { - for (auto d : data) - { - d = 0; - } } }; @@ -116,11 +114,13 @@ struct Mouse MouseRawData m_rawdata; Mouse() - : m_datalist() + : x_pos(0) + , y_pos(0) + , buttons(0) + , m_tablet_datalist() + , m_datalist() , m_rawdata() { - x_pos = 0; - y_pos = 0; } }; diff --git a/rpcs3/Emu/Io/PadHandler.h b/rpcs3/Emu/Io/PadHandler.h index 47589bf302..cca98f5a5c 100644 --- a/rpcs3/Emu/Io/PadHandler.h +++ b/rpcs3/Emu/Io/PadHandler.h @@ -461,7 +461,7 @@ public: PadHandlerBase(pad_handler type = pad_handler::null); virtual ~PadHandlerBase() = default; //Sets window to config the controller(optional) - virtual void GetNextButtonPress(const std::string& /*padId*/, const std::function& /*callback*/, const std::function& /*fail_callback*/, bool /*get_blacklist*/ = false, std::vector /*buttons*/ = {}) {}; + virtual void GetNextButtonPress(const std::string& /*padId*/, const std::function& /*callback*/, const std::function& /*fail_callback*/, bool /*get_blacklist*/ = false, const std::vector& /*buttons*/ = {}) {}; virtual void TestVibration(const std::string& /*padId*/, u32 /*largeMotor*/, u32 /*smallMotor*/) {}; //Return list of devices for that handler virtual std::vector ListDevices() = 0; diff --git a/rpcs3/Emu/RSX/Common/texture_cache_utils.h b/rpcs3/Emu/RSX/Common/texture_cache_utils.h index 363ca365cc..161a490a92 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache_utils.h +++ b/rpcs3/Emu/RSX/Common/texture_cache_utils.h @@ -185,14 +185,14 @@ namespace rsx inline void next() { - idx++; + ++idx; if (idx >= block->size()) { idx = UINT32_MAX; return; } - array_idx++; + ++array_idx; if (array_idx >= array_size) { array_idx = 0; @@ -298,7 +298,7 @@ namespace rsx value_type *dest = &((*m_data_it)[m_array_idx++]); new (dest) value_type(std::forward(args)...); - m_size++; + ++m_size; return *dest; } }; @@ -790,7 +790,7 @@ namespace rsx auto blk_end = block->unowned_end(); if (iterate && unowned_it != blk_end) { - unowned_it++; + ++unowned_it; } if (unowned_it != blk_end) @@ -820,7 +820,7 @@ namespace rsx auto blk_end = block->end(); if (iterate && cur_block_it != blk_end) { - cur_block_it++; + ++cur_block_it; } if (cur_block_it != blk_end) diff --git a/rpcs3/ds4_pad_handler.cpp b/rpcs3/ds4_pad_handler.cpp index b1f3cc18fb..9fd08d07f8 100644 --- a/rpcs3/ds4_pad_handler.cpp +++ b/rpcs3/ds4_pad_handler.cpp @@ -151,7 +151,7 @@ void ds4_pad_handler::init_config(pad_config* cfg, const std::string& name) cfg->from_default(); } -void ds4_pad_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, std::vector buttons) +void ds4_pad_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, const std::vector& buttons) { if (get_blacklist) blacklist.clear(); diff --git a/rpcs3/ds4_pad_handler.h b/rpcs3/ds4_pad_handler.h index d70f12b9a0..c2b1dfc467 100644 --- a/rpcs3/ds4_pad_handler.h +++ b/rpcs3/ds4_pad_handler.h @@ -142,7 +142,7 @@ public: std::vector ListDevices() override; bool bindPadToDevice(std::shared_ptr pad, const std::string& device) override; void ThreadProc() override; - void GetNextButtonPress(const std::string& padId, const std::function& buttonCallback, const std::function& fail_callback, bool get_blacklist = false, std::vector buttons = {}) override; + void GetNextButtonPress(const std::string& padId, const std::function& buttonCallback, const std::function& fail_callback, bool get_blacklist = false, const std::vector& buttons = {}) override; void TestVibration(const std::string& padId, u32 largeMotor, u32 smallMotor) override; void init_config(pad_config* cfg, const std::string& name) override; diff --git a/rpcs3/evdev_joystick_handler.cpp b/rpcs3/evdev_joystick_handler.cpp index f5a32941ae..ca43111564 100644 --- a/rpcs3/evdev_joystick_handler.cpp +++ b/rpcs3/evdev_joystick_handler.cpp @@ -257,7 +257,7 @@ evdev_joystick_handler::EvdevDevice* evdev_joystick_handler::get_device(const st return &dev; } -void evdev_joystick_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, std::vector buttons) +void evdev_joystick_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, const std::vector& buttons) { if (get_blacklist) blacklist.clear(); diff --git a/rpcs3/evdev_joystick_handler.h b/rpcs3/evdev_joystick_handler.h index ac706ce1df..5ab8279f58 100644 --- a/rpcs3/evdev_joystick_handler.h +++ b/rpcs3/evdev_joystick_handler.h @@ -338,7 +338,7 @@ public: bool bindPadToDevice(std::shared_ptr pad, const std::string& device) override; void ThreadProc() override; void Close(); - void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, std::vector buttons = {}) override; + void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, const std::vector& buttons = {}) override; void TestVibration(const std::string& padId, u32 largeMotor, u32 smallMotor) override; private: diff --git a/rpcs3/mm_joystick_handler.cpp b/rpcs3/mm_joystick_handler.cpp index 6a92cfe9d7..81ae930046 100644 --- a/rpcs3/mm_joystick_handler.cpp +++ b/rpcs3/mm_joystick_handler.cpp @@ -283,7 +283,7 @@ void mm_joystick_handler::ThreadProc() } } -void mm_joystick_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, std::vector buttons) +void mm_joystick_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, const std::vector& buttons) { if (get_blacklist) blacklist.clear(); diff --git a/rpcs3/mm_joystick_handler.h b/rpcs3/mm_joystick_handler.h index 82548ba197..7b09989d3d 100644 --- a/rpcs3/mm_joystick_handler.h +++ b/rpcs3/mm_joystick_handler.h @@ -108,7 +108,7 @@ public: std::vector ListDevices() override; bool bindPadToDevice(std::shared_ptr pad, const std::string& device) override; void ThreadProc() override; - void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, std::vector buttons = {}) override; + void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, const std::vector& buttons = {}) override; void init_config(pad_config* cfg, const std::string& name) override; private: diff --git a/rpcs3/rpcs3qt/register_editor_dialog.cpp b/rpcs3/rpcs3qt/register_editor_dialog.cpp index 0242a160db..bf51d76173 100644 --- a/rpcs3/rpcs3qt/register_editor_dialog.cpp +++ b/rpcs3/rpcs3qt/register_editor_dialog.cpp @@ -101,9 +101,9 @@ void register_editor_dialog::updateRegister(const QString& text) if (first_brk != -1) { long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - first_brk - 2).c_str()); - if (reg.find("GPR") == 0) str = fmt::format("%016llx", ppu.gpr[reg_index]); - if (reg.find("FPR") == 0) str = fmt::format("%016llx", ppu.fpr[reg_index]); - if (reg.find("VR") == 0) str = fmt::format("%016llx%016llx", ppu.vr[reg_index]._u64[1], ppu.vr[reg_index]._u64[0]); + if (reg.compare(0, 3, "GPR") == 0) str = fmt::format("%016llx", ppu.gpr[reg_index]); + if (reg.compare(0, 3, "FPR") == 0) str = fmt::format("%016llx", ppu.fpr[reg_index]); + if (reg.compare(0, 2, "VR") == 0) str = fmt::format("%016llx%016llx", ppu.vr[reg_index]._u64[1], ppu.vr[reg_index]._u64[0]); } if (reg == "CR") str = fmt::format("%08x", ppu.cr_pack()); if (reg == "LR") str = fmt::format("%016llx", ppu.lr); @@ -118,7 +118,7 @@ void register_editor_dialog::updateRegister(const QString& text) { long reg_index; reg_index = atol(reg.substr(first_brk + 1, reg.length() - 2).c_str()); - if (reg.find("GPR") == 0) str = fmt::format("%016llx%016llx", spu.gpr[reg_index]._u64[1], spu.gpr[reg_index]._u64[0]); + if (reg.compare(0, 3, "GPR") == 0) str = fmt::format("%016llx%016llx", spu.gpr[reg_index]._u64[1], spu.gpr[reg_index]._u64[0]); } } @@ -143,14 +143,14 @@ void register_editor_dialog::OnOkay(const std::shared_ptr& _cpu) if (first_brk != -1) { const long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - first_brk - 2).c_str()); - if (reg.find("GPR") == 0 || reg.find("FPR") == 0) + if (reg.compare(0, 3, "GPR") == 0 || reg.compare(0, 3, "FPR") == 0) { const ullong reg_value = std::stoull(value.substr(16, 31), 0, 16); - if (reg.find("GPR") == 0) ppu.gpr[reg_index] = (u64)reg_value; - if (reg.find("FPR") == 0) (u64&)ppu.fpr[reg_index] = (u64)reg_value; + if (reg.compare(0, 3, "GPR") == 0) ppu.gpr[reg_index] = (u64)reg_value; + if (reg.compare(0, 3, "FPR") == 0) (u64&)ppu.fpr[reg_index] = (u64)reg_value; return; } - if (reg.find("VR") == 0) + if (reg.compare(0, 2, "VR") == 0) { const ullong reg_value0 = std::stoull(value.substr(16, 31), 0, 16); const ullong reg_value1 = std::stoull(value.substr(0, 15), 0, 16); @@ -188,7 +188,7 @@ void register_editor_dialog::OnOkay(const std::shared_ptr& _cpu) if (first_brk != -1) { const long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - 2).c_str()); - if (reg.find("GPR") == 0) + if (reg.compare(0, 3, "GPR") == 0) { const ullong reg_value0 = std::stoull(value.substr(16, 31), 0, 16); const ullong reg_value1 = std::stoull(value.substr(0, 15), 0, 16); diff --git a/rpcs3/xinput_pad_handler.cpp b/rpcs3/xinput_pad_handler.cpp index e24424a5f6..4b25c2e6d9 100644 --- a/rpcs3/xinput_pad_handler.cpp +++ b/rpcs3/xinput_pad_handler.cpp @@ -74,7 +74,7 @@ void xinput_pad_handler::init_config(pad_config* cfg, const std::string& name) cfg->from_default(); } -void xinput_pad_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, std::vector buttons) +void xinput_pad_handler::GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist, const std::vector& buttons) { if (get_blacklist) blacklist.clear(); diff --git a/rpcs3/xinput_pad_handler.h b/rpcs3/xinput_pad_handler.h index b6c3c34ff6..a389395f34 100644 --- a/rpcs3/xinput_pad_handler.h +++ b/rpcs3/xinput_pad_handler.h @@ -107,7 +107,7 @@ public: std::vector ListDevices() override; bool bindPadToDevice(std::shared_ptr pad, const std::string& device) override; void ThreadProc() override; - void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, std::vector buttons = {}) override; + void GetNextButtonPress(const std::string& padId, const std::function& callback, const std::function& fail_callback, bool get_blacklist = false, const std::vector& buttons = {}) override; void TestVibration(const std::string& padId, u32 largeMotor, u32 smallMotor) override; void init_config(pad_config* cfg, const std::string& name) override;