diff src/flac/libflac/memory.c @ 1185:6d749f573b3b trunk

suppress warnings.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sat, 16 Jun 2007 16:59:53 +0900
parents 454ad11020ec
children e6c69ef37b7b
line wrap: on
line diff
--- a/src/flac/libflac/memory.c	Thu Jun 14 23:21:43 2007 -0500
+++ b/src/flac/libflac/memory.c	Sat Jun 16 16:59:53 2007 +0900
@@ -35,6 +35,7 @@
 
 #include "private/memory.h"
 #include "FLAC/assert.h"
+#include <malloc.h>
 
 void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address)
 {
@@ -44,6 +45,7 @@
 
 #ifdef FLAC__ALIGN_MALLOC_DATA
 	/* align on 32-byte (256-bit) boundary */
+#if 0
 	x = malloc(bytes+31);
 	/* there's got to be a better way to do this right for all archs */
 	if(sizeof(void*) == sizeof(unsigned))
@@ -52,6 +54,10 @@
 		*aligned_address = (void*)(((FLAC__uint64)x + 31) & (FLAC__uint64)(-((FLAC__int64)32)));
 	else
 		return 0;
+#endif
+	x = memalign(32, bytes);
+	*aligned_address = x;
+
 #else
 	x = malloc(bytes);
 	*aligned_address = x;