From: Chad Versace Date: Thu, 14 Jan 2016 00:24:14 +0000 (-0800) Subject: anv: Define zero() macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4c2bafb9bff8f5979c4cf31f5decdaaffdf1c2cb;p=mesa.git anv: Define zero() macro zero(x) memsets x to zero. Eliminates bugs due to errors in memset's size param. --- diff --git a/src/vulkan/anv_private.h b/src/vulkan/anv_private.h index 3acf9796a5e..5a31ec9c50a 100644 --- a/src/vulkan/anv_private.h +++ b/src/vulkan/anv_private.h @@ -152,6 +152,8 @@ anv_clear_mask(uint32_t *inout_mask, uint32_t clear_mask) memcpy((dest), (src), (count) * sizeof(*(src))); \ }) +#define zero(x) (memset(&(x), 0, sizeof(x))) + /* Define no kernel as 1, since that's an illegal offset for a kernel */ #define NO_KERNEL 1