Merged with michi branch at rev 1684fe51cf3d.
[cacao.git] / src / native / vm / sun_misc_Unsafe.cpp
index 8c9779ecc0084e057cbbd915e267a40471860515..bcbfe0feceb955cc6b29e16bf83e8e49f34a5f0d 100644 (file)
@@ -903,14 +903,14 @@ JNIEXPORT void JNICALL Java_sun_misc_Unsafe_throwException(JNIEnv *env, jobject
  */
 JNIEXPORT jboolean JNICALL Java_sun_misc_Unsafe_compareAndSwapObject(JNIEnv *env, jobject _this, jobject o, jlong offset, jobject expected, jobject x)
 {
-       volatile void **p;
+       void **p;
        void           *result;
 
        /* XXX Use LLNI */
 
-       p = (volatile void **) (((uint8_t *) o) + offset);
+       p = (void **) (((uint8_t *) o) + offset);
 
-       result = Atomic::compare_and_swap(p, expected, x);
+       result = Atomic::compare_and_swap(p, (void *) expected, (void *) x);
 
        if (result == expected)
                return true;
@@ -933,7 +933,7 @@ JNIEXPORT jboolean JNICALL Java_sun_misc_Unsafe_compareAndSwapInt(JNIEnv *env, j
 
        p = (uint32_t *) (((uint8_t *) o) + offset);
 
-       result = Atomic::compare_and_swap(p, expected, x);
+       result = Atomic::compare_and_swap(p, (uint32_t) expected, (uint32_t) x);
 
        if (result == (uint32_t) expected)
                return true;
@@ -956,7 +956,7 @@ JNIEXPORT jboolean JNICALL Java_sun_misc_Unsafe_compareAndSwapLong(JNIEnv *env,
 
        p = (uint64_t *) (((uint8_t *) o) + offset);
 
-       result = Atomic::compare_and_swap(p, expected, x);
+       result = Atomic::compare_and_swap(p, (uint64_t) expected, (uint64_t) x);
 
        if (result == (uint64_t) expected)
                return true;