Mesa (main): zink: standardize zero-init code style

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 15 12:56:39 UTC 2021


Module: Mesa
Branch: main
Commit: 00f01f522678a16e3710a3876ff91e237700b7aa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=00f01f522678a16e3710a3876ff91e237700b7aa

Author: Hoe Hao Cheng <haochengho12907 at gmail.com>
Date:   Tue Jun 15 18:55:54 2021 +0800

zink: standardize zero-init code style

quick grepping shows that the amount of {0} (there were 8) is higher
than { 0 } (only 5), so {0} it is!

Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11376>

---

 src/gallium/drivers/zink/zink_context.c   | 4 ++--
 src/gallium/drivers/zink/zink_instance.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index 6d8d379f72a..a1b7d7020b5 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1404,7 +1404,7 @@ get_render_pass(struct zink_context *ctx)
 {
    struct zink_screen *screen = zink_screen(ctx->base.screen);
    const struct pipe_framebuffer_state *fb = &ctx->fb_state;
-   struct zink_render_pass_state state = { 0 };
+   struct zink_render_pass_state state = {0};
    uint32_t clears = 0;
    state.swapchain_init = ctx->new_swapchain;
 
@@ -3461,7 +3461,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
    if (!ctx->program_cache || !ctx->compute_program_cache || !ctx->render_pass_cache)
       goto fail;
 
-   const uint8_t data[] = { 0 };
+   const uint8_t data[] = {0};
    ctx->dummy_vertex_buffer = pipe_buffer_create_with_data(&ctx->base,
       PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_SHADER_IMAGE, PIPE_USAGE_IMMUTABLE, sizeof(data), data);
    if (!ctx->dummy_vertex_buffer)
diff --git a/src/gallium/drivers/zink/zink_instance.py b/src/gallium/drivers/zink/zink_instance.py
index 1cbffd15975..b27d6e41994 100644
--- a/src/gallium/drivers/zink/zink_instance.py
+++ b/src/gallium/drivers/zink/zink_instance.py
@@ -115,10 +115,10 @@ VkInstance
 zink_create_instance(struct zink_instance_info *instance_info)
 {
    /* reserve one slot for MoltenVK */
-   const char *layers[${len(layers) + 1}] = { 0 };
+   const char *layers[${len(layers) + 1}] = {0};
    uint32_t num_layers = 0;
    
-   const char *extensions[${len(extensions) + 1}] = { 0 };
+   const char *extensions[${len(extensions) + 1}] = {0};
    uint32_t num_extensions = 0;
 
 %for ext in extensions:



More information about the mesa-commit mailing list