From 671d067ea09709c10a56811a911124764721ba7a Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Wed, 9 Apr 2014 10:40:54 -0400 Subject: [PATCH] ck_bytelock: Fix casting error affecting 32-bit architectures. --- include/ck_bytelock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ck_bytelock.h b/include/ck_bytelock.h index acdba5e..6c682a5 100644 --- a/include/ck_bytelock.h +++ b/include/ck_bytelock.h @@ -81,8 +81,8 @@ ck_bytelock_init(struct ck_bytelock *bytelock) CK_CC_INLINE static void ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot) { + CK_BYTELOCK_TYPE *readers = (void *)bytelock->readers; unsigned int i; - uint64_t *readers = (void *)bytelock->readers; /* Announce upcoming writer acquisition. */ while (ck_pr_cas_uint(&bytelock->owner, 0, slot) == false) @@ -95,7 +95,7 @@ ck_bytelock_write_lock(struct ck_bytelock *bytelock, unsigned int slot) /* Wait for slotted readers to drain out. */ ck_pr_fence_store_load(); for (i = 0; i < sizeof(bytelock->readers) / CK_BYTELOCK_LENGTH; i++) { - while (CK_BYTELOCK_LOAD((CK_BYTELOCK_TYPE *)&readers[i]) != false) + while (CK_BYTELOCK_LOAD(&readers[i]) != false) ck_pr_stall(); }