diff options
author | Aaron Marcher <me@drkhsh.at> | 2018-07-07 10:50:25 +0200 |
---|---|---|
committer | Aaron Marcher <me@drkhsh.at> | 2018-07-07 10:50:25 +0200 |
commit | 43a12832a343747b7317987b552a87eb8ed5b42d (patch) | |
tree | 28df6fc8f8aacd557b2c97a00a8cac321949c745 /components/battery.c | |
parent | d76b1a21fc014395cf9f7bd4e14180a3a0945e9c (diff) |
Change uint64_t to uintmax_t
Diffstat (limited to 'components/battery.c')
-rw-r--r-- | components/battery.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/battery.c b/components/battery.c index 31c7d48..ae31dd6 100644 --- a/components/battery.c +++ b/components/battery.c @@ -77,7 +77,7 @@ const char * battery_remaining(const char *bat) { - uint64_t charge_now, current_now, m, h; + uintmax_t charge_now, current_now, m, h; double timeleft; char path[PATH_MAX], state[12]; @@ -93,7 +93,7 @@ if (!pick(bat, "/sys/class/power_supply/%s/charge_now", "/sys/class/power_supply/%s/energy_now", path, sizeof(path)) || - pscanf(path, "%" PRIu64, &charge_now) < 0) { + pscanf(path, "%" PRIuMAX, &charge_now) < 0) { 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)) || - pscanf(path, "%" PRIu64, ¤t_now) < 0) { + pscanf(path, "%" PRIuMAX, ¤t_now) < 0) { return NULL; } @@ -113,7 +113,7 @@ h = timeleft; m = (timeleft - (double)h) * 60; - return bprintf("%" PRIu64 "h %" PRIu64 "m", h, m); + return bprintf("%" PRIuMAX "h %" PRIuMAX "m", h, m); } return ""; |