summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-01-22 18:45:06 +0100
committerEthan Yonker <dees_troy@teamw.in>2016-01-22 18:45:13 +0100
commit72a85203693070a50e6578d785d5be739ea95129 (patch)
tree5f27dd633c87a3719781e647c69e59a17a4b5bfe /data.cpp
parentFix toolbox build issue when using TW_USE_TOOLBOX=true (diff)
downloadandroid_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar.gz
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar.bz2
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar.lz
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar.xz
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.tar.zst
android_bootable_recovery-72a85203693070a50e6578d785d5be739ea95129.zip
Diffstat (limited to 'data.cpp')
-rw-r--r--data.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/data.cpp b/data.cpp
index e38f36641..cda6828de 100644
--- a/data.cpp
+++ b/data.cpp
@@ -855,7 +855,7 @@ void DataManager::SetDefaultValues()
// Attempt to locate the max_brightness file
string maxbrightpath = findbright.insert(findbright.rfind('/') + 1, "max_");
if (TWFunc::Path_Exists(maxbrightpath)) {
- ifstream maxVal(maxbrightpath);
+ ifstream maxVal(maxbrightpath.c_str());
if(maxVal >> maxBrightness) {
LOGINFO("Got max brightness %s from '%s'\n", maxBrightness.c_str(), maxbrightpath.c_str());
} else {
@@ -863,7 +863,7 @@ void DataManager::SetDefaultValues()
maxBrightness = "-1";
}
}
- if(stoi(maxBrightness) <= 0)
+ if (atoi(maxBrightness.c_str()) <= 0)
{
// Fallback into default
ostringstream maxVal;
@@ -885,7 +885,7 @@ void DataManager::SetDefaultValues()
#endif
#ifdef TW_DEFAULT_BRIGHTNESS
int defValInt = TW_DEFAULT_BRIGHTNESS;
- int maxValInt = stoi(maxBrightness);
+ int maxValInt = atoi(maxBrightness.c_str());
// Deliberately int so the % is always a whole number
int defPctInt = ( ( (double)defValInt / maxValInt ) * 100 );
ostringstream defPct;