From ba2d59020d7b57ecc5a955f0a8e3e7e5c2a2963d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Tue, 17 Nov 2020 19:41:22 +0100 Subject: DarwinProcess: mark local function static and sort includes --- darwin/DarwinProcess.c | 13 ++++++------- darwin/DarwinProcess.h | 9 ++++----- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'darwin') diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c index c06ec4a6..b8362da7 100644 --- a/darwin/DarwinProcess.c +++ b/darwin/DarwinProcess.c @@ -5,17 +5,16 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ -#include "Process.h" #include "DarwinProcess.h" -#include #include -#include #include - +#include +#include #include #include "CRT.h" +#include "Process.h" const ProcessClass DarwinProcess_class = { @@ -52,7 +51,7 @@ bool Process_isThread(const Process* this) { return false; } -char* DarwinProcess_getCmdLine(struct kinfo_proc* k, int* basenameOffset) { +static char* DarwinProcess_getCmdLine(const struct kinfo_proc* k, int* basenameOffset) { /* This function is from the old Mac version of htop. Originally from ps? */ int mib[3], argmax, nargs, c = 0; size_t size; @@ -195,8 +194,8 @@ ERROR_A: return retval; } -void DarwinProcess_setFromKInfoProc(Process* proc, struct kinfo_proc* ps, bool exists) { - struct extern_proc* ep = &ps->kp_proc; +void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists) { + const struct extern_proc* ep = &ps->kp_proc; /* UNSET HERE : * diff --git a/darwin/DarwinProcess.h b/darwin/DarwinProcess.h index 627a6bcb..98897c93 100644 --- a/darwin/DarwinProcess.h +++ b/darwin/DarwinProcess.h @@ -7,10 +7,11 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ -#include "Settings.h" +#include + #include "DarwinProcessList.h" +#include "Settings.h" -#include typedef struct DarwinProcess_ { Process super; @@ -28,9 +29,7 @@ void Process_delete(Object* cast); bool Process_isThread(const Process* this); -char* DarwinProcess_getCmdLine(struct kinfo_proc* k, int* basenameOffset); - -void DarwinProcess_setFromKInfoProc(Process* proc, struct kinfo_proc* ps, bool exists); +void DarwinProcess_setFromKInfoProc(Process* proc, const struct kinfo_proc* ps, bool exists); void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* dpl); -- cgit v1.2.3