Mesa (master): radv: Pointer arithmetic without void*

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 4 21:37:52 UTC 2021


Module: Mesa
Branch: master
Commit: fbaf13682147faa8fd6fa1c19e588f3ef4c5e678
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fbaf13682147faa8fd6fa1c19e588f3ef4c5e678

Author: James Park <jpark37 at lagfreegames.com>
Date:   Thu Feb  4 12:54:20 2021 -0800

radv: Pointer arithmetic without void*

Fixes: 736834931bb ("radv: memset the alignment hole in cache_entry to 0")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8871>

---

 src/amd/vulkan/radv_pipeline_cache.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c
index 5345083d263..7377decf439 100644
--- a/src/amd/vulkan/radv_pipeline_cache.c
+++ b/src/amd/vulkan/radv_pipeline_cache.c
@@ -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



More information about the mesa-commit mailing list