mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
Fixed some of the splay tree macros. Actually some are even wrong in the DDK, but it's necessary to make compilers happy that stick to the standards more closely
svn path=/trunk/; revision=19049
This commit is contained in:
parent
e57c6af315
commit
c7e90a00b9
1 changed files with 26 additions and 20 deletions
|
@ -25,39 +25,45 @@
|
|||
(RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
|
||||
|
||||
#define RtlRightChild(Links) \
|
||||
(PRTL_SPLAY_LINKS)(Links)->RightChild
|
||||
((PRTL_SPLAY_LINKS)(Links))->RightChild
|
||||
|
||||
#define RtlIsRoot(Links) \
|
||||
(RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
|
||||
|
||||
#define RtlLeftChild(Links) \
|
||||
(PRTL_SPLAY_LINKS)(Links)->LeftChild
|
||||
((PRTL_SPLAY_LINKS)(Links))->LeftChild
|
||||
|
||||
#define RtlParent(Links) \
|
||||
(PRTL_SPLAY_LINKS)(Links)->Parent
|
||||
((PRTL_SPLAY_LINKS)(Links))->Parent
|
||||
|
||||
#define RtlInitializeSplayLinks(Links) \
|
||||
PRTL_SPLAY_LINKS _SplayLinks; \
|
||||
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
|
||||
_SplayLinks->Parent = _SplayLinks; \
|
||||
_SplayLinks->LeftChild = NULL; \
|
||||
_SplayLinks->RightChild = NULL;
|
||||
{ \
|
||||
PRTL_SPLAY_LINKS _SplayLinks; \
|
||||
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
|
||||
_SplayLinks->Parent = _SplayLinks; \
|
||||
_SplayLinks->LeftChild = NULL; \
|
||||
_SplayLinks->RightChild = NULL; \
|
||||
}
|
||||
|
||||
#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
|
||||
PRTL_SPLAY_LINKS _SplayParent; \
|
||||
PRTL_SPLAY_LINKS _SplayChild; \
|
||||
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
||||
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
||||
_SplayParent->LeftChild = _SplayChild; \
|
||||
_SplayChild->Parent = _SplayParent;
|
||||
{ \
|
||||
PRTL_SPLAY_LINKS _SplayParent; \
|
||||
PRTL_SPLAY_LINKS _SplayChild; \
|
||||
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
||||
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
||||
_SplayParent->LeftChild = _SplayChild; \
|
||||
_SplayChild->Parent = _SplayParent; \
|
||||
}
|
||||
|
||||
#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
|
||||
PRTL_SPLAY_LINKS _SplayParent; \
|
||||
PRTL_SPLAY_LINKS _SplayChild; \
|
||||
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
||||
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
||||
_SplayParent->RightChild = _SplayChild; \
|
||||
_SplayChild->Parent = _SplayParent;
|
||||
{ \
|
||||
PRTL_SPLAY_LINKS _SplayParent; \
|
||||
PRTL_SPLAY_LINKS _SplayChild; \
|
||||
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
|
||||
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
|
||||
_SplayParent->RightChild = _SplayChild; \
|
||||
_SplayChild->Parent = _SplayParent; \
|
||||
}
|
||||
|
||||
/* PROTOTYPES ****************************************************************/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue