geany icon indicating copy to clipboard operation
geany copied to clipboard

Rename both scope and var_type of anonymous types

Open techee opened this issue 2 years ago • 1 comments

In addition to scope, anonymous type can appear also inside var_type which should be renamed as well.

Fixes #3717.

techee avatar Mar 06 '24 22:03 techee

I tested our glfw build with this patch and it became perfectly reproducible + deterministic. Thanks a lot.

bmwiedemann avatar Mar 07 '24 07:03 bmwiedemann

When will this be merged?

bmwiedemann avatar Apr 16 '24 11:04 bmwiedemann

@b4n Does it look OK to you?

We have to rename the anonymous tag name both in scope and var_type so I moved the renaming to a separate function and call the function both on scope and var_type.

techee avatar Apr 17 '24 14:04 techee

@b4n Thanks for the review! I've just re-pushed the version with the changes you suggested.

techee avatar Apr 23 '24 20:04 techee

I had to make one more change, replace guint with gsize in what_len and replacement_len:

static gboolean replace_str(gchar **where, const gchar *what, gsize what_len,
	const gchar *replacement, gsize replacement_len)

because otherwise

gchar *str = g_malloc(where_len + (replacement_len - what_len) + 1);

may underflow.

Interestingly, only meson unit tests failed and not the autotools ones - not sure why.

techee avatar Apr 23 '24 21:04 techee