From 3b08856dc0e85a36f2a31019c96350572ac74b22 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Sep 2017 10:16:26 +0200 Subject: [PATCH] feat(c-wrapper): remove CPP_TYPE parameter of L_GET_CPP_PTR_FROM_C_STRUCT --- coreapi/chat.c | 6 +++--- coreapi/chat_file_transfer.c | 2 +- coreapi/linphonecore.c | 2 +- src/c-wrapper/api/c-call-params.cpp | 2 +- src/c-wrapper/api/c-call.cpp | 16 ++++++++-------- src/c-wrapper/api/c-chat-message.cpp | 8 ++++---- src/c-wrapper/api/c-chat-room.cpp | 12 ++++++------ src/c-wrapper/api/c-event-log.cpp | 15 +++++---------- src/c-wrapper/api/c-participant.cpp | 6 +++--- src/c-wrapper/internal/c-tools.h | 13 ++++++++----- src/chat/chat-room.cpp | 2 +- src/conference/session/call-session.cpp | 3 +-- src/conference/session/media-session.cpp | 2 +- 13 files changed, 43 insertions(+), 46 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 6d69e0788..4ea5462fb 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -80,7 +80,7 @@ static LinphoneChatRoom *_linphone_core_create_chat_room_from_url(LinphoneCore * } static bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneAddress *from) { - LinphoneAddress *addr = linphone_address_new(L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom)->getPeerAddress().asString().c_str()); + LinphoneAddress *addr = linphone_address_new(L_GET_CPP_PTR_FROM_C_STRUCT(cr)->getPeerAddress().asString().c_str()); bool_t result = linphone_address_weak_equal(addr, from); linphone_address_unref(addr); return result; @@ -235,8 +235,8 @@ int linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call) { if (linphone_core_realtime_text_enabled(lc)) { std::shared_ptr rttcr = - std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom)); + std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr)); L_GET_PRIVATE(rttcr)->realtimeTextReceived(character, call); - //L_GET_PRIVATE(std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom, ChatRoom)))->realtimeTextReceived(character, call); + //L_GET_PRIVATE(std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr)))->realtimeTextReceived(character, call); } } diff --git a/coreapi/chat_file_transfer.c b/coreapi/chat_file_transfer.c index 8f8e86a01..49e1670cf 100644 --- a/coreapi/chat_file_transfer.c +++ b/coreapi/chat_file_transfer.c @@ -29,5 +29,5 @@ #include "chat/chat-room.h" LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) { - return L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom)->createFileTransferMessage(initial_content); + return L_GET_CPP_PTR_FROM_C_STRUCT(cr)->createFileTransferMessage(initial_content); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d4fc6cb4d..14dfb26e3 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6653,7 +6653,7 @@ void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m) { } void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params) { - L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams)->initDefault(lc); + L_GET_CPP_PTR_FROM_C_STRUCT(params)->initDefault(lc); } void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) { diff --git a/src/c-wrapper/api/c-call-params.cpp b/src/c-wrapper/api/c-call-params.cpp index 5a8fbc5d7..804055dcc 100644 --- a/src/c-wrapper/api/c-call-params.cpp +++ b/src/c-wrapper/api/c-call-params.cpp @@ -22,7 +22,7 @@ // ============================================================================= -#define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, MediaSessionParams) +#define GET_MEDIA_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_MEDIA_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, MediaSessionParams) L_DECLARE_C_CLONABLE_STRUCT_IMPL(CallParams) diff --git a/src/c-wrapper/api/c-call.cpp b/src/c-wrapper/api/c-call.cpp index 02fb800a7..6b0edacbd 100644 --- a/src/c-wrapper/api/c-call.cpp +++ b/src/c-wrapper/api/c-call.cpp @@ -28,7 +28,7 @@ // ============================================================================= -#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, Call) +#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, Call) using namespace std; @@ -936,7 +936,7 @@ LinphoneStatus linphone_call_accept (LinphoneCall *call) { } LinphoneStatus linphone_call_accept_with_params (LinphoneCall *call, const LinphoneCallParams *params) { - return GET_CPP_PTR(call)->accept(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams) : nullptr); + return GET_CPP_PTR(call)->accept(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); } LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) { @@ -944,11 +944,11 @@ LinphoneStatus linphone_call_accept_early_media (LinphoneCall* call) { } LinphoneStatus linphone_call_accept_early_media_with_params (LinphoneCall *call, const LinphoneCallParams *params) { - return GET_CPP_PTR(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams) : nullptr); + return GET_CPP_PTR(call)->acceptEarlyMedia(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); } LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params) { - return GET_CPP_PTR(call)->update(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams) : nullptr); + return GET_CPP_PTR(call)->update(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); } LinphoneStatus linphone_call_defer_update (LinphoneCall *call) { @@ -971,7 +971,7 @@ LinphoneStatus linphone_call_defer_update (LinphoneCall *call) { } LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params) { - return GET_CPP_PTR(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams) : nullptr); + return GET_CPP_PTR(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_STRUCT(params) : nullptr); } LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *refer_to) { @@ -1188,8 +1188,8 @@ void linphone_call_set_user_data (LinphoneCall *call, void *ud) { LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg) { LinphoneCall *call = L_INIT(Call); L_SET_CPP_PTR_FROM_C_STRUCT(call, std::make_shared(call, lc, LinphoneCallOutgoing, - *L_GET_CPP_PTR_FROM_C_STRUCT(from, Address), *L_GET_CPP_PTR_FROM_C_STRUCT(to, Address), - cfg, nullptr, L_GET_CPP_PTR_FROM_C_STRUCT(params, MediaSessionParams))); + *L_GET_CPP_PTR_FROM_C_STRUCT(from), *L_GET_CPP_PTR_FROM_C_STRUCT(to), + cfg, nullptr, L_GET_CPP_PTR_FROM_C_STRUCT(params))); call->currentParamsCache = linphone_call_params_new_for_wrapper(); call->paramsCache = linphone_call_params_new_for_wrapper(); call->remoteParamsCache = linphone_call_params_new_for_wrapper(); @@ -1200,7 +1200,7 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, SalOp *op) { LinphoneCall *call = L_INIT(Call); L_SET_CPP_PTR_FROM_C_STRUCT(call, std::make_shared(call, lc, LinphoneCallIncoming, - *L_GET_CPP_PTR_FROM_C_STRUCT(from, Address), *L_GET_CPP_PTR_FROM_C_STRUCT(to, Address), + *L_GET_CPP_PTR_FROM_C_STRUCT(from), *L_GET_CPP_PTR_FROM_C_STRUCT(to), nullptr, op, nullptr)); call->currentParamsCache = linphone_call_params_new_for_wrapper(); call->paramsCache = linphone_call_params_new_for_wrapper(); diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index c1b157220..022696139 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -30,7 +30,7 @@ // ============================================================================= -#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, ChatMessage, ChatMessage) +#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, ChatMessage, ChatMessage) using namespace std; @@ -324,7 +324,7 @@ void _linphone_chat_message_resend(LinphoneChatMessage *msg, bool_t ref_msg) { cr = linphone_chat_message_get_chat_room(msg); if (ref_msg) linphone_chat_message_ref(msg); - L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom)->sendMessage(msg); + L_GET_CPP_PTR_FROM_C_STRUCT(cr)->sendMessage(msg); } void linphone_chat_message_resend(LinphoneChatMessage *msg) { @@ -465,7 +465,7 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) { LinphoneChatRoom *cr = linphone_chat_message_get_chat_room(msg); if (linphone_core_realtime_text_enabled(linphone_chat_room_get_core(cr))) { std::shared_ptr rttcr = - std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr, ChatRoom)); + std::static_pointer_cast(L_GET_CPP_PTR_FROM_C_STRUCT(cr)); LinphoneCall *call = rttcr->getCall(); LinphoneCore *lc = rttcr->getCore(); const uint32_t new_line = 0x2028; @@ -936,7 +936,7 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co linphone_chat_message_ref(msg); linphone_chat_message_set_state(msg, LinphoneChatMessageStateFileTransferDone); _release_http_request(msg); - L_GET_CPP_PTR_FROM_C_STRUCT(msg->chat_room, ChatRoom)->sendMessage(msg); + L_GET_CPP_PTR_FROM_C_STRUCT(msg->chat_room)->sendMessage(msg); file_upload_end_background_task(msg); linphone_chat_message_unref(msg); } else { diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index ca7316fa5..e923279a6 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -29,7 +29,7 @@ // ============================================================================= -#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj, ChatRoom) +#define GET_CPP_PTR(obj) L_GET_CPP_PTR_FROM_C_STRUCT(obj) #define GET_CPP_PRIVATE_PTR(obj) L_GET_PRIVATE_FROM_C_STRUCT(obj, ChatRoom) using namespace std; @@ -211,7 +211,7 @@ LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr) LinphoneParticipant *linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr) { return L_GET_C_BACK_PTR(GET_CPP_PTR(cr)->addParticipant( - *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address), nullptr, false), + *L_GET_CPP_PTR_FROM_C_STRUCT(addr), nullptr, false), Participant); } @@ -237,7 +237,7 @@ bctbx_list_t *linphone_chat_room_get_participants (const LinphoneChatRoom *cr) { } void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant) { - GET_CPP_PTR(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_STRUCT(participant, Participant)); + GET_CPP_PTR(cr)->removeParticipant(L_GET_CPP_PTR_FROM_C_STRUCT(participant)); } void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants) { @@ -272,9 +272,9 @@ void linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) { LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) { LinphoneChatRoom *cr = _linphone_ChatRoom_init(); if (linphone_core_realtime_text_enabled(core)) - L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address))); + L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr))); else - L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr, Address))); + L_SET_CPP_PTR_FROM_C_STRUCT(cr, std::make_shared(core, *L_GET_CPP_PTR_FROM_C_STRUCT(addr))); linphone_core_notify_chat_room_instantiated(core, cr); L_GET_PRIVATE_FROM_C_STRUCT(cr, ChatRoom)->setState(LinphonePrivate::ChatRoom::State::Instantiated); L_GET_PRIVATE_FROM_C_STRUCT(cr, ChatRoom)->setState(LinphonePrivate::ChatRoom::State::Created); @@ -290,7 +290,7 @@ LinphoneChatRoom *linphone_client_group_chat_room_new (LinphoneCore *core, const linphone_address_unref(factoryAddr); std::string from; if (proxy) - from = L_GET_CPP_PTR_FROM_C_STRUCT(linphone_proxy_config_get_identity_address(proxy), Address)->asString(); + from = L_GET_CPP_PTR_FROM_C_STRUCT(linphone_proxy_config_get_identity_address(proxy))->asString(); if (from.empty()) from = linphone_core_get_primary_contact(core); LinphonePrivate::Address me(from); diff --git a/src/c-wrapper/api/c-event-log.cpp b/src/c-wrapper/api/c-event-log.cpp index 94b259618..086487144 100644 --- a/src/c-wrapper/api/c-event-log.cpp +++ b/src/c-wrapper/api/c-event-log.cpp @@ -53,7 +53,7 @@ LinphoneEventLog *linphone_event_log_ref (LinphoneEventLog *event_log) { LinphoneEventLogType linphone_event_log_get_type (const LinphoneEventLog *event_log) { return static_cast( - L_GET_CPP_PTR_FROM_C_STRUCT(event_log, EventLog)->getType() + L_GET_CPP_PTR_FROM_C_STRUCT(event_log)->getType() ); } @@ -67,7 +67,7 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC call_event, new LINPHONE_NAMESPACE::CallEvent( static_cast(type), - L_GET_CPP_PTR_FROM_C_STRUCT(call, Call) + L_GET_CPP_PTR_FROM_C_STRUCT(call) ) ); return call_event; @@ -75,10 +75,7 @@ LinphoneCallEvent *linphone_call_event_new (LinphoneEventLogType type, LinphoneC LinphoneCall *linphone_call_event_get_call (const LinphoneCallEvent *call_event) { return L_GET_C_BACK_PTR( - L_GET_CPP_PTR_FROM_C_STRUCT( - call_event, CallEvent - )->getCall(), - Call + L_GET_CPP_PTR_FROM_C_STRUCT(call_event)->getCall(), Call ); } @@ -128,7 +125,7 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage * L_SET_CPP_PTR_FROM_C_STRUCT( chat_message_event, new LINPHONE_NAMESPACE::ChatMessageEvent( - L_GET_CPP_PTR_FROM_C_STRUCT(chat_message, ChatMessage) + L_GET_CPP_PTR_FROM_C_STRUCT(chat_message) ) ); return chat_message_event; @@ -136,9 +133,7 @@ LinphoneChatMessageEvent *linphone_chat_message_event_new (LinphoneChatMessage * LinphoneChatMessage *linphone_chat_message_event_get_chat_message (const LinphoneChatMessageEvent *chat_message_event) { return L_GET_C_BACK_PTR( - L_GET_CPP_PTR_FROM_C_STRUCT( - chat_message_event, ChatMessageEvent - )->getChatMessage(), + L_GET_CPP_PTR_FROM_C_STRUCT(chat_message_event)->getChatMessage(), ChatMessage ); } diff --git a/src/c-wrapper/api/c-participant.cpp b/src/c-wrapper/api/c-participant.cpp index d79ee04d2..69d07deaf 100644 --- a/src/c-wrapper/api/c-participant.cpp +++ b/src/c-wrapper/api/c-participant.cpp @@ -47,7 +47,7 @@ void linphone_participant_set_user_data(LinphoneParticipant *participant, void * } const LinphoneAddress *linphone_participant_get_address (const LinphoneParticipant *participant) { - LinphonePrivate::Address addr = L_GET_CPP_PTR_FROM_C_STRUCT(participant, Participant)->getAddress(); + LinphonePrivate::Address addr = L_GET_CPP_PTR_FROM_C_STRUCT(participant)->getAddress(); if (participant->addressCache) linphone_address_unref(participant->addressCache); participant->addressCache = linphone_address_new(addr.asString().c_str()); @@ -55,9 +55,9 @@ const LinphoneAddress *linphone_participant_get_address (const LinphoneParticipa } bool_t linphone_participant_is_admin (const LinphoneParticipant *participant) { - return L_GET_CPP_PTR_FROM_C_STRUCT(participant, Participant)->isAdmin(); + return L_GET_CPP_PTR_FROM_C_STRUCT(participant)->isAdmin(); } void linphone_participant_set_admin (LinphoneParticipant *participant, bool_t value) { - L_GET_CPP_PTR_FROM_C_STRUCT(participant, Participant)->setAdmin(value); + L_GET_CPP_PTR_FROM_C_STRUCT(participant)->setAdmin(value); } diff --git a/src/c-wrapper/internal/c-tools.h b/src/c-wrapper/internal/c-tools.h index 6af4adde1..6062b71fc 100644 --- a/src/c-wrapper/internal/c-tools.h +++ b/src/c-wrapper/internal/c-tools.h @@ -323,6 +323,9 @@ LINPHONE_END_NAMESPACE #define L_CPP_TYPE_OF_C_TYPE(C_TYPE) \ LINPHONE_NAMESPACE::CTypeToCppType::type +#define L_CPP_TYPE_OF_C_OBJECT(C_OBJECT) \ + LINPHONE_NAMESPACE::CTypeToCppType::type>::type>::type + // ----------------------------------------------------------------------------- // C object declaration. // ----------------------------------------------------------------------------- @@ -392,9 +395,9 @@ LINPHONE_END_NAMESPACE #define L_INIT(C_TYPE) _linphone_ ## C_TYPE ## _init () // Get the cpp-ptr of a wrapped C object. -#define L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT, CPP_TYPE) \ +#define L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT) \ LINPHONE_NAMESPACE::Wrapper::getCppPtrFromC< \ - LINPHONE_NAMESPACE::CPP_TYPE, \ + L_CPP_TYPE_OF_C_OBJECT(OBJECT), \ std::remove_pointer::type \ >(OBJECT) @@ -409,7 +412,7 @@ LINPHONE_END_NAMESPACE // Get the private data of a shared or simple cpp-ptr of a wrapped C object. #define L_GET_PRIVATE_FROM_C_STRUCT(OBJECT, CPP_TYPE) \ L_GET_PRIVATE(LINPHONE_NAMESPACE::Wrapper::getCppPtr( \ - L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT, CPP_TYPE) \ + L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT) \ )) // Get the wrapped C object of a C++ object. @@ -421,11 +424,11 @@ LINPHONE_END_NAMESPACE // Get/set user data on a wrapped C object. #define L_GET_USER_DATA_FROM_C_STRUCT(OBJECT, CPP_TYPE) \ LINPHONE_NAMESPACE::Wrapper::getUserData( \ - L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT, CPP_TYPE) \ + L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT) \ ) #define L_SET_USER_DATA_FROM_C_STRUCT(OBJECT, VALUE, CPP_TYPE) \ LINPHONE_NAMESPACE::Wrapper::setUserData( \ - L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT, CPP_TYPE), \ + L_GET_CPP_PTR_FROM_C_STRUCT(OBJECT), \ VALUE \ ) diff --git a/src/chat/chat-room.cpp b/src/chat/chat-room.cpp index b34123947..52b19cdfc 100644 --- a/src/chat/chat-room.cpp +++ b/src/chat/chat-room.cpp @@ -828,7 +828,7 @@ void ChatRoom::sendMessage (LinphoneChatMessage *msg) { if (identity.empty()) { LinphoneProxyConfig *proxy = linphone_core_lookup_known_proxy(d->core, peer); if (proxy) { - identity = L_GET_CPP_PTR_FROM_C_STRUCT(linphone_proxy_config_get_identity_address(proxy), Address)->asString(); + identity = L_GET_CPP_PTR_FROM_C_STRUCT(linphone_proxy_config_get_identity_address(proxy))->asString(); } else { identity = linphone_core_get_primary_contact(d->core); } diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index 4e0bf9085..9d44061a6 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -963,8 +963,7 @@ LinphoneReason CallSession::getReason () const { const Address& CallSession::getRemoteAddress () const { L_D(const CallSession); return *L_GET_CPP_PTR_FROM_C_STRUCT((d->direction == LinphoneCallIncoming) - ? linphone_call_log_get_from(d->log) : linphone_call_log_get_to(d->log), - Address); + ? linphone_call_log_get_from(d->log) : linphone_call_log_get_to(d->log)); } string CallSession::getRemoteAddressAsString () const { diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 75eaddcc2..2d837f700 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -1221,7 +1221,7 @@ void MediaSessionPrivate::makeLocalMediaDescription () { /* Re-check local ip address each time we make a new offer, because it may change in case of network reconnection */ { LinphoneAddress *address = (direction == LinphoneCallOutgoing ? log->to : log->from); - getLocalIp(*L_GET_CPP_PTR_FROM_C_STRUCT(address, Address)); + getLocalIp(*L_GET_CPP_PTR_FROM_C_STRUCT(address)); } strncpy(md->addr, mediaLocalIp.c_str(), sizeof(md->addr));