From d33ae47825f0452599167378a29f27247180ade0 Mon Sep 17 00:00:00 2001 From: Dery Almas Date: Tue, 16 Dec 2025 13:47:05 +0100 Subject: [PATCH] Fix parameter anonymization Before this patch we removed both `name` and `declname`. Turns out that the only node using `name` for a "label" (for lack of a better word) was `Decl`. The rest of the nodes encoded actual useful typenames. This meant that, if the variable name and its type were the same (common thing with `struct`s), we would erase _both_ of them, which leads to broken signatures. The fix is simple: do not touch `name`. The codegen seems more than happy to generate anonymized parameters like this, as tested on libdecor (which led me to this), libwayland-client-core, xlib, and pulseaudio (which didn't build on Godot though due to a missing type? seems unrelated) --- generate-wrapper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/generate-wrapper.py b/generate-wrapper.py index 62b6294..c20130e 100755 --- a/generate-wrapper.py +++ b/generate-wrapper.py @@ -57,9 +57,6 @@ def replace_name(t, oldname, newname): if hasattr(t, "declname") and t.declname == oldname: t.declname = newname - if hasattr(t, "name") and t.name == oldname: - t.name = newname - if hasattr(t, "type"): replace_name(t.type, oldname, newname)