mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 09:39:55 +00:00
cellPad: fix out of bounds warning
This commit is contained in:
parent
8a63ac033e
commit
571bb914f5
@ -301,7 +301,7 @@ error_code cellPadGetData(u32 port_no, vm::ptr<CellPadData> data)
|
|||||||
{
|
{
|
||||||
// report back new data every ~10 ms even if the input doesn't change
|
// report back new data every ~10 ms even if the input doesn't change
|
||||||
// this is observed behaviour when using a Dualshock 3 controller
|
// this is observed behaviour when using a Dualshock 3 controller
|
||||||
static std::chrono::time_point<steady_clock> last_update[CELL_PAD_MAX_PORT_NUM] = { };
|
static std::array<std::chrono::time_point<steady_clock>, CELL_PAD_MAX_PORT_NUM> last_update = { };
|
||||||
const std::chrono::time_point<steady_clock> now = steady_clock::now();
|
const std::chrono::time_point<steady_clock> now = steady_clock::now();
|
||||||
|
|
||||||
if (btnChanged || pad->m_buffer_cleared || (std::chrono::duration_cast<std::chrono::milliseconds>(now - last_update[port_no]).count() >= 10))
|
if (btnChanged || pad->m_buffer_cleared || (std::chrono::duration_cast<std::chrono::milliseconds>(now - last_update[port_no]).count() >= 10))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user