From 703d9346c8e08f1b20cfb1a42b42c4c0e0082a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 3 Oct 2012 08:43:27 -0400 Subject: [PATCH] libwinpr-interlocked: fix on 32-bit --- winpr/libwinpr/interlocked/interlocked.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/winpr/libwinpr/interlocked/interlocked.c b/winpr/libwinpr/interlocked/interlocked.c index 0be301529..30b608ee7 100644 --- a/winpr/libwinpr/interlocked/interlocked.c +++ b/winpr/libwinpr/interlocked/interlocked.c @@ -82,7 +82,7 @@ PSLIST_ENTRY InterlockedPushEntrySList(PSLIST_HEADER ListHead, PSLIST_ENTRY List return (PSLIST_ENTRY) ((ULONG_PTR) old.HeaderX64.NextEntry << 4); #else - new.s.Next.Next = entry; + new.s.Next.Next = ListEntry; do { @@ -91,7 +91,7 @@ PSLIST_ENTRY InterlockedPushEntrySList(PSLIST_HEADER ListHead, PSLIST_ENTRY List new.s.Depth = old.s.Depth + 1; new.s.Sequence = old.s.Sequence + 1; } - while(InterlockedCompareExchange64(&ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); + while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); return old.s.Next.Next; #endif @@ -147,7 +147,7 @@ PSLIST_ENTRY InterlockedPopEntrySList(PSLIST_HEADER ListHead) new.s.Depth = old.s.Depth - 1; new.s.Sequence = old.s.Sequence + 1; } - while(InterlockedCompareExchange64(&ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); + while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); #endif return entry; } @@ -186,7 +186,7 @@ PSLIST_ENTRY InterlockedFlushSList(PSLIST_HEADER ListHead) old = *ListHead; new.s.Sequence = old.s.Sequence + 1; } - while(InterlockedCompareExchange64(&ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); + while(InterlockedCompareExchange64((LONGLONG*) &ListHead->Alignment, new.Alignment, old.Alignment) != old.Alignment); return old.s.Next.Next; #endif