summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2022-07-19 15:13:26 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2022-07-25 18:40:12 -0700
commitf92541fbd9da5091636aac09fdabd1a5fd0191ce (patch)
tree51f4add6038f41c213f392559501a6121ee28ec3 /Source/Core/InputCommon
parente4ff49769c687e892219dab628ad5c7850efa49d (diff)
StripSpaces: only strip spaces
StripWhitespace maintains old behavior
Diffstat (limited to 'Source/Core/InputCommon')
-rw-r--r--Source/Core/InputCommon/ControlReference/ExpressionParser.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm4
-rw-r--r--Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp4
-rw-r--r--Source/Core/InputCommon/InputProfile.cpp2
8 files changed, 10 insertions, 10 deletions
diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
index 59c22612f4..1f78071856 100644
--- a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
+++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp
@@ -980,7 +980,7 @@ static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& st
ParseResult ParseExpression(const std::string& str)
{
- if (StripSpaces(str).empty())
+ if (StripWhitespace(str).empty())
return ParseResult::MakeEmptyResult();
auto bareword_expr = ParseBarewordExpression(str);
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
index 1ab12af20a..aa1826ae45 100644
--- a/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInput.cpp
@@ -41,7 +41,7 @@ std::string GetDeviceName(const LPDIRECTINPUTDEVICE8 device)
HRESULT hr = device->GetProperty(DIPROP_PRODUCTNAME, &str.diph);
if (SUCCEEDED(hr))
{
- result = StripSpaces(WStringToUTF8(str.wsz));
+ result = StripWhitespace(WStringToUTF8(str.wsz));
}
else
{
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
index 10c30ffb21..2d0651b6bd 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm
@@ -139,7 +139,7 @@ static std::string GetDeviceRefName(IOHIDDeviceRef inIOHIDDeviceRef)
{
const NSString* name = reinterpret_cast<const NSString*>(
IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey)));
- return (name != nullptr) ? std::string(StripSpaces([name UTF8String])) : "Unknown device";
+ return (name != nullptr) ? std::string(StripWhitespace([name UTF8String])) : "Unknown device";
}
static void DeviceRemovalCallback(void* inContext, IOReturn inResult, void* inSender,
diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
index f8ee6e5446..82ad68e205 100644
--- a/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
+++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm
@@ -164,7 +164,7 @@ std::string Joystick::Button::GetName() const
{
std::ostringstream s;
s << IOHIDElementGetUsage(m_element);
- return std::string("Button ").append(StripSpaces(s.str()));
+ return std::string("Button ").append(StripWhitespace(s.str()));
}
Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir)
@@ -210,7 +210,7 @@ Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction d
std::ostringstream s;
s << "CK-";
s << elementCookie;
- description = StripSpaces(s.str());
+ description = StripWhitespace(s.str());
break;
}
}
diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
index 0d7494142d..0ea15251ad 100644
--- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp
@@ -272,7 +272,7 @@ void PopulateDevices()
}
Joystick::Joystick(SDL_Joystick* const joystick, const int sdl_index)
- : m_joystick(joystick), m_name(StripSpaces(GetJoystickName(sdl_index)))
+ : m_joystick(joystick), m_name(StripWhitespace(GetJoystickName(sdl_index)))
{
// really bad HACKS:
// to not use SDL for an XInput device
diff --git a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
index b934e86e71..f755a175a5 100644
--- a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp
@@ -784,7 +784,7 @@ void PopulateDevices()
if (SUCCEEDED(hr = rgc2->get_DisplayName(&hstr)) && hstr)
{
device_name =
- StripSpaces(WStringToUTF8(g_WindowsGetStringRawBuffer_address(hstr, nullptr)));
+ StripWhitespace(WStringToUTF8(g_WindowsGetStringRawBuffer_address(hstr, nullptr)));
}
}
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index 6df37b47df..d3a222890b 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -52,7 +52,7 @@ protected:
{
if (const char* code_name = libevdev_event_code_get_name(EV_KEY, m_code))
{
- const auto name = StripSpaces(code_name);
+ const auto name = StripWhitespace(code_name);
for (auto remove_prefix : {"BTN_", "KEY_"})
{
@@ -441,7 +441,7 @@ bool evdevDevice::AddNode(std::string devnode, int fd, libevdev* dev)
m_nodes.emplace_back(Node{std::move(devnode), fd, dev});
// Take on the alphabetically first name.
- const auto potential_new_name = StripSpaces(libevdev_get_name(dev));
+ const auto potential_new_name = StripWhitespace(libevdev_get_name(dev));
if (m_name.empty() || potential_new_name < m_name)
m_name = potential_new_name;
diff --git a/Source/Core/InputCommon/InputProfile.cpp b/Source/Core/InputCommon/InputProfile.cpp
index be0f02c975..492b45975e 100644
--- a/Source/Core/InputCommon/InputProfile.cpp
+++ b/Source/Core/InputCommon/InputProfile.cpp
@@ -34,7 +34,7 @@ std::vector<std::string> GetProfilesFromSetting(const std::string& setting, cons
std::vector<std::string> result;
for (const std::string& setting_choice : setting_choices)
{
- const std::string path = root + std::string(StripSpaces(setting_choice));
+ const std::string path = root + std::string(StripWhitespace(setting_choice));
if (File::IsDirectory(path))
{
const auto files_under_directory = Common::DoFileSearch({path}, {".ini"}, true);