SOLARIS: Fix some rx_atomic.h warnings
authorAndrew Deason <adeason@sinenomine.net>
Mon, 6 Dec 2010 18:46:06 +0000 (12:46 -0600)
committerDerrick Brashear <shadow@dementia.org>
Mon, 6 Dec 2010 20:32:10 +0000 (12:32 -0800)
Include atomic.h so we get atomic_* prototypes, pass atomic->var in
rx_atomic_sub, and pass unsigned int*s to  the atomic_* functions.

Change-Id: Ic8d745bc1726c850bd15d38702163e92587bb0a5
Reviewed-on: http://gerrit.openafs.org/3462
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/rx/rx_atomic.h

index f82e2b3..e59aad6 100644 (file)
@@ -125,8 +125,11 @@ typedef atomic_t rx_atomic_t;
 #define rx_atomic_sub(X, V)      atomic_sub(V, X)
 
 #elif defined(AFS_SUN58_ENV)
+
+# include <atomic.h>
+
 typedef struct {
-    volatile int var;
+    volatile unsigned int var;
 } rx_atomic_t;
 
 static_inline void
@@ -161,7 +164,7 @@ rx_atomic_dec(rx_atomic_t *atomic) {
 
 static_inline void
 rx_atomic_sub(rx_atomic_t *atomic, int change) {
-    atomic_add_32(&atomic, 0 - change);
+    atomic_add_32(&atomic->var, 0 - change);
 }
 
 #elif defined(__GNUC__) && defined(HAVE_SYNC_FETCH_AND_ADD)