[Bf-blender-cvs] [32f83a2] master: Fix build errors in atomic ops and warning in aligned malloc on OS X.

Brecht Van Lommel noreply at git.blender.org
Fri Sep 26 00:08:16 CEST 2014


Commit: 32f83a298cc7f1e0d367a199866d3f6483f97675
Author: Brecht Van Lommel
Date:   Thu Sep 25 23:51:09 2014 +0200
Branches: master
https://developer.blender.org/rB32f83a298cc7f1e0d367a199866d3f6483f97675

Fix build errors in atomic ops and warning in aligned malloc on OS X.

===================================================================

M	intern/atomic/atomic_ops.h
M	intern/guardedalloc/intern/mallocn.c

===================================================================

diff --git a/intern/atomic/atomic_ops.h b/intern/atomic/atomic_ops.h
index 5ffc32a..f63ff63 100644
--- a/intern/atomic/atomic_ops.h
+++ b/intern/atomic/atomic_ops.h
@@ -128,7 +128,7 @@ ATOMIC_INLINE uint64_t
 atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new)
 {
 	uint64_t init_val = *v;
-	OSAtomicCompareAndSwap64(old, _new, v);
+	OSAtomicCompareAndSwap64((int64_t)old, (int64_t)_new, (int64_t *)v);
 	return init_val;
 }
 #  elif (defined(__amd64__) || defined(__x86_64__))
@@ -273,7 +273,7 @@ ATOMIC_INLINE uint32_t
 atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new)
 {
 	uint32_t init_val = *v;
-	OSAtomicCompareAndSwap32(old, _new, v);
+	OSAtomicCompareAndSwap32((int32_t)old, (int32_t)_new, (int32_t *)v);
 	return init_val;
 }
 #elif (defined(__i386__) || defined(__amd64__) || defined(__x86_64__))
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 40f406d..be0a8aa 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -72,6 +72,7 @@ void *aligned_malloc(size_t size, size_t alignment)
 	 * they work natively with SSE types with no further work.
 	 */
 	assert(alignment == 16);
+	(void)alignment;
 	return malloc(size);
 #elif defined(__FreeBSD__) || defined(__NetBSD__)
 	void *result;




More information about the Bf-blender-cvs mailing list