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
78d09f95
Commit
78d09f95
authored
Apr 25, 2014
by
Hisham Muhammad
Browse files
Compare with long, for 64-bit systems
parent
d7e50201
Changes
6
Hide whitespace changes
Inline
Side-by-side
ListItem.c
View file @
78d09f95
...
...
@@ -69,7 +69,7 @@ const char* ListItem_getRef(ListItem* this) {
return
this
->
value
;
}
int
ListItem_compare
(
const
void
*
cast1
,
const
void
*
cast2
)
{
long
ListItem_compare
(
const
void
*
cast1
,
const
void
*
cast2
)
{
ListItem
*
obj1
=
(
ListItem
*
)
cast1
;
ListItem
*
obj2
=
(
ListItem
*
)
cast2
;
return
strcmp
(
obj1
->
value
,
obj2
->
value
);
...
...
ListItem.h
View file @
78d09f95
...
...
@@ -26,7 +26,7 @@ void ListItem_append(ListItem* this, const char* text);
const
char
*
ListItem_getRef
(
ListItem
*
this
);
int
ListItem_compare
(
const
void
*
cast1
,
const
void
*
cast2
);
long
ListItem_compare
(
const
void
*
cast1
,
const
void
*
cast2
);
#endif
Object.c
View file @
78d09f95
...
...
@@ -13,7 +13,7 @@ in the source distribution for its full text.
typedef struct Object_ Object;
typedef void(*Object_Display)(Object*, RichString*);
typedef
int
(*Object_Compare)(const void*, const void*);
typedef
long
(*Object_Compare)(const void*, const void*);
typedef void(*Object_Delete)(Object*);
#define Object_getClass(obj_) ((Object*)(obj_))->klass
...
...
Object.h
View file @
78d09f95
...
...
@@ -14,7 +14,7 @@ in the source distribution for its full text.
typedef
struct
Object_
Object
;
typedef
void
(
*
Object_Display
)(
Object
*
,
RichString
*
);
typedef
int
(
*
Object_Compare
)(
const
void
*
,
const
void
*
);
typedef
long
(
*
Object_Compare
)(
const
void
*
,
const
void
*
);
typedef
void
(
*
Object_Delete
)(
Object
*
);
#define Object_getClass(obj_) ((Object*)(obj_))->klass
...
...
Process.c
View file @
78d09f95
...
...
@@ -793,13 +793,13 @@ void Process_sendSignal(Process* this, size_t sgn) {
kill
(
this
->
pid
,
(
int
)
sgn
);
}
int
Process_pidCompare
(
const
void
*
v1
,
const
void
*
v2
)
{
long
Process_pidCompare
(
const
void
*
v1
,
const
void
*
v2
)
{
Process
*
p1
=
(
Process
*
)
v1
;
Process
*
p2
=
(
Process
*
)
v2
;
return
(
p1
->
pid
-
p2
->
pid
);
}
int
Process_compare
(
const
void
*
v1
,
const
void
*
v2
)
{
long
Process_compare
(
const
void
*
v1
,
const
void
*
v2
)
{
Process
*
p1
,
*
p2
;
ProcessList
*
pl
=
((
Process
*
)
v1
)
->
pl
;
if
(
pl
->
direction
==
1
)
{
...
...
Process.h
View file @
78d09f95
...
...
@@ -232,8 +232,8 @@ bool Process_setAffinity(Process* this, Affinity* affinity);
void
Process_sendSignal
(
Process
*
this
,
size_t
sgn
);
int
Process_pidCompare
(
const
void
*
v1
,
const
void
*
v2
);
long
Process_pidCompare
(
const
void
*
v1
,
const
void
*
v2
);
int
Process_compare
(
const
void
*
v1
,
const
void
*
v2
);
long
Process_compare
(
const
void
*
v1
,
const
void
*
v2
);
#endif
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