Fix bug about generated type 64/172164/2
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 12 Mar 2018 09:02:46 +0000 (18:02 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 12 Mar 2018 10:07:58 +0000 (19:07 +0900)
Change-Id: I18921881c0c9946ddfcf7bd1d625f2a0baf90d54
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
idlc/c_gen/c_gen_base.cc
idlc/c_gen/c_gen_base.h
idlc/c_gen/c_proxy_body_gen.cc

index 68368ee..1204f8f 100644 (file)
@@ -104,7 +104,8 @@ std::string CGeneratorBase::GetFullNameFromType(const BaseType& type) {
   return str;
 }
 
-std::string CGeneratorBase::GetParcelParamTypeString(const BaseType& type) {
+std::string CGeneratorBase::GetParcelParamTypeString(const BaseType& type,
+                                                     bool is_pointer) {
   if (type.IsUserDefinedType())
     return "rpc_port_" + type.ToString() + "_h ";
 
@@ -115,7 +116,10 @@ std::string CGeneratorBase::GetParcelParamTypeString(const BaseType& type) {
   if (type.ToString() == "string")
     return "char *";
 
-  return type.ToString() + " *";
+  if (is_pointer)
+    return type.ToString() + " *";
+
+  return type.ToString() + " ";
 }
 
 std::string CGeneratorBase::GetReturnTypeString(const BaseType& type) {
index d5707af..4981162 100644 (file)
@@ -55,7 +55,8 @@ class CGeneratorBase : public Generator {
   std::string ConvertTypeToString(ParameterType::Direction direction,
                                   const BaseType& type);
   std::string GetFullNameFromType(const BaseType& type);
-  std::string GetParcelParamTypeString(const BaseType& type);
+  std::string GetParcelParamTypeString(const BaseType& type,
+                                       bool is_pointer = true);
   std::string GetReturnTypeString(const BaseType& type);
   std::string GetParamTypeString(ParameterType::Direction direction,
                                  const BaseType& type);
index 1e544e3..a03f4d9 100644 (file)
@@ -227,9 +227,9 @@ void CProxyBodyGen::GenInterfaceDelegatorInvoker(
           int cnt = 0;
           for (auto& i : decl.GetParameters().GetParams()) {
             str += GetParcelParamTypeString(
-              i->GetParameterType().GetBaseType()) +
+              i->GetParameterType().GetBaseType(), false) +
               i->GetID() + ";" + NLine(1);
-          cnt++;
+            cnt++;
           }
           if (cnt > 0)
             str += NLine(1);