Skip to content

Commit

Permalink
Merge pull request #10857 from AdmiralCurtiss/keyboard-mouse-name-static
Browse files Browse the repository at this point in the history
InputCommon: Get rid of static strings.
  • Loading branch information
AdmiralCurtiss authored Jul 15, 2022
2 parents 537fe33 + 89067e6 commit 1da24f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,15 @@ 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;
}

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@

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;
Expand Down

0 comments on commit 1da24f6

Please sign in to comment.