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
4597014e
Commit
4597014e
authored
Aug 20, 2015
by
Hisham Muhammad
Browse files
Standardize variable name.
parent
f019f4cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Meter.c
View file @
4597014e
...
...
@@ -329,7 +329,7 @@ static const char* GraphMeterMode_dotsAscii[] = {
};
static
const
char
**
GraphMeterMode_dots
;
static
int
pix
p
er
r
ow
;
static
int
GraphMeterMode_
pix
P
er
R
ow
;
static
void
GraphMeterMode_draw
(
Meter
*
this
,
int
x
,
int
y
,
int
w
)
{
...
...
@@ -340,12 +340,12 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
#ifdef HAVE_LIBNCURSESW
if
(
CRT_utf8
)
{
GraphMeterMode_dots
=
GraphMeterMode_dotsUtf8
;
pix
p
er
r
ow
=
PIXPERROW_UTF8
;
GraphMeterMode_
pix
P
er
R
ow
=
PIXPERROW_UTF8
;
}
else
#endif
{
GraphMeterMode_dots
=
GraphMeterMode_dotsAscii
;
pix
p
er
r
ow
=
PIXPERROW_ASCII
;
GraphMeterMode_
pix
P
er
R
ow
=
PIXPERROW_ASCII
;
}
attrset
(
CRT_colors
[
METER_TEXT
]);
...
...
@@ -375,17 +375,17 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
}
for
(
int
i
=
nValues
-
(
w
*
2
)
+
2
,
k
=
0
;
i
<
nValues
;
i
+=
2
,
k
++
)
{
const
double
dot
=
(
1
.
0
/
(
pix
p
er
r
ow
*
4
));
int
v1
=
MIN
(
pix
p
er
r
ow
*
4
,
MAX
(
1
,
data
->
values
[
i
]
/
dot
));
int
v2
=
MIN
(
pix
p
er
r
ow
*
4
,
MAX
(
1
,
data
->
values
[
i
+
1
]
/
dot
));
const
double
dot
=
(
1
.
0
/
(
GraphMeterMode_
pix
P
er
R
ow
*
4
));
int
v1
=
MIN
(
GraphMeterMode_
pix
P
er
R
ow
*
4
,
MAX
(
1
,
data
->
values
[
i
]
/
dot
));
int
v2
=
MIN
(
GraphMeterMode_
pix
P
er
R
ow
*
4
,
MAX
(
1
,
data
->
values
[
i
+
1
]
/
dot
));
int
colorIdx
=
GRAPH_1
;
for
(
int
line
=
0
;
line
<
4
;
line
++
)
{
int
line1
=
MIN
(
pix
p
er
r
ow
,
MAX
(
0
,
v1
-
(
pix
p
er
r
ow
*
(
3
-
line
))));
int
line2
=
MIN
(
pix
p
er
r
ow
,
MAX
(
0
,
v2
-
(
pix
p
er
r
ow
*
(
3
-
line
))));
int
line1
=
MIN
(
GraphMeterMode_
pix
P
er
R
ow
,
MAX
(
0
,
v1
-
(
GraphMeterMode_
pix
P
er
R
ow
*
(
3
-
line
))));
int
line2
=
MIN
(
GraphMeterMode_
pix
P
er
R
ow
,
MAX
(
0
,
v2
-
(
GraphMeterMode_
pix
P
er
R
ow
*
(
3
-
line
))));
attrset
(
CRT_colors
[
colorIdx
]);
mvaddstr
(
y
+
line
,
x
+
k
,
GraphMeterMode_dots
[
line1
*
(
pix
p
er
r
ow
+
1
)
+
line2
]);
mvaddstr
(
y
+
line
,
x
+
k
,
GraphMeterMode_dots
[
line1
*
(
GraphMeterMode_
pix
P
er
R
ow
+
1
)
+
line2
]);
colorIdx
=
GRAPH_2
;
}
}
...
...
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