diff options
author | Adam Langley <agl@google.com> | 2015-05-20 23:39:22 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-05-20 23:39:22 +0300 |
commit | cb56c2a137278caaa913c46db44652d48b19fc75 (patch) | |
tree | 2deb055f555563838d0f7d5089e82be3dc2bdc2c /crypto/refcount_c11.c | |
parent | 0d1d0d5c1ffcf0a36dfc0f3184c76b38858a8874 (diff) |
Cast refcounts to _Atomic before use.
GCC doesn't care, but Clang is strict about this.
Change-Id: If34305303a87459985c98423a8283cad704ae984
Diffstat (limited to 'crypto/refcount_c11.c')
-rw-r--r-- | crypto/refcount_c11.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/refcount_c11.c b/crypto/refcount_c11.c index 724db351..fbc0343d 100644 --- a/crypto/refcount_c11.c +++ b/crypto/refcount_c11.c @@ -34,9 +34,9 @@ static_assert(sizeof(CRYPTO_refcount_t) == sizeof(_Atomic CRYPTO_refcount_t), static_assert((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, "CRYPTO_REFCOUNT_MAX is incorrect"); -void CRYPTO_refcount_inc(CRYPTO_refcount_t *count) { - uint32_t expected = - atomic_load(static_cast<_Atomic CRYPTO_refcount_t>(count)); +void CRYPTO_refcount_inc(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *) in_count; + uint32_t expected = atomic_load(count); while (expected != CRYPTO_REFCOUNT_MAX) { uint32_t new_value = expected + 1; @@ -46,7 +46,8 @@ void CRYPTO_refcount_inc(CRYPTO_refcount_t *count) { } } -int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count) { +int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *in_count) { + _Atomic CRYPTO_refcount_t *count = (_Atomic CRYPTO_refcount_t *)in_count; uint32_t expected = atomic_load(count); for (;;) { |