From a4a867f83abae91e5f6242d66d51dc0c077ef627 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 19 Oct 2014 00:05:18 +0000 Subject: [PATCH] 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 --- reactos/lib/rtl/splaytree.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/lib/rtl/splaytree.c b/reactos/lib/rtl/splaytree.c index dfb77b60848..6dc13aaeea8 100644 --- a/reactos/lib/rtl/splaytree.c +++ b/reactos/lib/rtl/splaytree.c @@ -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); -- 2.17.1