mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
Spacing around operators
This commit is contained in:
@ -83,7 +83,7 @@ static void FreeBSDProcess_writeField(const Process* this, RichString* str, Proc
|
||||
switch ((int) field) {
|
||||
// add FreeBSD-specific fields here
|
||||
case JID: xSnprintf(buffer, n, Process_pidFormat, fp->jid); break;
|
||||
case JAIL:{
|
||||
case JAIL: {
|
||||
xSnprintf(buffer, n, "%-11s ", fp->jname);
|
||||
if (buffer[11] != '\0') {
|
||||
buffer[11] = ' ';
|
||||
|
@ -175,8 +175,8 @@ static inline void FreeBSDProcessList_scanCPUTime(ProcessList* pl) {
|
||||
|
||||
size_t sizeof_cp_time_array;
|
||||
|
||||
unsigned long *cp_time_n; // old clicks state
|
||||
unsigned long *cp_time_o; // current clicks state
|
||||
unsigned long* cp_time_n; // old clicks state
|
||||
unsigned long* cp_time_o; // current clicks state
|
||||
|
||||
unsigned long cp_time_d[CPUSTATES];
|
||||
double cp_time_p[CPUSTATES];
|
||||
@ -415,18 +415,18 @@ static char* FreeBSDProcessList_readJailName(const struct kinfo_proc* kproc) {
|
||||
char* jname;
|
||||
char jnamebuf[MAXHOSTNAMELEN];
|
||||
|
||||
if (kproc->ki_jid != 0 ){
|
||||
if (kproc->ki_jid != 0 ) {
|
||||
memset(jnamebuf, 0, sizeof(jnamebuf));
|
||||
IGNORE_WCASTQUAL_BEGIN
|
||||
*(const void **)&jiov[0].iov_base = "jid";
|
||||
*(const void**)&jiov[0].iov_base = "jid";
|
||||
jiov[0].iov_len = sizeof("jid");
|
||||
jiov[1].iov_base = (void*) &kproc->ki_jid;
|
||||
jiov[1].iov_len = sizeof(kproc->ki_jid);
|
||||
*(const void **)&jiov[2].iov_base = "name";
|
||||
*(const void**)&jiov[2].iov_base = "name";
|
||||
jiov[2].iov_len = sizeof("name");
|
||||
jiov[3].iov_base = jnamebuf;
|
||||
jiov[3].iov_len = sizeof(jnamebuf);
|
||||
*(const void **)&jiov[4].iov_base = "errmsg";
|
||||
*(const void**)&jiov[4].iov_base = "errmsg";
|
||||
jiov[4].iov_len = sizeof("errmsg");
|
||||
jiov[5].iov_base = jail_errmsg;
|
||||
jiov[5].iov_len = JAIL_ERRMSGLEN;
|
||||
@ -446,8 +446,8 @@ IGNORE_WCASTQUAL_END
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
jnamebuf[0]='-';
|
||||
jnamebuf[1]='\0';
|
||||
jnamebuf[0] = '-';
|
||||
jnamebuf[1] = '\0';
|
||||
jname = xStrdup(jnamebuf);
|
||||
}
|
||||
return jname;
|
||||
|
@ -48,11 +48,11 @@ typedef struct FreeBSDProcessList_ {
|
||||
|
||||
Hashtable* ttys;
|
||||
|
||||
unsigned long *cp_time_o;
|
||||
unsigned long *cp_time_n;
|
||||
unsigned long* cp_time_o;
|
||||
unsigned long* cp_time_n;
|
||||
|
||||
unsigned long *cp_times_o;
|
||||
unsigned long *cp_times_n;
|
||||
unsigned long* cp_times_o;
|
||||
unsigned long* cp_times_n;
|
||||
|
||||
} FreeBSDProcessList;
|
||||
|
||||
|
@ -180,11 +180,11 @@ double Platform_setCPUValues(Meter* this, int cpu) {
|
||||
v[CPU_METER_KERNEL] = cpuData->systemPercent;
|
||||
v[CPU_METER_IRQ] = cpuData->irqPercent;
|
||||
this->curItems = 4;
|
||||
percent = v[0]+v[1]+v[2]+v[3];
|
||||
percent = v[0] + v[1] + v[2] + v[3];
|
||||
} else {
|
||||
v[2] = cpuData->systemAllPercent;
|
||||
this->curItems = 3;
|
||||
percent = v[0]+v[1]+v[2];
|
||||
percent = v[0] + v[1] + v[2];
|
||||
}
|
||||
|
||||
percent = CLAMP(percent, 0.0, 100.0);
|
||||
@ -234,10 +234,10 @@ char* Platform_getProcessEnv(pid_t pid) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (env[capacity-1] || env[capacity-2]) {
|
||||
env = xRealloc(env, capacity+2);
|
||||
if (env[capacity - 1] || env[capacity - 2]) {
|
||||
env = xRealloc(env, capacity + 2);
|
||||
env[capacity] = 0;
|
||||
env[capacity+1] = 0;
|
||||
env[capacity + 1] = 0;
|
||||
}
|
||||
|
||||
return env;
|
||||
@ -283,10 +283,10 @@ bool Platform_getDiskIO(DiskIOData* data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Platform_getNetworkIO(unsigned long int *bytesReceived,
|
||||
unsigned long int *packetsReceived,
|
||||
unsigned long int *bytesTransmitted,
|
||||
unsigned long int *packetsTransmitted) {
|
||||
bool Platform_getNetworkIO(unsigned long int* bytesReceived,
|
||||
unsigned long int* packetsReceived,
|
||||
unsigned long int* bytesTransmitted,
|
||||
unsigned long int* packetsTransmitted) {
|
||||
int r;
|
||||
|
||||
// get number of interfaces
|
||||
|
@ -46,9 +46,9 @@ char* Platform_getProcessEnv(pid_t pid);
|
||||
|
||||
bool Platform_getDiskIO(DiskIOData* data);
|
||||
|
||||
bool Platform_getNetworkIO(unsigned long int *bytesReceived,
|
||||
unsigned long int *packetsReceived,
|
||||
unsigned long int *bytesTransmitted,
|
||||
unsigned long int *packetsTransmitted);
|
||||
bool Platform_getNetworkIO(unsigned long int* bytesReceived,
|
||||
unsigned long int* packetsReceived,
|
||||
unsigned long int* bytesTransmitted,
|
||||
unsigned long int* packetsTransmitted);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user