From a2a1e04fc9c26c7d4ae8af5d1229a906c0ae066d Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 8 Jul 2019 13:35:53 +0200 Subject: StringUtil: Use std::string_view more --- Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm | 2 +- Source/Core/InputCommon/ControllerInterface/OSX/OSXJoystick.mm | 2 +- Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface') diff --git a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm index 716a56b61e..37b1fa8cfd 100644 --- a/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm +++ b/Source/Core/InputCommon/ControllerInterface/OSX/OSX.mm @@ -141,7 +141,7 @@ static std::string GetDeviceRefName(IOHIDDeviceRef inIOHIDDeviceRef) { const NSString* name = reinterpret_cast( IOHIDDeviceGetProperty(inIOHIDDeviceRef, CFSTR(kIOHIDProductKey))); - return (name != nullptr) ? StripSpaces([name UTF8String]) : "Unknown device"; + return (name != nullptr) ? std::string(StripSpaces([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 9ab06c91db..3b59d5b2ec 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 ") + StripSpaces(s.str()); + return std::string("Button ").append(StripSpaces(s.str())); } Joystick::Axis::Axis(IOHIDElementRef element, IOHIDDeviceRef device, direction dir) diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp index 4443eaad3a..de14875f56 100644 --- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp +++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp @@ -313,7 +313,7 @@ std::string evdevDevice::Button::GetName() const { const char* name = libevdev_event_code_get_name(EV_KEY, m_code); if (name) - return StripSpaces(name); + return std::string(StripSpaces(name)); } // But controllers use codes above 0x100, and the standard label often doesn't match. // We are better off with Button 0 and so on. -- cgit v1.2.3