From 4d7367b6eee87397e2dbca2e78078dd0a4ef4c61 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 21 Dec 2024 15:05:13 +0000 Subject: [PATCH] client: use the proper new_id index in marshalling fixes #13 --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8cb6429..4502788 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -675,8 +675,8 @@ static const void* {}[] = {{ std::string argsN = ", "; for (auto& arg : ev.args) { if (arg.newType) - continue; - if (!WPTypeToCType(arg, true).starts_with("C")) + argsN += "nullptr, "; + else if (!WPTypeToCType(arg, true).starts_with("C")) argsN += arg.name + ", "; else argsN += (arg.name + " ? " + arg.name + "->pResource : nullptr, "); @@ -703,12 +703,12 @@ void {}::{}({}) {{ if (!pResource) return{};{} - auto proxy = wl_proxy_marshal_flags((wl_proxy*)pResource, {}, {}, wl_proxy_get_version((wl_proxy*)pResource), {}{}{});{} + auto proxy = wl_proxy_marshal_flags((wl_proxy*)pResource, {}, {}, wl_proxy_get_version((wl_proxy*)pResource), {}{});{} }} )#", ptrRetType, IFACE_CLASS_NAME_CAMEL, EVENT_NAME, argsC, (ev.newIdType.empty() ? "" : " nullptr"), - (ev.destructor ? "\n destroyed = true;" : ""), evid, (ev.newIdType.empty() ? "nullptr" : "&" + ev.newIdType + "_interface"), flags, - (!ev.newIdType.empty() ? ", nullptr" : ""), argsN, (ev.newIdType.empty() ? "\n proxy;" : "\n\n return proxy;")); + (ev.destructor ? "\n destroyed = true;" : ""), evid, (ev.newIdType.empty() ? "nullptr" : "&" + ev.newIdType + "_interface"), flags, argsN, + (ev.newIdType.empty() ? "\n proxy;" : "\n\n return proxy;")); } evid++;