From bd40f62927b6cdb1ae354f5834cab275f6058e8c Mon Sep 17 00:00:00 2001 From: ShevT Date: Thu, 26 Jul 2018 11:47:47 +0300 Subject: [PATCH] healthd: BatteryMonitor: Fix compiler warning system/core/healthd/BatteryMonitor.cpp:248:19: note: initialize the variable 'i' to silence this warning unsigned int i; ^ = 0 1 warning generated. Change-Id: Ib2fa0061d657fd93871ca8a9056d173d5b7ab58d --- healthd/BatteryMonitor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index fb1a63abb..e860f823d 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -238,7 +238,6 @@ bool BatteryMonitor::update(void) { if (readFromFile(mHealthdConfig->batteryTechnologyPath, &buf) > 0) props.batteryTechnology = String8(buf.c_str()); - unsigned int i; double MaxPower = 0; // Rescan for the available charger types @@ -275,7 +274,7 @@ bool BatteryMonitor::update(void) { } } - for (i = 0; i < mChargerNames.size(); i++) { + for (size_t i = 0; i < mChargerNames.size(); i++) { String8 path; path.appendFormat("%s/%s/online", POWER_SUPPLY_SYSFS_PATH, mChargerNames[i].string());