summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-02-05 14:12:49 +0100
committerChristian Göttsche <cgzones@googlemail.com>2021-02-05 14:12:49 +0100
commitfd4e6b432bcc0d6bac1a15a2ea492b4a540b75a1 (patch)
tree559e4dde1887a4f75b10309e2eddbf6843497ef0 /htop.c
parentfd1ad863dca36da7166d9767218f5382074de4d2 (diff)
Use MainPanel type in State struct
The State struct holds a pointer to the main process panel. Use the distinct MainPanel type, to improve maintainability regrading its usage. This avoids usages of down-casts from Panel to MainPanel, only up-casts from MainPanel to Panel are now required.
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/htop.c b/htop.c
index 51f2f4e3..65ad21e4 100644
--- a/htop.c
+++ b/htop.c
@@ -294,9 +294,8 @@ static void millisleep(unsigned long millisec) {
}
static void setCommFilter(State* state, char** commFilter) {
- MainPanel* panel = (MainPanel*)state->panel;
ProcessList* pl = state->pl;
- IncSet* inc = panel->inc;
+ IncSet* inc = state->mainPanel->inc;
IncSet_setFilter(inc, *commFilter);
pl->incFilter = IncSet_filter(inc);
@@ -453,7 +452,7 @@ int main(int argc, char** argv) {
.settings = settings,
.ut = ut,
.pl = pl,
- .panel = (Panel*) panel,
+ .mainPanel = panel,
.header = header,
.pauseProcessUpdate = false,
.hideProcessSelection = false,

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