summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2022-10-22 19:19:39 +0200
committerBenBE <BenBE@geshi.org>2022-10-24 23:13:22 +0200
commit40104588f38250afde9f71b6204d789039bbfe3e (patch)
tree745e532580371db2ca85b4ae57b10f1ad3396531 /darwin
parent4ad530d1c00f649dcd02b818a3ccc7ded0aaf12d (diff)
Reformat code base
This includes: - Wrap function implementations - Pointer alignment for function signatures - Pointer alignment for variable declarations - Whitespace after keywords - Whitespace after comma - Whitespace around initializers - Whitespace around operators - Code indentation - Line break for single line statements - Misleading alignment
Diffstat (limited to 'darwin')
-rw-r--r--darwin/DarwinProcess.c2
-rw-r--r--darwin/Platform.h16
-rw-r--r--darwin/PlatformHelpers.c5
-rw-r--r--darwin/PlatformHelpers.h2
4 files changed, 17 insertions, 8 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
index d0204ddc..6027c25b 100644
--- a/darwin/DarwinProcess.c
+++ b/darwin/DarwinProcess.c
@@ -282,7 +282,7 @@ static char* DarwinProcess_getDevname(dev_t dev) {
return NULL;
}
char buf[sizeof("/dev/") + MAXNAMLEN];
- char *name = devname_r(dev, S_IFCHR, buf, MAXNAMLEN);
+ char* name = devname_r(dev, S_IFCHR, buf, MAXNAMLEN);
if (name) {
return xStrdup(name);
}
diff --git a/darwin/Platform.h b/darwin/Platform.h
index 4f8e7c9d..3fd46add 100644
--- a/darwin/Platform.h
+++ b/darwin/Platform.h
@@ -100,7 +100,9 @@ static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec)
void Platform_gettime_monotonic(uint64_t* msec);
-static inline Hashtable* Platform_dynamicMeters(void) { return NULL; }
+static inline Hashtable* Platform_dynamicMeters(void) {
+ return NULL;
+}
static inline void Platform_dynamicMetersDone(ATTR_UNUSED Hashtable* table) { }
@@ -110,12 +112,18 @@ static inline void Platform_dynamicMeterUpdateValues(ATTR_UNUSED Meter* meter) {
static inline void Platform_dynamicMeterDisplay(ATTR_UNUSED const Meter* meter, ATTR_UNUSED RichString* out) { }
-static inline Hashtable* Platform_dynamicColumns(void) { return NULL; }
+static inline Hashtable* Platform_dynamicColumns(void) {
+ return NULL;
+}
static inline void Platform_dynamicColumnsDone(ATTR_UNUSED Hashtable* table) { }
-static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) { return NULL; }
+static inline const char* Platform_dynamicColumnInit(ATTR_UNUSED unsigned int key) {
+ return NULL;
+}
-static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) { return false; }
+static inline bool Platform_dynamicColumnWriteField(ATTR_UNUSED const Process* proc, ATTR_UNUSED RichString* str, ATTR_UNUSED unsigned int key) {
+ return false;
+}
#endif
diff --git a/darwin/PlatformHelpers.c b/darwin/PlatformHelpers.c
index bde90685..1b9a246d 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"
@@ -74,7 +74,8 @@ bool Platform_isRunningTranslated() {
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"
diff --git a/darwin/PlatformHelpers.h b/darwin/PlatformHelpers.h
index 07f3fe23..45aea1a7 100644
--- a/darwin/PlatformHelpers.h
+++ b/darwin/PlatformHelpers.h
@@ -31,7 +31,7 @@ bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upp
double Platform_calculateNanosecondsPerMachTick(void);
-void Platform_getCPUBrandString(char *cpuBrandString, size_t cpuBrandStringSize);
+void Platform_getCPUBrandString(char* cpuBrandString, size_t cpuBrandStringSize);
bool Platform_isRunningTranslated(void);

© 2014-2024 Faster IT GmbH | imprint | privacy policy