util: fix ROUND_DOWN_TO alignment type

Alignments can only be unsigned. Cast alignment to uint64_t to keep MSVC
happy.

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20153>
This commit is contained in:
Rohan Garg 2022-12-02 15:16:25 +05:30 committed by Marge Bot
parent 3bd5968b5c
commit 78e7a9740b

View file

@ -681,10 +681,10 @@ ALIGN_NPOT(uintptr_t value, int32_t alignment)
* \sa ALIGN()
*/
static inline uint64_t
ROUND_DOWN_TO(uint64_t value, int32_t alignment)
ROUND_DOWN_TO(uint64_t value, uint32_t alignment)
{
assert(util_is_power_of_two_nonzero(alignment));
return ((value) & ~(alignment - 1));
return ((value) & ~(uint64_t)(alignment - 1));
}
/**