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
eb1cd4ac
Commit
eb1cd4ac
authored
Apr 24, 2014
by
Hisham Muhammad
Browse files
change swap to M for consistency. Closes #63.
parent
ab118c2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
SwapMeter.c
View file @
eb1cd4ac
...
...
@@ -30,18 +30,14 @@ int SwapMeter_attributes[] = {
/* NOTE: Value is in kilobytes */
static
void
SwapMeter_humanNumber
(
char
*
buffer
,
const
long
int
*
value
)
{
if
(
*
value
>=
10
*
GIGABYTE
)
sprintf
(
buffer
,
"%ldG "
,
*
value
/
GIGABYTE
);
else
if
(
*
value
>=
10
*
MEGABYTE
)
sprintf
(
buffer
,
"%ldM "
,
*
value
/
MEGABYTE
);
else
sprintf
(
buffer
,
"%ldK "
,
*
value
);
sprintf
(
buffer
,
"%ldM "
,
*
value
/
MEGABYTE
);
}
static
void
SwapMeter_setValues
(
Meter
*
this
,
char
*
buffer
,
int
len
)
{
long
int
usedSwap
=
this
->
pl
->
usedSwap
;
this
->
total
=
this
->
pl
->
totalSwap
;
this
->
values
[
0
]
=
usedSwap
;
snprintf
(
buffer
,
len
,
"%ld/%ldMB"
,
(
long
int
)
usedSwap
/
MEGABYTE
,
(
long
int
)
this
->
total
/
MEGABYTE
);
}
...
...
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