From 9bd98ad96a85e3d68a084733c475eae4bfd17926 Mon Sep 17 00:00:00 2001 From: Samy Al Bahra Date: Wed, 20 Feb 2019 15:13:02 -0500 Subject: [PATCH] Revert "include/spinlock: explicit casts for C++ compilation" This reverts commit 8698ada9532d880eb1276f3535ef879a23dee8cf. Concurrency Kit uses idiomatic C99+. --- include/spinlock/clh.h | 2 +- include/spinlock/hclh.h | 4 ++-- include/spinlock/mcs.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spinlock/clh.h b/include/spinlock/clh.h index a11db76..1133806 100644 --- a/include/spinlock/clh.h +++ b/include/spinlock/clh.h @@ -78,7 +78,7 @@ ck_spinlock_clh_lock(struct ck_spinlock_clh **queue, struct ck_spinlock_clh *thr * Mark current request as last request. Save reference to previous * request. */ - previous = CK_CPP_CAST(struct ck_spinlock_clh *, ck_pr_fas_ptr(queue, thread)); + previous = ck_pr_fas_ptr(queue, thread); thread->previous = previous; /* Wait until previous thread is done with lock. */ diff --git a/include/spinlock/hclh.h b/include/spinlock/hclh.h index 887391a..ece56c6 100644 --- a/include/spinlock/hclh.h +++ b/include/spinlock/hclh.h @@ -88,7 +88,7 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_queue, ck_pr_fence_store_atomic(); /* Mark current request as last request. Save reference to previous request. */ - previous = CK_CPP_CAST(struct ck_spinlock_hclh *, ck_pr_fas_ptr(local_queue, thread)); + previous = ck_pr_fas_ptr(local_queue, thread); thread->previous = previous; /* Wait until previous thread from the local queue is done with lock. */ @@ -107,7 +107,7 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_queue, /* Now we need to splice the local queue into the global queue. */ local_tail = ck_pr_load_ptr(local_queue); - previous = CK_CPP_CAST(struct ck_spinlock_hclh *, ck_pr_fas_ptr(glob_queue, local_tail)); + previous = ck_pr_fas_ptr(glob_queue, local_tail); ck_pr_store_uint(&local_tail->splice, true); diff --git a/include/spinlock/mcs.h b/include/spinlock/mcs.h index dd0694f..262c720 100644 --- a/include/spinlock/mcs.h +++ b/include/spinlock/mcs.h @@ -97,7 +97,7 @@ ck_spinlock_mcs_lock(struct ck_spinlock_mcs **queue, * returns NULL, it means the queue was empty. If the queue was empty, * then the operation is complete. */ - previous = CK_CPP_CAST(struct ck_spinlock_mcs *, ck_pr_fas_ptr(queue, node)); + previous = ck_pr_fas_ptr(queue, node); if (previous != NULL) { /* * Let the previous lock holder know that we are waiting on