From: Michal Krol Date: Wed, 20 Feb 2008 21:04:32 +0000 (+0100) Subject: gallium: Move align_pointer() to p_pointer.h. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8828dd1443c7d55697f78757b22be2733e059acf;p=mesa.git gallium: Move align_pointer() to p_pointer.h. --- diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h index d7da2801c92..6f0dbdacd91 100644 --- a/src/gallium/include/pipe/p_util.h +++ b/src/gallium/include/pipe/p_util.h @@ -30,6 +30,7 @@ #include "p_compiler.h" #include "p_debug.h" +#include "p_pointer.h" #include @@ -114,33 +115,6 @@ REALLOC( void *old_ptr, unsigned old_size, unsigned new_size ) #define CALLOC_STRUCT(T) (struct T *) CALLOC(1, sizeof(struct T)) -/** - * Return a pointer aligned to next multiple of N bytes. - */ -static INLINE void * -align_pointer( void *unaligned, uint alignment ) -{ - if (sizeof(void *) == 64) { - union { - void *p; - uint64 u; - } pu; - pu.p = unaligned; - pu.u = (pu.u + alignment - 1) & ~(uint64) (alignment - 1); - return pu.p; - } - else { - /* 32-bit pointers */ - union { - void *p; - uint u; - } pu; - pu.p = unaligned; - pu.u = (pu.u + alignment - 1) & ~(alignment - 1); - return pu.p; - } -} - /** * Return memory on given byte alignment */