summaryrefslogtreecommitdiffstats
path: root/components/ram.c
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2022-10-27 02:16:05 +0600
committerdrkhsh <me@drkhsh.at>2022-10-26 23:32:43 +0200
commit0c2b3e5b5c499b1de566fd4bef49c5e6b5254d1a (patch)
tree770d6bf46d2e1e9821ec528e1826b9753b2dee86 /components/ram.c
parent28ef0b242c32e8ae8b4df2b4b380e30bf581130f (diff)
do not rely on obsolete feature
function prototype with unspecified argument is obsolete since c99. additionally some of these function which don't take any argument were being called with a `const char *` arg, which is UB. fix both these issues by declararing ALL the components to accept a `const char *`, and name the arg "unused" if it's meant to be ignored.
Diffstat (limited to 'components/ram.c')
-rw-r--r--components/ram.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/components/ram.c b/components/ram.c
index 3fa78af..d90b107 100644
--- a/components/ram.c
+++ b/components/ram.c
@@ -8,7 +8,7 @@
#include <stdint.h>
const char *
- ram_free(void)
+ ram_free(const char *unused)
{
uintmax_t free;
@@ -24,7 +24,7 @@
}
const char *
- ram_perc(void)
+ ram_perc(const char *unused)
{
uintmax_t total, free, buffers, cached;
@@ -47,7 +47,7 @@
}
const char *
- ram_total(void)
+ ram_total(const char *unused)
{
uintmax_t total;
@@ -60,7 +60,7 @@
}
const char *
- ram_used(void)
+ ram_used(const char *unused)
{
uintmax_t total, free, buffers, cached;
@@ -102,7 +102,7 @@
}
const char *
- ram_free(void)
+ ram_free(const char *unused)
{
struct uvmexp uvmexp;
int free_pages;
@@ -117,7 +117,7 @@
}
const char *
- ram_perc(void)
+ ram_perc(const char *unused)
{
struct uvmexp uvmexp;
int percent;
@@ -131,7 +131,7 @@
}
const char *
- ram_total(void)
+ ram_total(const char *unused)
{
struct uvmexp uvmexp;
@@ -145,7 +145,7 @@
}
const char *
- ram_used(void)
+ ram_used(const char *unused)
{
struct uvmexp uvmexp;
@@ -164,7 +164,7 @@
#include <vm/vm_param.h>
const char *
- ram_free(void) {
+ ram_free(const char *unused) {
struct vmtotal vm_stats;
int mib[] = {CTL_VM, VM_TOTAL};
size_t len;
@@ -178,7 +178,7 @@
}
const char *
- ram_total(void) {
+ ram_total(const char *unused) {
unsigned int npages;
size_t len;
@@ -191,7 +191,7 @@
}
const char *
- ram_perc(void) {
+ ram_perc(const char *unused) {
unsigned int npages;
unsigned int active;
size_t len;
@@ -209,7 +209,7 @@
}
const char *
- ram_used(void) {
+ ram_used(const char *unused) {
unsigned int active;
size_t len;