Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
wifi_perc: Simplify on Linux
[slstatus.git]
/
components
/
battery.c
diff --git
a/components/battery.c
b/components/battery.c
index
ae31dd6
..
79d16c2
100644
(file)
--- a/
components/battery.c
+++ b/
components/battery.c
@@
-5,8
+5,8
@@
#include "../util.h"
#if defined(__linux__)
#include "../util.h"
#if defined(__linux__)
- #include <inttypes.h>
#include <limits.h>
#include <limits.h>
+ #include <stdint.h>
#include <unistd.h>
static const char *
#include <unistd.h>
static const char *
@@
-93,7
+93,7
@@
if (!pick(bat, "/sys/class/power_supply/%s/charge_now",
"/sys/class/power_supply/%s/energy_now",
path, sizeof(path)) ||
if (!pick(bat, "/sys/class/power_supply/%s/charge_now",
"/sys/class/power_supply/%s/energy_now",
path, sizeof(path)) ||
- pscanf(path, "%
" PRIuMAX
, &charge_now) < 0) {
+ pscanf(path, "%
ju"
, &charge_now) < 0) {
return NULL;
}
return NULL;
}
@@
-101,7
+101,7
@@
if (!pick(bat, "/sys/class/power_supply/%s/current_now",
"/sys/class/power_supply/%s/power_now", path,
sizeof(path)) ||
if (!pick(bat, "/sys/class/power_supply/%s/current_now",
"/sys/class/power_supply/%s/power_now", path,
sizeof(path)) ||
- pscanf(path, "%
" PRIuMAX
, ¤t_now) < 0) {
+ pscanf(path, "%
ju"
, ¤t_now) < 0) {
return NULL;
}
return NULL;
}
@@
-113,7
+113,7
@@
h = timeleft;
m = (timeleft - (double)h) * 60;
h = timeleft;
m = (timeleft - (double)h) * 60;
- return bprintf("%
" PRIuMAX "h %" PRIuMAX "
m", h, m);
+ return bprintf("%
juh %ju
m", h, m);
}
return "";
}
return "";