mesa/src/vulkan/wsi
Alyssa Rosenzweig b824ef83ab util/dynarray: infer type in append
Most of the time, we can infer the type to append in
util_dynarray_append using __typeof__, which is standardized in C23 and
support in Jesse's MSMSVCV. This patch drops the type argument most of
the time, making util_dynarray a little more ergonomic to use.

This is done in four steps.

First, rename util_dynarray_append -> util_dynarray_append_typed

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_append(/util_dynarray_append_typed(/g' \{} \;"

Then, add a new append that infers the type. This is much more ergonomic
for what you want most of the time.

Next, use type-inferred append as much as possible, via Coccinelle
patch (plus manual fixup):

    @@
    expression dynarray, element;
    type type;
    @@

    -util_dynarray_append_typed(dynarray, type, element);
    +util_dynarray_append(dynarray, element);

Finally, hand fixup cases that Coccinelle missed or incorrectly
translated, of which there were several because we can't used the
untyped append with a literal (since the sizeof won't do what you want).

All four steps are squashed to produce a single patch changing every
util_dynarray_append call site in tree to either drop a type parameter
(if possible) or insert a _typed suffix (if we can't infer). As such,
the final patch is best reviewed by hand even though it was
tool-assisted.

No Long Linguine Meals were involved in the making of this patch.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38038>
2025-10-24 18:32:07 +00:00
..
meson.build x11: Add an x11_xlib_display_is_thread_safe() helper 2025-07-16 01:32:56 +00:00
wsi_common.c wsi/metal: Backend addition for drivers built on top of Metal 2025-10-13 20:17:17 +00:00
wsi_common.h wsi/metal: Backend addition for drivers built on top of Metal 2025-10-13 20:17:17 +00:00
wsi_common_display.c wsi/display: Fix vkGetRandROutputDisplayEXT when connector is not leased yet. 2025-10-14 18:57:33 +00:00
wsi_common_display.h
wsi_common_drm.c wsi: Fix the flagging of dma_buf_sync_file for the amdgpu workaround. 2025-10-20 03:58:47 +00:00
wsi_common_drm.h
wsi_common_headless.c vulkan/wsi/headless: clean up headless wsi device and headers 2025-08-10 07:16:46 +00:00
wsi_common_metal.c wsi/metal: Backend addition for drivers built on top of Metal 2025-10-13 20:17:17 +00:00
wsi_common_metal_layer.h wsi/metal: Disable reference counting 2025-10-13 20:17:16 +00:00
wsi_common_metal_layer.m docs: update/fix vk spec urls 2025-10-22 09:23:34 +02:00
wsi_common_private.h Revert "wsi: Implements scaling controls for DRI3 presentation." 2025-10-16 09:41:00 +00:00
wsi_common_queue.h vulkan/wsi/queue: Use mtx_t and u_cnd_monotonic 2024-07-08 22:09:06 +00:00
wsi_common_wayland.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
wsi_common_win32.cpp vulkan/wsi: Support alpha swapchains on win32 2024-11-13 04:26:46 +00:00
wsi_common_x11.c Revert "wsi: Implements scaling controls for DRI3 presentation." 2025-10-16 09:41:00 +00:00