summaryrefslogtreecommitdiff
path: root/Source/Core/Common
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-07-05 17:36:07 +0200
committerGitHub <noreply@github.com>2017-07-05 17:36:07 +0200
commit24f05f14f2760f2ca5b592a8d9b0da022f9bc45a (patch)
treedd24b167d5c66b4bdebecb0c08dd7e4879977207 /Source/Core/Common
parentd498a9b3d5ce36ddc346396fae933a6b49537741 (diff)
parent90f8265497201619efffe9dc8a9ffc99ccb880b3 (diff)
Merge pull request #5752 from leoetlino/to_string
Replace StringFromInt with std::to_string
Diffstat (limited to 'Source/Core/Common')
-rw-r--r--Source/Core/Common/Config/Section.cpp2
-rw-r--r--Source/Core/Common/IniFile.cpp2
-rw-r--r--Source/Core/Common/StringUtil.cpp7
-rw-r--r--Source/Core/Common/StringUtil.h1
4 files changed, 2 insertions, 10 deletions
diff --git a/Source/Core/Common/Config/Section.cpp b/Source/Core/Common/Config/Section.cpp
index ac6741416a..7db2c557ea 100644
--- a/Source/Core/Common/Config/Section.cpp
+++ b/Source/Core/Common/Config/Section.cpp
@@ -71,7 +71,7 @@ void Section::Set(const std::string& key, double newValue)
void Section::Set(const std::string& key, int newValue)
{
- Section::Set(key, StringFromInt(newValue));
+ Section::Set(key, std::to_string(newValue));
}
void Section::Set(const std::string& key, bool newValue)
diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp
index 5c38dd6a19..ddaf64b0e3 100644
--- a/Source/Core/Common/IniFile.cpp
+++ b/Source/Core/Common/IniFile.cpp
@@ -93,7 +93,7 @@ void IniFile::Section::Set(const std::string& key, double newValue)
void IniFile::Section::Set(const std::string& key, int newValue)
{
- Set(key, StringFromInt(newValue));
+ Set(key, std::to_string(newValue));
}
void IniFile::Section::Set(const std::string& key, s64 newValue)
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp
index 1536173eb7..03e6bb3d45 100644
--- a/Source/Core/Common/StringUtil.cpp
+++ b/Source/Core/Common/StringUtil.cpp
@@ -283,13 +283,6 @@ bool TryParse(const std::string& str, bool* const output)
return true;
}
-std::string StringFromInt(int value)
-{
- char temp[16];
- sprintf(temp, "%i", value);
- return temp;
-}
-
std::string StringFromBool(bool value)
{
return value ? "True" : "False";
diff --git a/Source/Core/Common/StringUtil.h b/Source/Core/Common/StringUtil.h
index b4c65370d3..f9a767e700 100644
--- a/Source/Core/Common/StringUtil.h
+++ b/Source/Core/Common/StringUtil.h
@@ -56,7 +56,6 @@ std::string ThousandSeparate(I value, int spaces = 0)
return oss.str();
}
-std::string StringFromInt(int value);
std::string StringFromBool(bool value);
bool TryParse(const std::string& str, bool* output);