Ok Arch, it's good to remove unuseful brackets, but don't exaggerate too much. Also check how the RtlInsertAsLeft/RightChild macros are defined. Since MS don't use the nice do { ... } while(0) for them, you cannot just use the if (blah) foo(); else bar(); to do the job, but you need the extra-brackets. And you cannot just change the macros definitions to not "break" headers compatibility (or... idiocies).

svn path=/trunk/; revision=64820
This commit is contained in:
Hermès Bélusca-Maïto 2014-10-19 00:05:18 +00:00
parent b858c18208
commit a4a867f83a

View file

@ -22,17 +22,25 @@ VOID
FixupChildLinks(PRTL_SPLAY_LINKS Links, BOOLEAN Root, BOOLEAN LeftChild)
{
if (RtlLeftChild(Links))
{
RtlInsertAsLeftChild(Links, RtlLeftChild(Links));
}
if (RtlRightChild(Links))
{
RtlInsertAsRightChild(Links, RtlRightChild(Links));
}
if (!Root)
{
if (LeftChild)
{
RtlInsertAsLeftChild(RtlParent(Links), Links);
}
else
{
RtlInsertAsRightChild(RtlParent(Links), Links);
}
}
}
@ -86,15 +94,23 @@ SwapSplayLinks(PRTL_SPLAY_LINKS LinkA,
if (!RootA)
{
if (LeftA)
{
RtlInsertAsLeftChild(RtlParent(&Ta), LinkB);
}
else
{
RtlInsertAsRightChild(RtlParent(&Ta), LinkB);
}
}
if (LeftB)
{
RtlInsertAsLeftChild(LinkB, LinkA);
}
else
{
RtlInsertAsRightChild(LinkB, LinkA);
}
}
FixupChildLinks(LinkA, FALSE, LeftB);