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:
Thomas Bluemel 2005-11-07 23:09:53 +00:00
parent e57c6af315
commit c7e90a00b9

View file

@ -25,39 +25,45 @@
(RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)) (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links))
#define RtlRightChild(Links) \ #define RtlRightChild(Links) \
(PRTL_SPLAY_LINKS)(Links)->RightChild ((PRTL_SPLAY_LINKS)(Links))->RightChild
#define RtlIsRoot(Links) \ #define RtlIsRoot(Links) \
(RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links)) (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links))
#define RtlLeftChild(Links) \ #define RtlLeftChild(Links) \
(PRTL_SPLAY_LINKS)(Links)->LeftChild ((PRTL_SPLAY_LINKS)(Links))->LeftChild
#define RtlParent(Links) \ #define RtlParent(Links) \
(PRTL_SPLAY_LINKS)(Links)->Parent ((PRTL_SPLAY_LINKS)(Links))->Parent
#define RtlInitializeSplayLinks(Links) \ #define RtlInitializeSplayLinks(Links) \
PRTL_SPLAY_LINKS _SplayLinks; \ { \
_SplayLinks = (PRTL_SPLAY_LINKS)(Links); \ PRTL_SPLAY_LINKS _SplayLinks; \
_SplayLinks->Parent = _SplayLinks; \ _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \
_SplayLinks->LeftChild = NULL; \ _SplayLinks->Parent = _SplayLinks; \
_SplayLinks->RightChild = NULL; _SplayLinks->LeftChild = NULL; \
_SplayLinks->RightChild = NULL; \
}
#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \ #define RtlInsertAsLeftChild(ParentLinks,ChildLinks) \
PRTL_SPLAY_LINKS _SplayParent; \ { \
PRTL_SPLAY_LINKS _SplayChild; \ PRTL_SPLAY_LINKS _SplayParent; \
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ PRTL_SPLAY_LINKS _SplayChild; \
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
_SplayParent->LeftChild = _SplayChild; \ _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
_SplayChild->Parent = _SplayParent; _SplayParent->LeftChild = _SplayChild; \
_SplayChild->Parent = _SplayParent; \
}
#define RtlInsertAsRightChild(ParentLinks,ChildLinks) \ #define RtlInsertAsRightChild(ParentLinks,ChildLinks) \
PRTL_SPLAY_LINKS _SplayParent; \ { \
PRTL_SPLAY_LINKS _SplayChild; \ PRTL_SPLAY_LINKS _SplayParent; \
_SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ PRTL_SPLAY_LINKS _SplayChild; \
_SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \
_SplayParent->RightChild = _SplayChild; \ _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \
_SplayChild->Parent = _SplayParent; _SplayParent->RightChild = _SplayChild; \
_SplayChild->Parent = _SplayParent; \
}
/* PROTOTYPES ****************************************************************/ /* PROTOTYPES ****************************************************************/