Author: hbelusca
Date: Sun Oct 19 00:05:18 2014
New Revision: 64820
URL:
http://svn.reactos.org/svn/reactos?rev=64820&view=rev
Log:
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).
Modified:
trunk/reactos/lib/rtl/splaytree.c
Modified: trunk/reactos/lib/rtl/splaytree.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/splaytree.c?rev=64…
==============================================================================
--- trunk/reactos/lib/rtl/splaytree.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/splaytree.c [iso-8859-1] Sun Oct 19 00:05:18 2014
@@ -22,17 +22,25 @@
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 @@
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);