mirror of
https://github.com/reactos/reactos.git
synced 2026-06-06 13:47:40 +08: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:
@@ -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 ****************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user