Unify naming of first argument of Platform_getBattery

Use percent throughout
This commit is contained in:
Christian Göttsche
2020-11-25 12:46:00 +01:00
parent a3221f3677
commit 601ad61e7d
11 changed files with 36 additions and 36 deletions

View File

@ -355,10 +355,10 @@ bool Platform_getNetworkIO(unsigned long int* bytesReceived,
return false;
}
void Platform_getBattery(double* level, ACPresence* isOnAC) {
void Platform_getBattery(double* percent, ACPresence* isOnAC) {
CFTypeRef power_sources = IOPSCopyPowerSourcesInfo();
*level = NAN;
*percent = NAN;
*isOnAC = AC_ERROR;
if (NULL == power_sources)
@ -410,7 +410,7 @@ void Platform_getBattery(double* level, ACPresence* isOnAC) {
CFNumberGetValue(CFDictionaryGetValue(battery, CFSTR(kIOPSMaxCapacityKey)),
kCFNumberDoubleType, &max);
*level = (current * 100.0) / max;
*percent = (current * 100.0) / max;
CFRelease(battery);
}