Skip to content

Commit 9bd98ad

Browse files
author
Samy Al Bahra
committed
Revert "include/spinlock: explicit casts for C++ compilation"
This reverts commit 8698ada. Concurrency Kit uses idiomatic C99+.
1 parent 4e9b23b commit 9bd98ad

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

include/spinlock/clh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ck_spinlock_clh_lock(struct ck_spinlock_clh **queue, struct ck_spinlock_clh *thr
7878
* Mark current request as last request. Save reference to previous
7979
* request.
8080
*/
81-
previous = CK_CPP_CAST(struct ck_spinlock_clh *, ck_pr_fas_ptr(queue, thread));
81+
previous = ck_pr_fas_ptr(queue, thread);
8282
thread->previous = previous;
8383

8484
/* Wait until previous thread is done with lock. */

include/spinlock/hclh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ck_spinlock_hclh_lock(struct ck_spinlock_hclh **glob_queue,
8888
ck_pr_fence_store_atomic();
8989

9090
/* Mark current request as last request. Save reference to previous request. */
91-
previous = CK_CPP_CAST(struct ck_spinlock_hclh *, ck_pr_fas_ptr(local_queue, thread));
91+
previous = ck_pr_fas_ptr(local_queue, thread);
9292
thread->previous = previous;
9393

9494
/* 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,
107107

108108
/* Now we need to splice the local queue into the global queue. */
109109
local_tail = ck_pr_load_ptr(local_queue);
110-
previous = CK_CPP_CAST(struct ck_spinlock_hclh *, ck_pr_fas_ptr(glob_queue, local_tail));
110+
previous = ck_pr_fas_ptr(glob_queue, local_tail);
111111

112112
ck_pr_store_uint(&local_tail->splice, true);
113113

include/spinlock/mcs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ ck_spinlock_mcs_lock(struct ck_spinlock_mcs **queue,
9797
* returns NULL, it means the queue was empty. If the queue was empty,
9898
* then the operation is complete.
9999
*/
100-
previous = CK_CPP_CAST(struct ck_spinlock_mcs *, ck_pr_fas_ptr(queue, node));
100+
previous = ck_pr_fas_ptr(queue, node);
101101
if (previous != NULL) {
102102
/*
103103
* Let the previous lock holder know that we are waiting on

0 commit comments

Comments
 (0)