[speex-dev] LP64 fix

Christian Weisgerber naddy at mips.inka.de
Wed Jun 11 08:56:56 PDT 2003



Casting a pointer to an int is a bad idea on 64-bit platforms.

--- libspeex/stack_alloc.h.orig	Wed Jun 11 17:10:53 2003
+++ libspeex/stack_alloc.h	Wed Jun 11 17:11:12 2003
@@ -48,7 +48,7 @@
 #else
 
 /*Aligns the stack to a 'size' boundary */
-#define ALIGN(stack, size) ((stack) += ((size) - (int)(stack)) & ((size) - 1))
+#define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
 
 /* Allocates 'size' elements of type 'type' on the stack */
 #define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))

-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Speex-dev mailing list