diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2023-02-04 18:03:17 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2023-02-04 18:13:10 +0100 |
commit | ca7e92bd78368befa88a3a6d732d1595c388c660 (patch) | |
tree | 54c22c3db2c79737b3fe91dbaa4333eae034dae1 | |
parent | c9f654da96f9af05d599bc778575dd5b71a2c5ae (diff) |
Use strict function prototypes also for defintions
freebsd/Platform.c:151:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
int Platform_getUptime() {
^
void
-rw-r--r-- | darwin/Platform.c | 4 | ||||
-rw-r--r-- | darwin/PlatformHelpers.c | 4 | ||||
-rw-r--r-- | dragonflybsd/Platform.c | 4 | ||||
-rw-r--r-- | freebsd/Platform.c | 4 | ||||
-rw-r--r-- | netbsd/Platform.c | 4 | ||||
-rw-r--r-- | openbsd/Platform.c | 4 | ||||
-rw-r--r-- | solaris/Platform.c | 4 | ||||
-rw-r--r-- | unsupported/Platform.c | 4 |
8 files changed, 16 insertions, 16 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c index 38b1a8af..332752b2 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -172,7 +172,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); @@ -200,7 +200,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { } } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { /* http://opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/sys/proc_internal.hh */ return 99999; } diff --git a/darwin/PlatformHelpers.c b/darwin/PlatformHelpers.c index 1b9a246d..97f0741a 100644 --- a/darwin/PlatformHelpers.c +++ b/darwin/PlatformHelpers.c @@ -69,7 +69,7 @@ void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize) } // Adapted from https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment -bool Platform_isRunningTranslated() { +bool Platform_isRunningTranslated(void) { int ret = 0; size_t size = sizeof(ret); errno = 0; @@ -87,7 +87,7 @@ bool Platform_isRunningTranslated() { return ret; } -double Platform_calculateNanosecondsPerMachTick() { +double Platform_calculateNanosecondsPerMachTick(void) { // Check if we can determine the timebase used on this system. // If the API is unavailable assume we get our timebase in nanoseconds. #ifndef HAVE_MACH_TIMEBASE_INFO diff --git a/dragonflybsd/Platform.c b/dragonflybsd/Platform.c index 769a46ed..8a684d86 100644 --- a/dragonflybsd/Platform.c +++ b/dragonflybsd/Platform.c @@ -126,7 +126,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { struct timeval bootTime, currTime; int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); @@ -157,7 +157,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { int maxPid; size_t size = sizeof(maxPid); int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); diff --git a/freebsd/Platform.c b/freebsd/Platform.c index e2f2509c..38d06169 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -148,7 +148,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { struct timeval bootTime, currTime; const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); @@ -179,7 +179,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { int maxPid; size_t size = sizeof(maxPid); int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0); diff --git a/netbsd/Platform.c b/netbsd/Platform.c index 78579189..ad6050c0 100644 --- a/netbsd/Platform.c +++ b/netbsd/Platform.c @@ -196,7 +196,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { struct timeval bootTime, currTime; const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); @@ -227,7 +227,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { // https://nxr.netbsd.org/xref/src/sys/sys/ansi.h#__pid_t // pid is assigned as a 32bit Integer. return INT32_MAX; diff --git a/openbsd/Platform.c b/openbsd/Platform.c index 24e8aca1..1ce5ba19 100644 --- a/openbsd/Platform.c +++ b/openbsd/Platform.c @@ -143,7 +143,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { struct timeval bootTime, currTime; const int mib[2] = { CTL_KERN, KERN_BOOTTIME }; size_t size = sizeof(bootTime); @@ -174,7 +174,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { return 2 * THREAD_PID_OFFSET; } diff --git a/solaris/Platform.c b/solaris/Platform.c index f3a386bc..96f35263 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -144,7 +144,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { int boot_time = 0; int curr_time = time(NULL); struct utmpx* ent; @@ -173,7 +173,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = plat_loadavg[LOADAVG_15MIN]; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { int vproc = 32778; // Reasonable Solaris default kstat_ctl_t* kc = kstat_open(); diff --git a/unsupported/Platform.c b/unsupported/Platform.c index fcccb21a..27bc560b 100644 --- a/unsupported/Platform.c +++ b/unsupported/Platform.c @@ -90,7 +90,7 @@ void Platform_setBindings(Htop_Action* keys) { (void) keys; } -int Platform_getUptime() { +int Platform_getUptime(void) { return 0; } @@ -100,7 +100,7 @@ void Platform_getLoadAverage(double* one, double* five, double* fifteen) { *fifteen = 0; } -int Platform_getMaxPid() { +int Platform_getMaxPid(void) { return 1; } |