From a55c697a8276b1c82b108a695bbd588725aa015e Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Fri, 6 Jun 2014 21:27:01 -0700 Subject: [PATCH] ART: Fix casts in atomic.h to please GCC GCC 4.9 for ARM64 is not happy about reinterpret_cast-ing between int64_t and uint64_t, which is according to spec. Change the concrete casts to static_cast. However, we also use this for pointers, and we cannot static_cast those to int64_t. So add a reinterpret_cast to uintptr_t. Change-Id: If6513fbcbb8ee8f610f172310af61cf2e9ab0c43 --- runtime/atomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/atomic.h b/runtime/atomic.h index 04daea85b..ed83a33b0 100644 --- a/runtime/atomic.h +++ b/runtime/atomic.h @@ -392,7 +392,7 @@ template struct AtomicHelper<8, T> { // sizeof(T) == 8 volatile const int64_t* loc_ptr = reinterpret_cast(loc); - return reinterpret_cast(QuasiAtomic::Read64(loc_ptr)); + return static_cast(QuasiAtomic::Read64(loc_ptr)); } static void StoreRelaxed(volatile T* loc, T desired) { @@ -400,7 +400,7 @@ template struct AtomicHelper<8, T> { volatile int64_t* loc_ptr = reinterpret_cast(loc); QuasiAtomic::Write64(loc_ptr, - reinterpret_cast(desired)); + static_cast(desired)); } @@ -409,8 +409,8 @@ template struct AtomicHelper<8, T> { // sizeof(T) == 8 volatile int64_t* loc_ptr = reinterpret_cast(loc); return QuasiAtomic::Cas64( - reinterpret_cast(expected_value), - reinterpret_cast(desired_value), loc_ptr); + static_cast(reinterpret_cast(expected_value)), + static_cast(reinterpret_cast(desired_value)), loc_ptr); } }; -- 2.11.0