util: Remove unused ALIGN function to prevent future use
The #undef ALIGN is also not needed anymore, remove it. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38365>
This commit is contained in:
@@ -29,12 +29,6 @@
|
||||
#ifdef HAVE_SYS_SHM_H
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#ifdef __FreeBSD__
|
||||
/* sys/ipc.h -> sys/_types.h -> machine/param.h
|
||||
* - defines ALIGN which clashes with our ALIGN
|
||||
*/
|
||||
#undef ALIGN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "util/compiler.h"
|
||||
|
||||
+2
-25
@@ -53,7 +53,6 @@
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <sys/param.h>
|
||||
#undef ALIGN
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -648,29 +647,7 @@ util_memcpy_cpu_to_le32(void * restrict dest, const void * restrict src, size_t
|
||||
}
|
||||
|
||||
/**
|
||||
* Align a value up to an alignment value
|
||||
*
|
||||
* If \c value is not already aligned to the requested alignment value, it
|
||||
* will be rounded up.
|
||||
*
|
||||
* \param value Value to be rounded
|
||||
* \param alignment Alignment value to be used. This must be a power of two.
|
||||
*
|
||||
* \sa ROUND_DOWN_TO()
|
||||
*/
|
||||
|
||||
#if defined(ALIGN)
|
||||
#undef ALIGN
|
||||
#endif
|
||||
static inline uint32_t
|
||||
ALIGN(uint32_t value, uint32_t alignment)
|
||||
{
|
||||
assert(util_is_power_of_two_nonzero(alignment));
|
||||
return ALIGN_POT(value, alignment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like ALIGN(), but works with a non-power-of-two alignment.
|
||||
* Like align(), but works with a non-power-of-two alignment.
|
||||
*/
|
||||
static inline uintptr_t
|
||||
ALIGN_NPOT(uintptr_t value, int32_t alignment)
|
||||
@@ -688,7 +665,7 @@ ALIGN_NPOT(uintptr_t value, int32_t alignment)
|
||||
* \param value Value to be rounded
|
||||
* \param alignment Alignment value to be used. This must be a power of two.
|
||||
*
|
||||
* \sa ALIGN()
|
||||
* \sa align()
|
||||
*/
|
||||
static inline uint64_t
|
||||
ROUND_DOWN_TO(uint64_t value, uint32_t alignment)
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
/* pthread_np.h -> sys/param.h -> machine/param.h
|
||||
* - defines ALIGN which clashes with our ALIGN
|
||||
*/
|
||||
#undef ALIGN
|
||||
#define cpu_set_t cpuset_t
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user