summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-25 12:46:00 +0100
committerChristian Göttsche <cgzones@googlemail.com>2020-11-25 12:47:07 +0100
commit601ad61e7ddd5a79a0c650ff617b617470fafe07 (patch)
tree03734ee31c6dac9009cefe3286beaebbab43f7b6 /darwin
parenta3221f367779288090715f4098d9a874cd113ad3 (diff)
Unify naming of first argument of Platform_getBattery
Use percent throughout
Diffstat (limited to 'darwin')
-rw-r--r--darwin/Platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 09fec45a..e24b67bc 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -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);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy