summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2023-04-11 22:49:39 +0200
committerBenny Baumann <BenBE@geshi.org>2023-04-11 22:50:18 +0200
commitda255cb33fd8ddd233232850f9465e6ddb47015f (patch)
tree488374400faded42a87dab75b280261aa4d24492
parentc878343784f23d7cb18ccec6aa034f01aee8069e (diff)
Minor code formatting consistency fixes
-rw-r--r--Action.c2
-rw-r--r--FileDescriptorMeter.c10
-rw-r--r--MemoryMeter.h12
-rw-r--r--ScreensPanel.h2
-rw-r--r--SwapMeter.h6
-rw-r--r--TraceScreen.c2
-rw-r--r--linux/LinuxProcessList.c4
-rw-r--r--linux/Platform.c8
-rw-r--r--linux/SystemdMeter.c6
-rw-r--r--netbsd/Platform.c2
-rw-r--r--pcp/PCPProcessList.c2
11 files changed, 28 insertions, 28 deletions
diff --git a/Action.c b/Action.c
index 5d33f662..a67233cc 100644
--- a/Action.c
+++ b/Action.c
@@ -419,7 +419,7 @@ static Htop_Reaction actionSetSchedPolicy(State* st) {
Panel* schedPanel = Scheduling_newPolicyPanel(preSelectedPolicy);
const ListItem* policy;
- for(;;) {
+ for (;;) {
policy = (const ListItem*) Action_pickFromVector(st, schedPanel, 18, true);
if (!policy || policy->key != -1)
diff --git a/FileDescriptorMeter.c b/FileDescriptorMeter.c
index e1163710..2d939d66 100644
--- a/FileDescriptorMeter.c
+++ b/FileDescriptorMeter.c
@@ -47,12 +47,12 @@ static void FileDescriptorMeter_updateValues(Meter* this) {
* 3. If the maximum is effectively unlimited (AKA > 1<<30),
* Do the same as for 2, but cap at 1<<30.
*/
- if (this->values[1] <= 1<<16) {
+ if (this->values[1] <= 1 << 16) {
this->total = this->values[1];
} else {
if (this->total < 16 * this->values[0]) {
- for (this->total = 1<<16; this->total < 16 * this->values[0]; this->total *= 2) {
- if (this->total >= 1<<30) {
+ for (this->total = 1 << 16; this->total < 16 * this->values[0]; this->total *= 2) {
+ if (this->total >= 1 << 30) {
break;
}
}
@@ -62,8 +62,8 @@ static void FileDescriptorMeter_updateValues(Meter* this) {
this->total = this->values[1];
}
- if (this->total > 1<<30) {
- this->total = 1<<30;
+ if (this->total > 1 << 30) {
+ this->total = 1 << 30;
}
}
diff --git a/MemoryMeter.h b/MemoryMeter.h
index cc2a160c..d8f5fdbc 100644
--- a/MemoryMeter.h
+++ b/MemoryMeter.h
@@ -10,12 +10,12 @@ in the source distribution for its full text.
#include "Meter.h"
typedef enum {
- MEMORY_METER_USED = 0,
- MEMORY_METER_BUFFERS = 1,
- MEMORY_METER_SHARED = 2,
- MEMORY_METER_CACHE = 3,
- MEMORY_METER_AVAILABLE = 4,
- MEMORY_METER_ITEMCOUNT = 5, // number of entries in this enum
+ MEMORY_METER_USED = 0,
+ MEMORY_METER_BUFFERS = 1,
+ MEMORY_METER_SHARED = 2,
+ MEMORY_METER_CACHE = 3,
+ MEMORY_METER_AVAILABLE = 4,
+ MEMORY_METER_ITEMCOUNT = 5, // number of entries in this enum
} MemoryMeterValues;
extern const MeterClass MemoryMeter_class;
diff --git a/ScreensPanel.h b/ScreensPanel.h
index 88d85b5c..60aaf2a2 100644
--- a/ScreensPanel.h
+++ b/ScreensPanel.h
@@ -31,7 +31,7 @@ typedef struct ScreensPanel_ {
char* saved;
int cursor;
bool moving;
- ListItem *renamingItem;
+ ListItem* renamingItem;
} ScreensPanel;
typedef struct ScreenListItem_ {
diff --git a/SwapMeter.h b/SwapMeter.h
index b71e83fe..162897fb 100644
--- a/SwapMeter.h
+++ b/SwapMeter.h
@@ -10,9 +10,9 @@ in the source distribution for its full text.
#include "Meter.h"
typedef enum {
- SWAP_METER_USED = 0,
- SWAP_METER_CACHE = 1,
- SWAP_METER_ITEMCOUNT = 2, // number of entries in this enum
+ SWAP_METER_USED = 0,
+ SWAP_METER_CACHE = 1,
+ SWAP_METER_ITEMCOUNT = 2, // number of entries in this enum
} SwapMeterValues;
extern const MeterClass SwapMeter_class;
diff --git a/TraceScreen.c b/TraceScreen.c
index 2aa0781b..e8f55ff5 100644
--- a/TraceScreen.c
+++ b/TraceScreen.c
@@ -92,7 +92,7 @@ bool TraceScreen_forkTracer(TraceScreen* this) {
xSnprintf(buffer, sizeof(buffer), "%d", this->super.process->pid);
// Use of NULL in variadic functions must have a pointer cast.
// The NULL constant is not required by standard to have a pointer type.
- execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, (char *)NULL);
+ execlp("strace", "strace", "-T", "-tt", "-s", "512", "-p", buffer, (char*)NULL);
// Should never reach here, unless execlp fails ...
const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 9d1f7933..a3472c53 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -512,7 +512,7 @@ static bool LinuxProcessList_readStatFile(LinuxProcess* lp, openat_arg_t procFd,
}
static bool LinuxProcessList_readStatusFile(Process* process, openat_arg_t procFd) {
- LinuxProcess* lp = (LinuxProcess*) process;
+ LinuxProcess* lp = (LinuxProcess*) process;
unsigned long ctxt = 0;
#ifdef HAVE_VSERVER
@@ -613,7 +613,7 @@ static bool LinuxProcessList_updateUser(ProcessList* processList, Process* proce
}
static void LinuxProcessList_readIoFile(LinuxProcess* lp, openat_arg_t procFd, bool scanMainThread, unsigned long long realtimeMs) {
- Process *process = &lp->super;
+ Process* process = &lp->super;
char path[20] = "io";
char buffer[1024];
if (scanMainThread) {
diff --git a/linux/Platform.c b/linux/Platform.c
index 92da0858..0ab2be4f 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -458,16 +458,16 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) {
continue;
errno = 0;
- char *end = de->d_name;
+ char* end = de->d_name;
int file = strtoull(de->d_name, &end, 10);
if (errno || *end)
continue;
int fd = openat(dfd, de->d_name, O_RDONLY | O_CLOEXEC);
- if(fd == -1)
+ if (fd == -1)
continue;
- FILE *f = fdopen(fd, "r");
- if(!f) {
+ FILE* f = fdopen(fd, "r");
+ if (!f) {
close(fd);
continue;
}
diff --git a/linux/SystemdMeter.c b/linux/SystemdMeter.c
index 848d1e4e..ff178e0e 100644
--- a/linux/SystemdMeter.c
+++ b/linux/SystemdMeter.c
@@ -123,9 +123,9 @@ static int updateViaLib(bool user) {
/* Connect to the system bus */
if (!ctx->bus) {
if (user) {
- r = sym_sd_bus_open_user(&ctx->bus);
+ r = sym_sd_bus_open_user(&ctx->bus);
} else {
- r = sym_sd_bus_open_system(&ctx->bus);
+ r = sym_sd_bus_open_system(&ctx->bus);
}
if (r < 0)
goto busfailure;
@@ -246,7 +246,7 @@ static void updateViaExec(bool user) {
"--property=NNames",
"--property=NJobs",
"--property=NInstalledJobs",
- (char *)NULL);
+ (char*)NULL);
exit(127);
}
close(fdpair[1]);
diff --git a/netbsd/Platform.c b/netbsd/Platform.c
index a79f9c0b..9c9546fe 100644
--- a/netbsd/Platform.c
+++ b/netbsd/Platform.c
@@ -413,7 +413,7 @@ bool Platform_getNetworkIO(NetworkIOData* data) {
if (ifa->ifa_flags & IFF_LOOPBACK)
continue;
- const struct if_data* ifd = (const struct if_data *)ifa->ifa_data;
+ const struct if_data* ifd = (const struct if_data*)ifa->ifa_data;
data->bytesReceived += ifd->ifi_ibytes;
data->packetsReceived += ifd->ifi_ipackets;
diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c
index 8147beeb..a5eb64d6 100644
--- a/pcp/PCPProcessList.c
+++ b/pcp/PCPProcessList.c
@@ -44,7 +44,7 @@ static void PCPProcessList_updateCPUcount(PCPProcessList* this) {
free(this->percpu);
free(this->values);
- this->percpu = xCalloc(cpus, sizeof(pmAtomValue *));
+ this->percpu = xCalloc(cpus, sizeof(pmAtomValue*));
for (unsigned int i = 0; i < cpus; i++)
this->percpu[i] = xCalloc(CPU_METRIC_COUNT, sizeof(pmAtomValue));
this->values = xCalloc(cpus, sizeof(pmAtomValue));

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