mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Spacing after keywords (if)
This commit is contained in:
@ -13,7 +13,7 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
|
||||
*level = NAN;
|
||||
*isOnAC = AC_ERROR;
|
||||
|
||||
if(NULL == power_sources) {
|
||||
if (NULL == power_sources) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
|
||||
CFDictionaryRef battery = NULL;
|
||||
int len;
|
||||
|
||||
if(NULL == list) {
|
||||
if (NULL == list) {
|
||||
CFRelease(power_sources);
|
||||
|
||||
return;
|
||||
@ -35,18 +35,18 @@ void Battery_getData(double* level, ACPresence* isOnAC) {
|
||||
CFArrayGetValueAtIndex(list, i)); /* GET rule */
|
||||
CFStringRef type;
|
||||
|
||||
if(NULL != candidate) {
|
||||
if (NULL != candidate) {
|
||||
type = (CFStringRef) CFDictionaryGetValue(candidate,
|
||||
CFSTR(kIOPSTransportTypeKey)); /* GET rule */
|
||||
|
||||
if(kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) {
|
||||
if (kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) {
|
||||
CFRetain(candidate);
|
||||
battery = candidate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(NULL != battery) {
|
||||
if (NULL != battery) {
|
||||
/* Determine the AC state */
|
||||
CFStringRef power_state = CFDictionaryGetValue(battery, CFSTR(kIOPSPowerSourceStateKey));
|
||||
|
||||
|
@ -212,7 +212,7 @@ void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, bool e
|
||||
*/
|
||||
|
||||
/* First, the "immutable" parts */
|
||||
if(!exists) {
|
||||
if (!exists) {
|
||||
/* Set the PID/PGID/etc. */
|
||||
proc->pid = ep->p_pid;
|
||||
proc->ppid = ps->kp_eproc.e_ppid;
|
||||
@ -244,8 +244,8 @@ void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, bool e
|
||||
void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList *dpl) {
|
||||
struct proc_taskinfo pti;
|
||||
|
||||
if(sizeof(pti) == proc_pidinfo(proc->super.pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) {
|
||||
if(0 != proc->utime || 0 != proc->stime) {
|
||||
if (sizeof(pti) == proc_pidinfo(proc->super.pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) {
|
||||
if (0 != proc->utime || 0 != proc->stime) {
|
||||
uint64_t diff = (pti.pti_total_system - proc->stime)
|
||||
+ (pti.pti_total_user - proc->utime);
|
||||
|
||||
|
@ -57,14 +57,14 @@ int CompareKernelVersion(short int major, short int minor, short int component)
|
||||
void ProcessList_getHostInfo(host_basic_info_data_t *p) {
|
||||
mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT;
|
||||
|
||||
if(0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) {
|
||||
if (0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) {
|
||||
CRT_fatalError("Unable to retrieve host info\n");
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p) {
|
||||
if(NULL != p && NULL != *p) {
|
||||
if(0 != munmap(*p, vm_page_size)) {
|
||||
if (NULL != p && NULL != *p) {
|
||||
if (0 != munmap(*p, vm_page_size)) {
|
||||
CRT_fatalError("Unable to free old CPU load information\n");
|
||||
}
|
||||
*p = NULL;
|
||||
@ -76,7 +76,7 @@ unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) {
|
||||
unsigned cpu_count;
|
||||
|
||||
// TODO Improving the accuracy of the load counts woule help a lot.
|
||||
if(0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t *)p, &info_size)) {
|
||||
if (0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t *)p, &info_size)) {
|
||||
CRT_fatalError("Unable to retrieve CPU info\n");
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) {
|
||||
|
||||
super->totalTasks += 1;
|
||||
|
||||
if(!preExisting) {
|
||||
if (!preExisting) {
|
||||
proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid);
|
||||
|
||||
ProcessList_add(super, &proc->super);
|
||||
|
@ -149,7 +149,7 @@ int Platform_getUptime() {
|
||||
void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
|
||||
double results[3];
|
||||
|
||||
if(3 == getloadavg(results, 3)) {
|
||||
if (3 == getloadavg(results, 3)) {
|
||||
*one = results[0];
|
||||
*five = results[1];
|
||||
*fifteen = results[2];
|
||||
|
Reference in New Issue
Block a user