Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f5d7ee1a
Commit
f5d7ee1a
authored
Aug 30, 2016
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rbtree.h: Store compare function instead of wine_rb_functions in wine_rb_tree.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
002af352
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
rbtree.h
include/wine/rbtree.h
+4
-4
No files found.
include/wine/rbtree.h
View file @
f5d7ee1a
...
@@ -44,7 +44,7 @@ struct wine_rb_functions
...
@@ -44,7 +44,7 @@ struct wine_rb_functions
struct
wine_rb_tree
struct
wine_rb_tree
{
{
const
struct
wine_rb_functions
*
functions
;
int
(
*
compare
)(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
;
struct
wine_rb_entry
*
root
;
struct
wine_rb_entry
*
root
;
};
};
...
@@ -131,7 +131,7 @@ static inline void wine_rb_postorder(struct wine_rb_tree *tree, wine_rb_traverse
...
@@ -131,7 +131,7 @@ static inline void wine_rb_postorder(struct wine_rb_tree *tree, wine_rb_traverse
static
inline
int
wine_rb_init
(
struct
wine_rb_tree
*
tree
,
const
struct
wine_rb_functions
*
functions
)
static
inline
int
wine_rb_init
(
struct
wine_rb_tree
*
tree
,
const
struct
wine_rb_functions
*
functions
)
{
{
tree
->
functions
=
functions
;
tree
->
compare
=
functions
->
compare
;
tree
->
root
=
NULL
;
tree
->
root
=
NULL
;
return
0
;
return
0
;
...
@@ -159,7 +159,7 @@ static inline struct wine_rb_entry *wine_rb_get(const struct wine_rb_tree *tree,
...
@@ -159,7 +159,7 @@ static inline struct wine_rb_entry *wine_rb_get(const struct wine_rb_tree *tree,
struct
wine_rb_entry
*
entry
=
tree
->
root
;
struct
wine_rb_entry
*
entry
=
tree
->
root
;
while
(
entry
)
while
(
entry
)
{
{
int
c
=
tree
->
functions
->
compare
(
key
,
entry
);
int
c
=
tree
->
compare
(
key
,
entry
);
if
(
!
c
)
return
entry
;
if
(
!
c
)
return
entry
;
entry
=
c
<
0
?
entry
->
left
:
entry
->
right
;
entry
=
c
<
0
?
entry
->
left
:
entry
->
right
;
}
}
...
@@ -175,7 +175,7 @@ static inline int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct
...
@@ -175,7 +175,7 @@ static inline int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct
int
c
;
int
c
;
parent
=
*
iter
;
parent
=
*
iter
;
c
=
tree
->
functions
->
compare
(
key
,
parent
);
c
=
tree
->
compare
(
key
,
parent
);
if
(
!
c
)
return
-
1
;
if
(
!
c
)
return
-
1
;
else
if
(
c
<
0
)
iter
=
&
parent
->
left
;
else
if
(
c
<
0
)
iter
=
&
parent
->
left
;
else
iter
=
&
parent
->
right
;
else
iter
=
&
parent
->
right
;
...
...
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