summaryrefslogtreecommitdiff
path: root/components/ram.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-07-07 10:50:25 +0200
committerAaron Marcher <me@drkhsh.at>2018-07-07 10:50:25 +0200
commit43a12832a343747b7317987b552a87eb8ed5b42d (patch)
tree28df6fc8f8aacd557b2c97a00a8cac321949c745 /components/ram.c
parentd76b1a21fc014395cf9f7bd4e14180a3a0945e9c (diff)
Change uint64_t to uintmax_t
Diffstat (limited to 'components/ram.c')
-rw-r--r--components/ram.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/components/ram.c b/components/ram.c
index 8688349..a2fff95 100644
--- a/components/ram.c
+++ b/components/ram.c
@@ -9,12 +9,12 @@
const char *
ram_free(void)
{
- uint64_t free;
+ uintmax_t free;
if (pscanf("/proc/meminfo",
- "MemTotal: %" PRIu64 " kB\n"
- "MemFree: %" PRIu64 " kB\n"
- "MemAvailable: %" PRIu64 " kB\n",
+ "MemTotal: %" PRIuMAX " kB\n"
+ "MemFree: %" PRIuMAX " kB\n"
+ "MemAvailable: %" PRIuMAX " kB\n",
&free, &free, &free) != 3) {
return NULL;
}
@@ -25,13 +25,13 @@
const char *
ram_perc(void)
{
- uint64_t total, free, buffers, cached;
+ uintmax_t total, free, buffers, cached;
if (pscanf("/proc/meminfo",
- "MemTotal: %" PRIu64 " kB\n"
- "MemFree: %" PRIu64 " kB\n"
- "MemAvailable: %" PRIu64 " kB\nBuffers: %ld kB\n"
- "Cached: %" PRIu64 " kB\n",
+ "MemTotal: %" PRIuMAX " kB\n"
+ "MemFree: %" PRIuMAX " kB\n"
+ "MemAvailable: %" PRIuMAX " kB\nBuffers: %ld kB\n"
+ "Cached: %" PRIuMAX " kB\n",
&total, &free, &buffers, &buffers, &cached) != 5) {
return NULL;
}
@@ -47,9 +47,9 @@
const char *
ram_total(void)
{
- uint64_t total;
+ uintmax_t total;
- if (pscanf("/proc/meminfo", "MemTotal: %" PRIu64 " kB\n",
+ if (pscanf("/proc/meminfo", "MemTotal: %" PRIuMAX " kB\n",
&total) != 1) {
return NULL;
}
@@ -60,13 +60,13 @@
const char *
ram_used(void)
{
- uint64_t total, free, buffers, cached;
+ uintmax_t total, free, buffers, cached;
if (pscanf("/proc/meminfo",
- "MemTotal: %" PRIu64 " kB\n"
- "MemFree: %" PRIu64 " kB\n"
- "MemAvailable: %" PRIu64 " kB\nBuffers: %" PRIu64 " kB\n"
- "Cached: %" PRIu64 " kB\n",
+ "MemTotal: %" PRIuMAX " kB\n"
+ "MemFree: %" PRIuMAX " kB\n"
+ "MemAvailable: %" PRIuMAX " kB\nBuffers: %" PRIuMAX " kB\n"
+ "Cached: %" PRIuMAX " kB\n",
&total, &free, &buffers, &buffers, &cached) != 5) {
return NULL;
}