base: make CUSTOM_ALIGN use uintptr_t
authorMarko Kreen <markokr@gmail.com>
Tue, 29 Nov 2011 18:42:50 +0000 (20:42 +0200)
committerMarko Kreen <markokr@gmail.com>
Tue, 29 Nov 2011 18:42:50 +0000 (20:42 +0200)
For cases where long is shorter than ptr.

usual/base.h

index e14d09a2f13354cd15e7ac82bfe0fee62daa52d9..36eb359987b9ae5ef12fac60ec96d9e512d8c4a7 100644 (file)
@@ -69,7 +69,7 @@
 
 /** power-of-2 alignment */
 #ifndef CUSTOM_ALIGN
-#define CUSTOM_ALIGN(x, a) (((unsigned long)(x) + (a) - 1) & ~((a) - 1))
+#define CUSTOM_ALIGN(x, a) (((uintptr_t)(x) + (uintptr_t)(a) - 1) & ~((uintptr_t)(a) - 1))
 #endif
 
 /** preferred alignment */