Fix uatomic sign cast
[urcu.git] / urcu / uatomic / s390.h
index b274c1cb372d22be165aa6dd01bf5da08430d21b..32c676e0af590af4e983d61074ca4b8b11ed5441 100644 (file)
@@ -106,8 +106,9 @@ unsigned long _uatomic_exchange(volatile void *addr, unsigned long val, int len)
 }
 
 #define uatomic_xchg(addr, v)                                              \
-       (__typeof__(*(addr))) _uatomic_exchange((addr), (unsigned long)(v), \
-                                              sizeof(*(addr)))
+       (__typeof__(*(addr))) _uatomic_exchange((addr),                     \
+                                               caa_cast_long_keep_sign(v), \
+                                               sizeof(*(addr)))
 
 /* cmpxchg */
 
@@ -145,10 +146,10 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
        return 0;
 }
 
-#define uatomic_cmpxchg(addr, old, _new)                               \
-       (__typeof__(*(addr))) _uatomic_cmpxchg((addr),                  \
-                                              (unsigned long)(old),    \
-                                              (unsigned long)(_new),   \
+#define uatomic_cmpxchg(addr, old, _new)                                    \
+       (__typeof__(*(addr))) _uatomic_cmpxchg((addr),                       \
+                                              caa_cast_long_keep_sign(old), \
+                                              caa_cast_long_keep_sign(_new),\
                                               sizeof(*(addr)))
 
 #ifdef __cplusplus 
This page took 0.022752 seconds and 4 git commands to generate.