From 6380da12f54ff3ca55a7443bd48a2c24a5dd6a24 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Mon, 2 Apr 2018 17:48:40 +0900 Subject: [PATCH] Fix a bug about checking callbacks Change-Id: I465e3575d633cbccb7514ee28e73c16339bf2f59 Signed-off-by: Junghoon Park --- idlc/c_gen/c_proxy_body_gen.cc | 2 +- idlc/c_gen/c_proxy_body_gen_cb.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/idlc/c_gen/c_proxy_body_gen.cc b/idlc/c_gen/c_proxy_body_gen.cc index 25e5f90..36ef713 100644 --- a/idlc/c_gen/c_proxy_body_gen.cc +++ b/idlc/c_gen/c_proxy_body_gen.cc @@ -41,7 +41,7 @@ void CProxyBodyGen::OnFiniGen(std::ofstream& stream) { void CProxyBodyGen::GenTypedefProxyDelegate(std::ofstream& stream) { const char format[] = - "typedef void (*proxy_delegate)(GList **list, rpc_port_parcel_h parcel, int seq_id);\n"; + "typedef void (*proxy_delegate)(GList **list, rpc_port_parcel_h parcel, int seq_id, int id);\n"; stream << NLine(1); stream << std::string(format); } diff --git a/idlc/c_gen/c_proxy_body_gen_cb.h b/idlc/c_gen/c_proxy_body_gen_cb.h index 6331217..1c9800f 100644 --- a/idlc/c_gen/c_proxy_body_gen_cb.h +++ b/idlc/c_gen/c_proxy_body_gen_cb.h @@ -127,7 +127,7 @@ int rpc_port_proxy_##_dispose(rpc_port_proxy_$$_h proxy, rpc_port_##_h delegate) const char CB_DELEGATE_INVOKER[] = R"__c_cb( -static void __$$_delegate_$$(GList **list, rpc_port_parcel_h parcel, int seq_id) +static void __$$_delegate_$$(GList **list, rpc_port_parcel_h parcel, int seq_id, int id) { $$ do { @@ -137,7 +137,7 @@ $$ iter = *list; while (iter) { handle = (struct ##_s *)iter->data; - if (handle->seq_id == seq_id) { + if (handle->seq_id == seq_id && handle->id == id) { $$ if (handle->once) { *list = g_list_remove_link(*list, iter); @@ -173,7 +173,7 @@ rpc_port_parcel_read_bool(parcel, &once); if (id > 0 && id < (sizeof(__##_delegate_table) / sizeof(__##_delegate_table[0]))) { if (__##_delegate_table[id]) - __##_delegate_table[id](list, parcel, seq_id); + __##_delegate_table[id](list, parcel, seq_id, id); } else { dlog_print(DLOG_WARN, LOG_TAG, "Unknown id(%d)", id); } -- 2.7.4