mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
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.
This commit is contained in:
5
htop.c
5
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,
|
||||
|
Reference in New Issue
Block a user