mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 06:40:11 +01:00
Instead of util_dynarray_init(&dynarray, NULL), just use
UTIL_DYNARRAY_INIT instead. This is more ergonomic.
Via Coccinelle patch:
@@
identifier dynarray;
@@
-struct util_dynarray dynarray = {0};
-util_dynarray_init(&dynarray, NULL);
+struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;
@@
identifier dynarray;
@@
-struct util_dynarray dynarray;
-util_dynarray_init(&dynarray, NULL);
+struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;
@@
expression dynarray;
@@
-util_dynarray_init(&(dynarray), NULL);
+dynarray = UTIL_DYNARRAY_INIT;
@@
expression dynarray;
@@
-util_dynarray_init(dynarray, NULL);
+(*dynarray) = UTIL_DYNARRAY_INIT;
Followed by sed:
bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(&\(.*\), NULL)/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init( &\(.*\), NULL )/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(\(.*\), NULL)/*\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38189>
|
||
|---|---|---|
| .. | ||
| clc | ||
| glsl | ||
| isaspec | ||
| libcl | ||
| nir | ||
| rust | ||
| spirv | ||
| builtin_types.py | ||
| builtin_types_c.py | ||
| builtin_types_h.py | ||
| glsl_types.c | ||
| glsl_types.h | ||
| list.h | ||
| meson.build | ||
| shader_enums.c | ||
| shader_enums.h | ||
| shader_info.h | ||