diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-02-05 14:12:49 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-02-05 14:12:49 +0100 |
commit | fd4e6b432bcc0d6bac1a15a2ea492b4a540b75a1 (patch) | |
tree | 559e4dde1887a4f75b10309e2eddbf6843497ef0 /htop.c | |
parent | fd1ad863dca36da7166d9767218f5382074de4d2 (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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, |