From: Hwankyu Jhun Date: Mon, 21 Feb 2022 03:30:00 +0000 (+0900) Subject: Fix a bug about delegate invoke method X-Git-Tag: submit/tizen_6.5/20220221.041501~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c42c0c723f415cf1026c627daa3760c4092f7ec2;p=platform%2Fcore%2Fappfw%2Ftidl.git Fix a bug about delegate invoke method The first parcel data has to be __METHOD_CALLBACK_. Change-Id: If4bc8bc64eec007117fa7e3236655cf6608a1212 Signed-off-by: Hwankyu Jhun --- diff --git a/idlc/gen/c_stub_body_gen.cc b/idlc/gen/c_stub_body_gen.cc index 60e168a4..728017f7 100644 --- a/idlc/gen/c_stub_body_gen.cc +++ b/idlc/gen/c_stub_body_gen.cc @@ -368,6 +368,14 @@ void CStubBodyGen::GenInterfaceDelegateBase(std::ofstream& stream, code = ReplaceAll(code, "", GenDelegateParcelWrite(iface, decl)); + std::string prefix = GetHandlePrefix(); + std::transform(prefix.begin(), prefix.end(), prefix.begin(), ::toupper); + code = ReplaceAll(code, "", prefix); + + std::string name = iface.GetID(); + std::transform(name.begin(), name.end(), name.begin(), ::toupper); + code = ReplaceAll(code, "", name); + stream << SmartIndent(code); } diff --git a/idlc/gen/c_stub_body_gen_cb.h b/idlc/gen/c_stub_body_gen_cb.h index d9dc5e4a..6c63fb59 100644 --- a/idlc/gen/c_stub_body_gen_cb.h +++ b/idlc/gen/c_stub_body_gen_cb.h @@ -432,6 +432,8 @@ static void ____remove_context(__context_h context) * The implementation to check whether arguments are nullptr or not * The enumeration value of the method. * The implementation to write arguments to the parcel. + * The uppercase prefix of the interface. + * The uppercase name of the interface. */ constexpr const char CB_INTERFACE_DELEGATE_BASE[] = R"__c_cb( @@ -638,7 +640,7 @@ int ___invoke(___h h); + rpc_port_parcel_write_int32(parcel_, __METHOD_CALLBACK_); rpc_port_parcel_write(parcel_, &h->parcelable, h);