Fix user enum type out parameter in c proxy
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 28 May 2024 09:57:46 +0000 (18:57 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 18 Jun 2024 06:26:24 +0000 (15:26 +0900)
Change-Id: I0c7715ea9ed885a1c68c01bd93bb790f07303836
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
idlc/gen/version2/c_proxy_body_generator.cc
idlc/gen/version2/c_proxy_body_generator.hh

index 9cbbce7..4fbdd4d 100644 (file)
@@ -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("<NAME>", iface.GetID())
       .Change("<METHOD_NAME>", decl.GetID())
       .Change("<METHOD_PARAMS>", GenMethodParams(iface, decl))
-      .Change("<METHOD_ARGS>", GenMethodArgs(iface, decl))
+      .Change("<METHOD_ARGS>", GenMethodArgs(iface, decl, iface.GetID()))
       .Change("<ERROR_VALUE>", GetErrorValue(decl.GetType()))
       .Change("<METHOD_PARAMS_CHECK>", GenMethodParamsCheck(iface, decl))
       .ChangeToUpper("<UPPERCASE_PREFIX>", GetHandlePrefix())
index bdfbc55..ff26d08 100644 (file)
@@ -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,