summaryrefslogtreecommitdiff
path: root/rts/STM.c
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-06-08 14:02:01 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-06-08 14:02:01 +0000
commite9b4997c9c98e750aa675bca8e905b48fc9a1e68 (patch)
tree41d3d7012485b836bca3a40b5a3c2a3a2e38a6ba /rts/STM.c
parentd2847b0578d5c143bb325ca66c948d1a1cb08354 (diff)
downloadhaskell-e9b4997c9c98e750aa675bca8e905b48fc9a1e68.tar.gz
fix some warnings
Diffstat (limited to 'rts/STM.c')
-rw-r--r--rts/STM.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/rts/STM.c b/rts/STM.c
index d3283a92f0..96db3f65f3 100644
--- a/rts/STM.c
+++ b/rts/STM.c
@@ -297,7 +297,8 @@ static StgClosure *lock_tvar(StgTRecHeader *trec,
do {
result = s -> current_value;
} while (GET_INFO(result) == &stg_TREC_HEADER_info);
- } while (cas(&(s -> current_value), result, trec) != result);
+ } while (cas((void *)&(s -> current_value),
+ (StgWord)result, (StgWord)trec) != (StgWord)result);
return result;
}
@@ -314,8 +315,10 @@ static StgBool cond_lock_tvar(StgTRecHeader *trec,
StgTVar *s,
StgClosure *expected) {
StgClosure *result;
+ StgWord w;
TRACE("%p : cond_lock_tvar(%p, %p)\n", trec, s, expected);
- result = cas(&(s -> current_value), expected, trec);
+ w = cas((void *)&(s -> current_value), (StgWord)expected, (StgWord)trec);
+ result = (StgClosure *)w;
TRACE("%p : %s\n", trec, result ? "success" : "failure");
return (result == expected);
}
@@ -796,7 +799,7 @@ static volatile StgBool token_locked = FALSE;
#if defined(THREADED_RTS)
static void getTokenBatch(Capability *cap) {
- while (cas(&token_locked, FALSE, TRUE) == TRUE) { /* nothing */ }
+ while (cas((void *)&token_locked, FALSE, TRUE) == TRUE) { /* nothing */ }
max_commits += TOKEN_BATCH_SIZE;
cap -> transaction_tokens = TOKEN_BATCH_SIZE;
token_locked = FALSE;