summaryrefslogtreecommitdiffstats
path: root/darwin
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2023-05-08 10:08:20 +1000
committerNathan Scott <nathans@redhat.com>2023-05-08 13:07:50 +1000
commit290ddba35e7a1463c1a9fc5ff6bd723cd1670ba2 (patch)
treea31bbb5623459e4f4038f7876ab6b14e31004e14 /darwin
parent72235d8e098d9d79029dca65122605741e1aafad (diff)
Minor whitespace and small logic flow improvements on review
Quality improvements from BenBE as part of review for #1234.
Diffstat (limited to 'darwin')
-rw-r--r--darwin/DarwinMachine.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/darwin/DarwinMachine.c b/darwin/DarwinMachine.c
index 6bf52b76..1290e959 100644
--- a/darwin/DarwinMachine.c
+++ b/darwin/DarwinMachine.c
@@ -1,6 +1,7 @@
/*
htop - DarwinMachine.c
(C) 2014 Hisham H. Muhammad
+(C) 2023 htop dev team
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
@@ -33,12 +34,17 @@ static void DarwinMachine_getHostInfo(host_basic_info_data_t* p) {
}
static void DarwinMachine_freeCPULoadInfo(processor_cpu_load_info_t* p) {
- if (NULL != p && NULL != *p) {
- if (0 != munmap(*p, vm_page_size)) {
- CRT_fatalError("Unable to free old CPU load information");
- }
- *p = NULL;
+ if (!p)
+ return;
+
+ if (!*p)
+ return;
+
+ if (0 != munmap(*p, vm_page_size)) {
+ CRT_fatalError("Unable to free old CPU load information");
}
+
+ *p = NULL;
}
static unsigned DarwinMachine_allocateCPULoadInfo(processor_cpu_load_info_t* p) {

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