mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-22 05:30:31 +01:00
vulkan/util: Add explicit casts to make c++ happy
We're about to need including this header from a C++ source, so let's add some explicit casts for C++ compatibility. In one case we can make things a bit cleaner by moving the char-pointer-ism to the place that needs it, so let's clean that up while we're at it. Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14850>
This commit is contained in:
parent
676c65d8d5
commit
0d0ecbd987
1 changed files with 2 additions and 2 deletions
|
|
@ -234,7 +234,7 @@ vk_multialloc_alloc(struct vk_multialloc *ma,
|
|||
const VkAllocationCallbacks *alloc,
|
||||
VkSystemAllocationScope scope)
|
||||
{
|
||||
char *ptr = (char *)vk_alloc(alloc, ma->size, ma->align, scope);
|
||||
void *ptr = vk_alloc(alloc, ma->size, ma->align, scope);
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
|
||||
|
|
@ -250,7 +250,7 @@ vk_multialloc_alloc(struct vk_multialloc *ma,
|
|||
STATIC_ASSERT(ARRAY_SIZE(ma->ptrs) == 8);
|
||||
#define _VK_MULTIALLOC_UPDATE_POINTER(_i) \
|
||||
if ((_i) < ma->ptr_count) \
|
||||
*ma->ptrs[_i] = ptr + (uintptr_t)*ma->ptrs[_i]
|
||||
*ma->ptrs[_i] = (char *)ptr + (uintptr_t)*ma->ptrs[_i]
|
||||
_VK_MULTIALLOC_UPDATE_POINTER(0);
|
||||
_VK_MULTIALLOC_UPDATE_POINTER(1);
|
||||
_VK_MULTIALLOC_UPDATE_POINTER(2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue