Merge pull request #10857 from AdmiralCurtiss/keyboard-mouse-name-static

InputCommon: Get rid of static strings.
This commit is contained in:
Admiral H. Curtiss 2022-07-15 20:07:55 +02:00 committed by GitHub
commit 1da24f66fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -293,7 +293,7 @@ std::string Joystick::Axis::GetName() const
std::string Joystick::Hat::GetName() const
{
static char tmpstr[] = "Hat . .";
char tmpstr[] = "Hat . .";
tmpstr[4] = (char)('0' + m_index);
tmpstr[6] = "NESW"[m_direction];
return tmpstr;

View File

@ -275,7 +275,7 @@ std::string KeyboardMouse::Button::GetName() const
std::string KeyboardMouse::Axis::GetName() const
{
static char tmpstr[] = "Axis ..";
char tmpstr[] = "Axis ..";
tmpstr[5] = (char)('X' + m_index);
tmpstr[6] = (m_range < 0 ? '-' : '+');
return tmpstr;
@ -283,7 +283,7 @@ std::string KeyboardMouse::Axis::GetName() const
std::string KeyboardMouse::Cursor::GetName() const
{
static char tmpstr[] = "Cursor ..";
char tmpstr[] = "Cursor ..";
tmpstr[7] = (char)('X' + m_index);
tmpstr[8] = (m_positive ? '+' : '-');
return tmpstr;

View File

@ -226,7 +226,7 @@ ControlState KeyboardAndMouse::Button::GetState() const
std::string KeyboardAndMouse::Cursor::GetName() const
{
static char tmpstr[] = "Cursor ..";
char tmpstr[] = "Cursor ..";
tmpstr[7] = (char)('X' + m_index);
tmpstr[8] = (m_positive ? '+' : '-');
return tmpstr;