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
8e81119c
Commit
8e81119c
authored
Sep 11, 2015
by
Hisham Muhammad
Browse files
Merge branch 'master' of
https://github.com/hishamhm/htop
parents
0c2ccde3
a92f8039
Changes
10
Show whitespace changes
Inline
Side-by-side
Header.c
View file @
8e81119c
...
@@ -89,7 +89,7 @@ void Header_writeBackToSettings(const Header* this) {
...
@@ -89,7 +89,7 @@ void Header_writeBackToSettings(const Header* this) {
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
Meter
*
meter
=
(
Meter
*
)
Vector_get
(
vec
,
i
);
Meter
*
meter
=
(
Meter
*
)
Vector_get
(
vec
,
i
);
char
*
name
=
calloc
(
64
,
sizeof
(
char
*
));
char
*
name
=
calloc
(
64
,
sizeof
(
char
));
if
(
meter
->
param
)
{
if
(
meter
->
param
)
{
snprintf
(
name
,
63
,
"%s(%d)"
,
As_Meter
(
meter
)
->
name
,
meter
->
param
);
snprintf
(
name
,
63
,
"%s(%d)"
,
As_Meter
(
meter
)
->
name
,
meter
->
param
);
}
else
{
}
else
{
...
...
Meter.c
View file @
8e81119c
...
@@ -157,6 +157,9 @@ int Meter_humanUnit(char* buffer, unsigned long int value, int size) {
...
@@ -157,6 +157,9 @@ int Meter_humanUnit(char* buffer, unsigned long int value, int size) {
++
prefix
;
++
prefix
;
}
}
if
(
*
prefix
==
'K'
)
precision
=
0
;
for
(;
precision
>
0
;
precision
--
)
{
for
(;
precision
>
0
;
precision
--
)
{
powj
*=
10
;
powj
*=
10
;
if
(
value
/
powi
<
powj
)
if
(
value
/
powi
<
powj
)
...
...
Panel.c
View file @
8e81119c
...
@@ -455,7 +455,7 @@ bool Panel_onKey(Panel* this, int key) {
...
@@ -455,7 +455,7 @@ bool Panel_onKey(Panel* this, int key) {
HandlerResult
Panel_selectByTyping
(
Panel
*
this
,
int
ch
)
{
HandlerResult
Panel_selectByTyping
(
Panel
*
this
,
int
ch
)
{
int
size
=
Panel_size
(
this
);
int
size
=
Panel_size
(
this
);
if
(
!
this
->
eventHandlerState
)
if
(
!
this
->
eventHandlerState
)
this
->
eventHandlerState
=
calloc
(
100
,
1
);
this
->
eventHandlerState
=
calloc
(
100
,
sizeof
(
char
)
);
char
*
buffer
=
this
->
eventHandlerState
;
char
*
buffer
=
this
->
eventHandlerState
;
if
(
ch
<
255
&&
isalnum
(
ch
))
{
if
(
ch
<
255
&&
isalnum
(
ch
))
{
...
...
Process.h
View file @
8e81119c
...
@@ -158,8 +158,6 @@ typedef struct ProcessClass_ {
...
@@ -158,8 +158,6 @@ typedef struct ProcessClass_ {
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K)
#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K)
extern
char
Process_pidFormat
[
20
];
void
Process_setupColumnWidths
();
void
Process_setupColumnWidths
();
void
Process_humanNumber
(
RichString
*
str
,
unsigned
long
number
,
bool
coloring
);
void
Process_humanNumber
(
RichString
*
str
,
unsigned
long
number
,
bool
coloring
);
...
...
darwin/DarwinProcess.c
View file @
8e81119c
...
@@ -39,7 +39,7 @@ ProcessClass DarwinProcess_class = {
...
@@ -39,7 +39,7 @@ ProcessClass DarwinProcess_class = {
};
};
DarwinProcess
*
DarwinProcess_new
(
Settings
*
settings
)
{
DarwinProcess
*
DarwinProcess_new
(
Settings
*
settings
)
{
DarwinProcess
*
this
=
calloc
(
sizeof
(
DarwinProcess
)
,
1
);
DarwinProcess
*
this
=
calloc
(
1
,
sizeof
(
DarwinProcess
));
Object_setClass
(
this
,
Class
(
DarwinProcess
));
Object_setClass
(
this
,
Class
(
DarwinProcess
));
Process_init
(
&
this
->
super
,
settings
);
Process_init
(
&
this
->
super
,
settings
);
...
...
darwin/Platform.c
View file @
8e81119c
...
@@ -81,7 +81,6 @@ void Platform_setBindings(Htop_Action* keys) {
...
@@ -81,7 +81,6 @@ void Platform_setBindings(Htop_Action* keys) {
}
}
int
Platform_numberOfFields
=
100
;
int
Platform_numberOfFields
=
100
;
char
*
Process_pidFormat
=
"%7u "
;
int
Platform_getUptime
()
{
int
Platform_getUptime
()
{
struct
timeval
bootTime
,
currTime
;
struct
timeval
bootTime
,
currTime
;
...
...
darwin/Platform.h
View file @
8e81119c
...
@@ -23,7 +23,6 @@ extern MeterClass* Platform_meterTypes[];
...
@@ -23,7 +23,6 @@ extern MeterClass* Platform_meterTypes[];
void
Platform_setBindings
(
Htop_Action
*
keys
);
void
Platform_setBindings
(
Htop_Action
*
keys
);
extern
int
Platform_numberOfFields
;
extern
int
Platform_numberOfFields
;
extern
char
*
Process_pidFormat
;
int
Platform_getUptime
();
int
Platform_getUptime
();
...
...
freebsd/FreeBSDProcess.c
View file @
8e81119c
...
@@ -86,7 +86,7 @@ ProcessPidColumn Process_pidColumns[] = {
...
@@ -86,7 +86,7 @@ ProcessPidColumn Process_pidColumns[] = {
};
};
FreeBSDProcess
*
FreeBSDProcess_new
(
Settings
*
settings
)
{
FreeBSDProcess
*
FreeBSDProcess_new
(
Settings
*
settings
)
{
FreeBSDProcess
*
this
=
calloc
(
sizeof
(
FreeBSDProcess
)
,
1
);
FreeBSDProcess
*
this
=
calloc
(
1
,
sizeof
(
FreeBSDProcess
));
Object_setClass
(
this
,
Class
(
FreeBSDProcess
));
Object_setClass
(
this
,
Class
(
FreeBSDProcess
));
Process_init
(
&
this
->
super
,
settings
);
Process_init
(
&
this
->
super
,
settings
);
return
this
;
return
this
;
...
...
linux/LinuxProcess.c
View file @
8e81119c
...
@@ -242,7 +242,7 @@ ProcessClass LinuxProcess_class = {
...
@@ -242,7 +242,7 @@ ProcessClass LinuxProcess_class = {
};
};
LinuxProcess
*
LinuxProcess_new
(
Settings
*
settings
)
{
LinuxProcess
*
LinuxProcess_new
(
Settings
*
settings
)
{
LinuxProcess
*
this
=
calloc
(
sizeof
(
LinuxProcess
)
,
1
);
LinuxProcess
*
this
=
calloc
(
1
,
sizeof
(
LinuxProcess
));
Object_setClass
(
this
,
Class
(
LinuxProcess
));
Object_setClass
(
this
,
Class
(
LinuxProcess
));
Process_init
(
&
this
->
super
,
settings
);
Process_init
(
&
this
->
super
,
settings
);
return
this
;
return
this
;
...
...
unsupported/UnsupportedProcess.c
View file @
8e81119c
...
@@ -17,7 +17,7 @@ in the source distribution for its full text.
...
@@ -17,7 +17,7 @@ in the source distribution for its full text.
}*/
}*/
Process
*
UnsupportedProcess_new
(
Settings
*
settings
)
{
Process
*
UnsupportedProcess_new
(
Settings
*
settings
)
{
Process
*
this
=
calloc
(
sizeof
(
Process
)
,
1
);
Process
*
this
=
calloc
(
1
,
sizeof
(
Process
));
Object_setClass
(
this
,
Class
(
Process
));
Object_setClass
(
this
,
Class
(
Process
));
Process_init
(
this
,
settings
);
Process_init
(
this
,
settings
);
return
this
;
return
this
;
...
...
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