mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 14:08:37 +00:00
Replace std::string::npos with umax
This commit is contained in:
parent
0a41999818
commit
7a8772dafa
18 changed files with 42 additions and 42 deletions
|
|
@ -219,7 +219,7 @@ std::shared_ptr<ds3_pad_handler::ds3_device> ds3_pad_handler::get_ds3_device(con
|
|||
return nullptr;
|
||||
|
||||
size_t pos = padId.find(m_name_string);
|
||||
if (pos == std::string::npos)
|
||||
if (pos == umax)
|
||||
return nullptr;
|
||||
|
||||
int pad_number = std::stoi(padId.substr(pos + 9));
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ std::shared_ptr<ds4_pad_handler::DS4Device> ds4_pad_handler::GetDS4Device(const
|
|||
return nullptr;
|
||||
|
||||
size_t pos = padId.find(m_name_string);
|
||||
if (pos == std::string::npos)
|
||||
if (pos == umax)
|
||||
return nullptr;
|
||||
|
||||
std::string pad_serial = padId.substr(pos + 9);
|
||||
|
|
|
|||
|
|
@ -327,9 +327,9 @@ void evdev_joystick_handler::get_next_button_press(const std::string& padId, con
|
|||
std::string name = button.second;
|
||||
|
||||
// Handle annoying useless buttons
|
||||
if (padId.find("Xbox 360") != std::string::npos && code >= BTN_TRIGGER_HAPPY)
|
||||
if (padId.find("Xbox 360") != umax && code >= BTN_TRIGGER_HAPPY)
|
||||
continue;
|
||||
if (padId.find("Sony") != std::string::npos && (code == BTN_TL2 || code == BTN_TR2))
|
||||
if (padId.find("Sony") != umax && (code == BTN_TL2 || code == BTN_TR2))
|
||||
continue;
|
||||
|
||||
if (!get_blacklist && std::find(blacklist.begin(), blacklist.end(), name) != blacklist.end())
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ int xinput_pad_handler::GetDeviceNumber(const std::string& padId)
|
|||
return -1;
|
||||
|
||||
size_t pos = padId.find(m_name_string);
|
||||
if (pos == std::string::npos)
|
||||
if (pos == umax)
|
||||
return -1;
|
||||
|
||||
int device_number = std::stoul(padId.substr(pos + 12)) - 1; // Controllers 1-n in GUI
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue