From 15e18a2682ef1457d1703aa21518f96f8c3235dd Mon Sep 17 00:00:00 2001 From: Ilho Kim Date: Tue, 28 May 2024 18:57:46 +0900 Subject: [PATCH] Fix user enum type out parameter in c proxy Change-Id: I0c7715ea9ed885a1c68c01bd93bb790f07303836 Signed-off-by: Ilho Kim --- idlc/gen/version2/c_proxy_body_generator.cc | 6 +++--- idlc/gen/version2/c_proxy_body_generator.hh | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/idlc/gen/version2/c_proxy_body_generator.cc b/idlc/gen/version2/c_proxy_body_generator.cc index 9cbbce7..4fbdd4d 100644 --- a/idlc/gen/version2/c_proxy_body_generator.cc +++ b/idlc/gen/version2/c_proxy_body_generator.cc @@ -186,7 +186,7 @@ std::string CProxyBodyGenerator::GenMethodParams(const Interface& iface, } std::string CProxyBodyGenerator::GenMethodArgs(const Interface& iface, - const Declaration& decl) { + const Declaration& decl, const std::string& id) { std::string code; for (const auto& param : decl.GetParameters()) { auto& param_type = param->GetParameterType(); @@ -194,7 +194,7 @@ std::string CProxyBodyGenerator::GenMethodArgs(const Interface& iface, continue; auto& type = param_type.GetBaseType(); - code += GetReturnTypeString(type) + "new_" + param->GetID() + ";"; + code += GetReturnTypeString(type, id) + "new_" + param->GetID() + ";"; code += NLine(1); } @@ -389,7 +389,7 @@ void CProxyBodyGenerator::GenMethodBase(std::ofstream& stream, .Change("", iface.GetID()) .Change("", decl.GetID()) .Change("", GenMethodParams(iface, decl)) - .Change("", GenMethodArgs(iface, decl)) + .Change("", GenMethodArgs(iface, decl, iface.GetID())) .Change("", GetErrorValue(decl.GetType())) .Change("", GenMethodParamsCheck(iface, decl)) .ChangeToUpper("", GetHandlePrefix()) diff --git a/idlc/gen/version2/c_proxy_body_generator.hh b/idlc/gen/version2/c_proxy_body_generator.hh index bdfbc55..ff26d08 100644 --- a/idlc/gen/version2/c_proxy_body_generator.hh +++ b/idlc/gen/version2/c_proxy_body_generator.hh @@ -45,7 +45,9 @@ class CProxyBodyGenerator : public CBodyGeneratorBase { const Interface& iface); void GenInterface(std::ofstream& stream); std::string GenMethodParams(const Interface& iface, const Declaration& decl); - std::string GenMethodArgs(const Interface& iface, const Declaration& decl); + std::string GenMethodArgs(const Interface& iface, + const Declaration& decl, + const std::string& id); std::string GenMethodParamsCheck(const Interface& iface, const Declaration& decl); std::string GenMethodUnitMapWrite(const Interface& iface, -- 2.7.4