mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-14 13:04:35 +03:00
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
This commit is contained in:
@ -7,6 +7,23 @@
|
||||
#include "debug.h"
|
||||
#include <assert.h>
|
||||
|
||||
static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
|
||||
HandlerResult result = IGNORED;
|
||||
CheckItem* selected = (CheckItem*) Panel_getSelected(this);
|
||||
switch(ch) {
|
||||
case ' ':
|
||||
CheckItem_set(selected, ! (CheckItem_get(selected)) );
|
||||
result = HANDLED;
|
||||
break;
|
||||
case 0x0a:
|
||||
case 0x0d:
|
||||
case KEY_ENTER:
|
||||
result = BREAK_LOOP;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Panel* AffinityPanel_new(int processorCount, unsigned long mask) {
|
||||
Panel* this = Panel_new(1, 1, 1, 1, CHECKITEM_CLASS, true, ListItem_compare);
|
||||
this->eventHandler = AffinityPanel_eventHandler;
|
||||
@ -29,20 +46,3 @@ unsigned long AffinityPanel_getAffinity(Panel* this) {
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
|
||||
HandlerResult result = IGNORED;
|
||||
CheckItem* selected = (CheckItem*) Panel_getSelected(this);
|
||||
switch(ch) {
|
||||
case ' ':
|
||||
CheckItem_set(selected, ! (CheckItem_get(selected)) );
|
||||
result = HANDLED;
|
||||
break;
|
||||
case 0x0a:
|
||||
case 0x0d:
|
||||
case KEY_ENTER:
|
||||
result = BREAK_LOOP;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user