Skip to content
GitLab
Menu
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
bd93b2e1
Commit
bd93b2e1
authored
Oct 24, 2015
by
Hisham Muhammad
Browse files
Initialize variables, silence warnings.
parent
71190654
Changes
2
Show whitespace changes
Inline
Side-by-side
darwin/DarwinProcessList.c
View file @
bd93b2e1
...
...
@@ -16,6 +16,7 @@ in the source distribution for its full text.
#include <libproc.h>
#include <sys/mman.h>
#include <utmpx.h>
#include <err.h>
/*{
#include "ProcessList.h"
...
...
darwin/Platform.c
View file @
bd93b2e1
...
...
@@ -167,7 +167,10 @@ ProcessPidColumn Process_pidColumns[] = {
static
double
Platform_setCPUAverageValues
(
Meter
*
mtr
)
{
DarwinProcessList
*
dpl
=
(
DarwinProcessList
*
)
mtr
->
pl
;
int
cpus
=
dpl
->
super
.
cpuCount
;
double
sumNice
,
sumNormal
,
sumKernel
,
sumPercent
;
double
sumNice
=
0
.
0
;
double
sumNormal
=
0
.
0
;
double
sumKernel
=
0
.
0
;
double
sumPercent
=
0
.
0
;
for
(
int
i
=
1
;
i
<=
cpus
;
i
++
)
{
sumPercent
+=
Platform_setCPUValues
(
mtr
,
i
);
sumNice
+=
mtr
->
values
[
CPU_METER_NICE
];
...
...
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