From: Simon Marlow Date: Thu, 8 Jun 2006 14:02:01 +0000 (+0000) Subject: fix some warnings X-Git-Tag: Before_FC_branch_merge~407 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=e9b4997c9c98e750aa675bca8e905b48fc9a1e68 fix some warnings --- diff --git a/rts/STM.c b/rts/STM.c index d3283a9..96db3f6 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;