diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2018-12-14 17:21:58 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2018-12-14 17:21:58 +0900 |
commit | 04d50d29dfdb41f19c5922534c28e115ae4296d3 (patch) | |
tree | 5018024c12ad56b897ef480aeb939e1698a830f9 | |
parent | d7d969b619c0d803db2012fd4834847d81c00a96 (diff) | |
download | tidl-04d50d29dfdb41f19c5922534c28e115ae4296d3.tar.gz tidl-04d50d29dfdb41f19c5922534c28e115ae4296d3.tar.bz2 tidl-04d50d29dfdb41f19c5922534c28e115ae4296d3.zip |
Fix bugs about C generator
This patch is to fix bugs about user-defined types.
Change-Id: I0478da6b617499ad3680b16057008cfce3327dad
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | idlc/c_gen/c_body_gen_base.cc | 12 | ||||
-rw-r--r-- | idlc/c_gen/c_header_gen_base.cc | 3 |
2 files changed, 5 insertions, 10 deletions
diff --git a/idlc/c_gen/c_body_gen_base.cc b/idlc/c_gen/c_body_gen_base.cc index 00332cf..b744b49 100644 --- a/idlc/c_gen/c_body_gen_base.cc +++ b/idlc/c_gen/c_body_gen_base.cc @@ -241,9 +241,6 @@ void CBodyGeneratorBase::GenStructureGetter(std::ofstream& stream, return GetStructIdWithNamespace(st); }, [&]()->std::string { - if (i->GetType().IsUserDefinedType()) - return GetParcelParamTypeString(i->GetType()); - if (i->GetType().ToString() == "array") return GetStringFromElementType(i->GetType()) + "*"; @@ -265,7 +262,7 @@ void CBodyGeneratorBase::GenStructureGetter(std::ofstream& stream, std::string str; str += "!"; str += i->GetID(); - str += "|| "; + str += " || "; str += "!" + i->GetID() + "_size"; return str; } @@ -446,7 +443,7 @@ std::string CBodyGeneratorBase::GetParcelWriteString(const std::string& id, }, [&]()->std::string { if (type.IsUserDefinedType()) - return "&h->" + id + ", h->" + id; + return "&h->" + id + "->parcelable, h->" + id; if (type.ToString() == "list") return "g_list_length(h->" + id + ")"; if (type.ToString() == "array") @@ -661,7 +658,7 @@ std::string CBodyGeneratorBase::GetParcelReadString(const std::string& id, }, [&]()->std::string { if (type.IsUserDefinedType()) - return "&h->" + id + "h->" + id; + return "&h->" + id + "->parcelable, h->" + id; return "&h->" + id; }); } @@ -869,7 +866,8 @@ std::string CBodyGeneratorBase::GetGetterString(const std::string& id, } if (type.IsUserDefinedType()) { - str += GetSetterString(type, id, "h->" + id); + str += GetHandlePrefix() + GetFullNameFromType(type) + + "_clone(h->"+ id + ", " + id +");" + NLine(1); } else { str += GetSetterString(type, "*" + id, "h->" + id); } diff --git a/idlc/c_gen/c_header_gen_base.cc b/idlc/c_gen/c_header_gen_base.cc index c726d2f..ee86046 100644 --- a/idlc/c_gen/c_header_gen_base.cc +++ b/idlc/c_gen/c_header_gen_base.cc @@ -185,9 +185,6 @@ void CHeaderGeneratorBase::GenStructureGetter(std::ofstream& stream, return GetStructIdWithNamespace(st); }, [&]()->std::string { - if (i->GetType().IsUserDefinedType()) - return GetParcelParamTypeString(i->GetType()); - if (i->GetType().ToString() == "array") return GetStringFromElementType(i->GetType()) + "*"; |