diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2011-03-22 20:37:08 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2011-03-22 20:37:08 +0000 |
commit | a9c0ea375323a3f801636f95a76afd0fd1328c5d (patch) | |
tree | 6c8f551197bc53097e4ab2618ca20eb1fe0f0696 /AffinityPanel.c | |
parent | b56195663760d76ea61d9ed15121dd4a13fa68cd (diff) |
* Option for counting CPUs from zero
(thanks to Sean Noonan)
* Meters update in every screen (no longer halting while on Setup, etc.)
Diffstat (limited to 'AffinityPanel.c')
-rw-r--r-- | AffinityPanel.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c index bcd99a32..dcbc5d2f 100644 --- a/AffinityPanel.c +++ b/AffinityPanel.c @@ -3,6 +3,7 @@ #include "Panel.h" #include "CheckItem.h" +#include "ProcessList.h" #include "debug.h" #include <assert.h> @@ -25,14 +26,14 @@ static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) { return result; } -Panel* AffinityPanel_new(int processorCount, unsigned long mask) { +Panel* AffinityPanel_new(ProcessList* pl, unsigned long mask) { Panel* this = Panel_new(1, 1, 1, 1, CHECKITEM_CLASS, true, ListItem_compare); this->eventHandler = AffinityPanel_eventHandler; Panel_setHeader(this, "Use CPUs:"); - for (int i = 0; i < processorCount; i++) { + for (int i = 0; i < pl->cpuCount; i++) { char number[10]; - snprintf(number, 9, "%d", i+1); + snprintf(number, 9, "%d", ProcessList_cpuId(pl, i) + 1); Panel_add(this, (Object*) CheckItem_new(String_copy(number), NULL, mask & (1 << i))); } return this; |