From dfa5f04c63d5c1e9dafa0dc3e5f1daec2ec28280 Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Sat, 18 Dec 1999 19:50:24 +0000 Subject: [PATCH] merged better assert code back into main trunk svn path=/trunk/; revision=893 --- reactos/ntoskrnl/rtl/list.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/rtl/list.c b/reactos/ntoskrnl/rtl/list.c index 041954add32..6e89023860d 100644 --- a/reactos/ntoskrnl/rtl/list.c +++ b/reactos/ntoskrnl/rtl/list.c @@ -19,9 +19,9 @@ static BOOLEAN CheckEntry(PLIST_ENTRY ListEntry) { assert(ListEntry!=NULL); assert(ListEntry->Blink!=NULL); - assert(ListEntry->Blink->Flink!=NULL); + assert(ListEntry->Blink->Flink==ListEntry); assert(ListEntry->Flink!=NULL); - assert(ListEntry->Flink->Blink!=NULL); + assert(ListEntry->Flink->Blink==ListEntry); return(TRUE); } @@ -51,7 +51,6 @@ VOID RemoveEntryList(PLIST_ENTRY ListEntry) OldFlink->Blink=OldBlink; OldBlink->Flink=OldFlink; - assert(CheckEntry(ListEntry)); DPRINT("RemoveEntryList()\n"); } @@ -80,8 +79,6 @@ PLIST_ENTRY RemoveHeadList(PLIST_ENTRY ListHead) Old = ListHead->Flink; RemoveEntryList(ListHead->Flink); - assert(CheckEntry(ListHead)); - DPRINT("RemoveHeadList()\n"); return(Old); @@ -106,12 +103,13 @@ VOID InsertTailList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry) */ { PLIST_ENTRY Blink; - + Blink = ListHead->Blink; ListEntry->Flink=ListHead; ListEntry->Blink=Blink; Blink->Flink=ListEntry; ListHead->Blink=ListEntry; + assert( CheckEntry( ListEntry ) ); } VOID InsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry) @@ -123,6 +121,7 @@ VOID InsertHeadList(PLIST_ENTRY ListHead, PLIST_ENTRY ListEntry) ListEntry->Blink = ListHead; OldFlink->Blink = ListEntry; ListHead->Flink = ListEntry; + assert( CheckEntry( ListEntry ) ); } PLIST_ENTRY ExInterlockedInsertTailList(PLIST_ENTRY ListHead,