radv: Pointer arithmetic without void*

Fixes: 736834931b ("radv: memset the alignment hole in cache_entry to 0")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8871>
This commit is contained in:
James Park 2021-02-04 12:54:20 -08:00
parent 27d496706e
commit fbaf136821

View file

@ -419,9 +419,9 @@ radv_pipeline_cache_insert_shaders(struct radv_device *device,
}
// Make valgrind happy by filling the alignment hole at the end.
assert((void*)p == (void*)entry + size_without_align);
assert(sizeof(*entry) + ((void*)p - (void*)entry->code) == size_without_align);
memset((void*)entry + size_without_align, 0, size - size_without_align);
assert(p == (char*)entry + size_without_align);
assert(sizeof(*entry) + (p - entry->code) == size_without_align);
memset((char*)entry + size_without_align, 0, size - size_without_align);
/* Always add cache items to disk. This will allow collection of
* compiled shaders by third parties such as steam, even if the app