mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 13:04:35 +03:00
Spacing around operators
This commit is contained in:
@ -92,7 +92,7 @@ void DragonFlyBSDProcess_writeField(const Process* this, RichString* str, Proces
|
||||
// add Platform-specific fields here
|
||||
case PID: xSnprintf(buffer, n, Process_pidFormat, (fp->kernel ? -1 : this->pid)); break;
|
||||
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] = ' ';
|
||||
|
@ -149,8 +149,8 @@ static inline void DragonFlyBSDProcessList_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];
|
||||
@ -296,9 +296,9 @@ char* DragonFlyBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kpro
|
||||
|
||||
static inline void DragonFlyBSDProcessList_scanJails(DragonFlyBSDProcessList* dfpl) {
|
||||
size_t len;
|
||||
char *jls; /* Jail list */
|
||||
char *curpos;
|
||||
char *nextpos;
|
||||
char* jls; /* Jail list */
|
||||
char* curpos;
|
||||
char* nextpos;
|
||||
|
||||
if (sysctlbyname("jail.list", NULL, &len, NULL, 0) == -1) {
|
||||
fprintf(stderr, "initial sysctlbyname / jail.list failed\n");
|
||||
@ -329,7 +329,7 @@ retry:
|
||||
curpos = jls;
|
||||
while (curpos) {
|
||||
int jailid;
|
||||
char *str_hostname;
|
||||
char* str_hostname;
|
||||
nextpos = strchr(curpos, '\n');
|
||||
if (nextpos)
|
||||
*nextpos++ = 0;
|
||||
@ -337,7 +337,7 @@ retry:
|
||||
jailid = atoi(strtok(curpos, " "));
|
||||
str_hostname = strtok(NULL, " ");
|
||||
|
||||
char *jname = (char *) (Hashtable_get(dfpl->jails, jailid));
|
||||
char* jname = (char*) (Hashtable_get(dfpl->jails, jailid));
|
||||
if (jname == NULL) {
|
||||
jname = xStrdup(str_hostname);
|
||||
Hashtable_put(dfpl->jails, jailid, jname);
|
||||
@ -353,7 +353,7 @@ char* DragonFlyBSDProcessList_readJailName(DragonFlyBSDProcessList* dfpl, int ja
|
||||
char* hostname;
|
||||
char* jname;
|
||||
|
||||
if (jailid != 0 && dfpl->jails && (hostname = (char *)Hashtable_get(dfpl->jails, jailid))) {
|
||||
if (jailid != 0 && dfpl->jails && (hostname = (char*)Hashtable_get(dfpl->jails, jailid))) {
|
||||
jname = xStrdup(hostname);
|
||||
} else {
|
||||
jname = xStrdup("-");
|
||||
|
@ -42,13 +42,13 @@ typedef struct DragonFlyBSDProcessList_ {
|
||||
|
||||
CPUData* cpus;
|
||||
|
||||
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;
|
||||
|
||||
Hashtable *jails;
|
||||
Hashtable* jails;
|
||||
} DragonFlyBSDProcessList;
|
||||
|
||||
ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidMatchList, uid_t userId);
|
||||
|
@ -169,11 +169,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);
|
||||
@ -212,10 +212,10 @@ bool Platform_getDiskIO(DiskIOData* data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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) {
|
||||
// TODO
|
||||
*bytesReceived = 0;
|
||||
*packetsReceived = 0;
|
||||
|
@ -43,9 +43,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