mesa/src/panfrost/genxml
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
..
test panvk: Add tests for ls tracking in cs_maybe 2025-06-13 08:28:30 +00:00
common.xml pan/lib: do not duplicate enum mali_pixel_kill 2025-08-20 00:05:36 +00:00
cs_builder.h panvk: Only call req_res when required 2025-10-24 08:01:51 +00:00
decode.c panvk: Fix IUB decode 2025-08-11 10:12:29 +00:00
decode.h
decode_common.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
decode_csf.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
decode_jm.c panfrost, panvk: Use arch version 9 to distinguish between Bifrost & Valhall 2025-06-18 16:09:03 +00:00
gen_macros.h
gen_pack.py pan/genxml: Make sure we catch overflows on 32-bit integer fields 2025-06-25 12:10:37 +02:00
meson.build panfrost/meson: drop invalid C-only -Wno-override-init from C++ args 2025-07-04 13:03:46 +00:00
pan_pack_helpers.h pan/genxml: Add missing parenthesis on pan_cast_and_pack macros 2025-07-21 16:32:51 +00:00
v4.xml pan/genxml: Make sure we catch overflows on 32-bit integer fields 2025-06-25 12:10:37 +02:00
v5.xml pan/genxml: Rework the RT/ZS emission logic 2025-06-27 07:06:07 +00:00
v6.xml pan/genxml: Rework the RT/ZS emission logic 2025-06-27 07:06:07 +00:00
v7.xml pan/genxml: Rework the RT/ZS emission logic 2025-06-27 07:06:07 +00:00
v9.xml pan/genxml: Rework the RT/ZS emission logic 2025-06-27 07:06:07 +00:00
v10.xml pan/genxml: Fix wrong size for compute size workgroup 2025-07-03 16:41:51 +00:00
v12.xml pan/genxml: Fix wrong size for compute size workgroup 2025-07-03 16:41:51 +00:00
v13.xml pan/genxml: Fix wrong size for compute size workgroup 2025-07-03 16:41:51 +00:00