diff options
author | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2023-02-05 04:25:56 +0100 |
commit | f288666edc9180a2e81e6655951878124f321df6 (patch) | |
tree | da70bf44b2423f6f8e9a070c063fed79d190b489 /darwin/PlatformHelpers.c | |
parent | 937052b231259a47d881d539ad5748245ef55b99 (diff) | |
download | debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.gz debian_htop-f288666edc9180a2e81e6655951878124f321df6.tar.bz2 debian_htop-f288666edc9180a2e81e6655951878124f321df6.zip |
New upstream version 3.2.2upstream/3.2.2
Diffstat (limited to 'darwin/PlatformHelpers.c')
-rw-r--r-- | darwin/PlatformHelpers.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/darwin/PlatformHelpers.c b/darwin/PlatformHelpers.c index bde9068..97f0741 100644 --- a/darwin/PlatformHelpers.c +++ b/darwin/PlatformHelpers.c @@ -58,7 +58,7 @@ bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upp && Platform_CompareKernelVersion(upperBound) < 0; } -void Platform_getCPUBrandString(char *cpuBrandString, size_t cpuBrandStringSize) { +void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize) { if (sysctlbyname("machdep.cpu.brand_string", cpuBrandString, &cpuBrandStringSize, NULL, 0) == -1) { fprintf(stderr, "WARN: Unable to determine the CPU brand string.\n" @@ -69,12 +69,13 @@ 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; if (sysctlbyname("sysctl.proc_translated", &ret, &size, NULL, 0) == -1) { - if (errno == ENOENT) return false; + if (errno == ENOENT) + return false; fprintf(stderr, "WARN: Could not determine if this process was running in a translation environment like Rosetta 2.\n" @@ -86,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 |