Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
f7fe4b47
Commit
f7fe4b47
authored
13 years ago
by
Hisham Muhammad
Browse files
Options
Download
Email Patches
Plain Diff
Fix off-by-one error in PROCESSOR display
parent
4e72e790
master
darwin-cpu-average
fixedgray
freebsd
linear-graph-scan
lua
next
perfcounters
pkgconfig-on-linux
solaris
sreclaimable
travis-ci
wip
3.0.0beta5
3.0.0beta4
3.0.0beta3
3.0.0beta2
3.0.0beta1
2.2.0
2.1.0
2.0.2
2.0.1
2.0.0
1.0.3
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
AffinityPanel.c
+1
-1
AffinityPanel.c
CPUMeter.c
+1
-1
CPUMeter.c
ProcessList.c
+1
-1
ProcessList.c
ProcessList.h
+1
-1
ProcessList.h
htop.c
+1
-1
htop.c
with
5 additions
and
5 deletions
+5
-5
AffinityPanel.c
View file @
f7fe4b47
...
...
@@ -33,7 +33,7 @@ Panel* AffinityPanel_new(ProcessList* pl, unsigned long mask) {
Panel_setHeader
(
this
,
"Use CPUs:"
);
for
(
int
i
=
0
;
i
<
pl
->
cpuCount
;
i
++
)
{
char
number
[
10
];
snprintf
(
number
,
9
,
"%d"
,
ProcessList_cpuId
(
pl
,
i
)
+
1
);
snprintf
(
number
,
9
,
"%d"
,
ProcessList_cpuId
(
pl
,
i
));
Panel_add
(
this
,
(
Object
*
)
CheckItem_new
(
String_copy
(
number
),
NULL
,
mask
&
(
1
<<
i
)));
}
return
this
;
...
...
This diff is collapsed.
Click to expand it.
CPUMeter.c
View file @
f7fe4b47
...
...
@@ -33,7 +33,7 @@ static void CPUMeter_init(Meter* this) {
int
cpu
=
this
->
param
;
if
(
this
->
pl
->
cpuCount
>
1
)
{
char
caption
[
10
];
sprintf
(
caption
,
"%-3d"
,
ProcessList_cpuId
(
this
->
pl
,
cpu
));
sprintf
(
caption
,
"%-3d"
,
ProcessList_cpuId
(
this
->
pl
,
cpu
-
1
));
Meter_setCaption
(
this
,
caption
);
}
if
(
this
->
param
==
0
)
...
...
This diff is collapsed.
Click to expand it.
ProcessList.c
View file @
f7fe4b47
...
...
@@ -55,7 +55,7 @@ in the source distribution for its full text.
#endif
#ifndef ProcessList_cpuId
#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu)
-1
: (cpu))
#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu) : (cpu)
+1
)
#endif
}*/
...
...
This diff is collapsed.
Click to expand it.
ProcessList.h
View file @
f7fe4b47
...
...
@@ -57,7 +57,7 @@ in the source distribution for its full text.
#endif
#ifndef ProcessList_cpuId
#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu)
-1
: (cpu))
#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu) : (cpu)
+1
)
#endif
...
...
This diff is collapsed.
Click to expand it.
htop.c
View file @
f7fe4b47
...
...
@@ -778,7 +778,7 @@ int main(int argc, char** argv) {
if
(
!
ok
)
beep
();
}
((
Object
*
)
affinity
Panel
)
->
delete
((
Object
*
)
affinityPanel
);
Panel
_
delete
((
Object
*
)
affinityPanel
);
ProcessList_printHeader
(
pl
,
Panel_getHeader
(
panel
));
refreshTimeout
=
0
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help