summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-05-20 00:17:35 -0400
committerRich Felker <dalias@aerifal.cx>2015-05-20 00:17:35 -0400
commitc648cefb27984db60474ec1747cbfde83c2856d0 (patch)
treec21f84ead60afcc5854eacb5fd82702c875670f9 /arch
parent390f93ef69153bf2087fcf3baa1776ad9a6765ab (diff)
downloadmusl-c648cefb27984db60474ec1747cbfde83c2856d0.tar.gz
musl-c648cefb27984db60474ec1747cbfde83c2856d0.tar.bz2
musl-c648cefb27984db60474ec1747cbfde83c2856d0.tar.xz
musl-c648cefb27984db60474ec1747cbfde83c2856d0.zip
fix inconsistency in a_and and a_or argument types on x86[_64]
conceptually, and on other archs, these functions take a pointer to int, but in the i386, x86_64, and x32 versions of atomic.h, they took a pointer to void instead.
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/atomic.h8
-rw-r--r--arch/x32/atomic.h8
-rw-r--r--arch/x86_64/atomic.h8
3 files changed, 12 insertions, 12 deletions
diff --git a/arch/i386/atomic.h b/arch/i386/atomic.h
index 4fe7bded..95fecbdc 100644
--- a/arch/i386/atomic.h
+++ b/arch/i386/atomic.h
@@ -50,16 +50,16 @@ static inline int a_cas(volatile int *p, int t, int s)
return t;
}
-static inline void a_or(volatile void *p, int v)
+static inline void a_or(volatile int *p, int v)
{
__asm__( "lock ; orl %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
-static inline void a_and(volatile void *p, int v)
+static inline void a_and(volatile int *p, int v)
{
__asm__( "lock ; andl %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
static inline int a_swap(volatile int *x, int v)
diff --git a/arch/x32/atomic.h b/arch/x32/atomic.h
index 333098c3..b2014cc0 100644
--- a/arch/x32/atomic.h
+++ b/arch/x32/atomic.h
@@ -47,16 +47,16 @@ static inline int a_cas(volatile int *p, int t, int s)
return t;
}
-static inline void a_or(volatile void *p, int v)
+static inline void a_or(volatile int *p, int v)
{
__asm__( "lock ; or %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
-static inline void a_and(volatile void *p, int v)
+static inline void a_and(volatile int *p, int v)
{
__asm__( "lock ; and %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
static inline int a_swap(volatile int *x, int v)
diff --git a/arch/x86_64/atomic.h b/arch/x86_64/atomic.h
index 333098c3..b2014cc0 100644
--- a/arch/x86_64/atomic.h
+++ b/arch/x86_64/atomic.h
@@ -47,16 +47,16 @@ static inline int a_cas(volatile int *p, int t, int s)
return t;
}
-static inline void a_or(volatile void *p, int v)
+static inline void a_or(volatile int *p, int v)
{
__asm__( "lock ; or %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
-static inline void a_and(volatile void *p, int v)
+static inline void a_and(volatile int *p, int v)
{
__asm__( "lock ; and %1, %0"
- : "=m"(*(int *)p) : "r"(v) : "memory" );
+ : "=m"(*p) : "r"(v) : "memory" );
}
static inline int a_swap(volatile int *x, int v)