From 21a5f1c00114f71645e8455d694373497362ed50 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Mar 2018 17:17:18 +0100 Subject: [PATCH] fix(core): remove useless include, virtual... And add required virtual on some classes (add a -Wdelete-non-virtual-dtor warning on clang) --- CMakeLists.txt | 2 +- src/call/call-p.h | 2 -- src/call/remote-conference-call.h | 2 +- src/conference/conference-listener.h | 8 ++------ src/conference/conference.h | 2 +- src/conference/session/call-session-p.h | 2 -- src/conference/session/call-session.h | 2 +- src/conference/session/media-session.cpp | 2 +- src/conference/session/media-session.h | 2 +- 9 files changed, 8 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bae67bcb6..ca173404d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,7 +284,7 @@ else() list(APPEND STRICT_OPTIONS_C "-fno-inline-small-functions") endif() if(CMAKE_C_COMPILER_ID MATCHES "Clang") - list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds") + list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds -Wdelete-non-virtual-dtor") endif() if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") list(APPEND STRICT_OPTIONS_CXX "-x c++") diff --git a/src/call/call-p.h b/src/call/call-p.h index 0c6f9ae65..7b2754ff6 100644 --- a/src/call/call-p.h +++ b/src/call/call-p.h @@ -38,8 +38,6 @@ class RealTimeTextChatRoom; class CallPrivate : public ObjectPrivate, public CallSessionListener { public: - CallPrivate () = default; - void initiateIncoming (); bool initiateOutgoing (); void iterate (time_t currentRealTime, bool oneSecondElapsed); diff --git a/src/call/remote-conference-call.h b/src/call/remote-conference-call.h index f2a50fd00..9360b2c11 100644 --- a/src/call/remote-conference-call.h +++ b/src/call/remote-conference-call.h @@ -42,7 +42,7 @@ public: SalCallOp *op, const MediaSessionParams *msp ); - virtual ~RemoteConferenceCall (); + ~RemoteConferenceCall (); std::shared_ptr getCore () const; diff --git a/src/conference/conference-listener.h b/src/conference/conference-listener.h index e4da1bd7b..f185259f8 100644 --- a/src/conference/conference-listener.h +++ b/src/conference/conference-listener.h @@ -20,22 +20,18 @@ #ifndef _L_CONFERENCE_LISTENER_H_ #define _L_CONFERENCE_LISTENER_H_ -#include -#include #include -#include "linphone/utils/general.h" - #include "event-log/events.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE -class IdentityAddress; - class ConferenceListener { public: + virtual ~ConferenceListener () = default; + virtual void onConferenceCreated (const IdentityAddress &addr) {} virtual void onConferenceKeywordsChanged (const std::vector &keywords) {} virtual void onConferenceTerminated (const IdentityAddress &addr) {} diff --git a/src/conference/conference.h b/src/conference/conference.h index ed8d93637..0df0ae998 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -43,7 +43,7 @@ class LINPHONE_PUBLIC Conference : friend class CallSessionPrivate; public: - virtual ~Conference(); + ~Conference(); std::shared_ptr getActiveParticipant () const; diff --git a/src/conference/session/call-session-p.h b/src/conference/session/call-session-p.h index fb425b508..fc62e4e43 100644 --- a/src/conference/session/call-session-p.h +++ b/src/conference/session/call-session-p.h @@ -31,8 +31,6 @@ LINPHONE_BEGIN_NAMESPACE class CallSessionPrivate : public ObjectPrivate, public CoreListener { public: - CallSessionPrivate () = default; - int computeDuration () const; virtual void initializeParamsAccordingToIncomingCallParams (); void notifyReferState (); diff --git a/src/conference/session/call-session.h b/src/conference/session/call-session.h index fa3969b64..63330f3d0 100644 --- a/src/conference/session/call-session.h +++ b/src/conference/session/call-session.h @@ -54,7 +54,7 @@ public: L_DECLARE_ENUM(State, L_ENUM_VALUES_CALL_SESSION_STATE); CallSession (const std::shared_ptr &core, const CallSessionParams *params, CallSessionListener *listener); - virtual ~CallSession (); + ~CallSession (); LinphoneStatus accept (const CallSessionParams *csp = nullptr); LinphoneStatus acceptUpdate (const CallSessionParams *csp = nullptr); diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 506f8687d..2994d721d 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -3432,7 +3432,7 @@ void MediaSessionPrivate::reportBandwidth () { lInfo() << "Bandwidth usage for CallSession [" << q << "]:\n" << fixed << setprecision(2) << "\tRTP audio=[d=" << linphone_call_stats_get_download_bandwidth(audioStats) << ",u=" << linphone_call_stats_get_upload_bandwidth(audioStats) << - "], video=[d=" << linphone_call_stats_get_download_bandwidth(videoStats) << ",u=" << linphone_call_stats_get_upload_bandwidth(videoStats) << ",ed=" << linphone_call_stats_get_estimated_download_bandwidth(videoStats) << + "], video=[d=" << linphone_call_stats_get_download_bandwidth(videoStats) << ",u=" << linphone_call_stats_get_upload_bandwidth(videoStats) << ",ed=" << linphone_call_stats_get_estimated_download_bandwidth(videoStats) << "], text=[d=" << linphone_call_stats_get_download_bandwidth(textStats) << ",u=" << linphone_call_stats_get_upload_bandwidth(textStats) << "] kbits/sec\n" << "\tRTCP audio=[d=" << linphone_call_stats_get_rtcp_download_bandwidth(audioStats) << ",u=" << linphone_call_stats_get_rtcp_upload_bandwidth(audioStats) << "], video=[d=" << linphone_call_stats_get_rtcp_download_bandwidth(videoStats) << ",u=" << linphone_call_stats_get_rtcp_upload_bandwidth(videoStats) << diff --git a/src/conference/session/media-session.h b/src/conference/session/media-session.h index 695c44ae4..18fc76d2a 100644 --- a/src/conference/session/media-session.h +++ b/src/conference/session/media-session.h @@ -40,7 +40,7 @@ class LINPHONE_PUBLIC MediaSession : public CallSession { public: MediaSession (const std::shared_ptr &core, std::shared_ptr me, const CallSessionParams *params, CallSessionListener *listener); - virtual ~MediaSession (); + ~MediaSession (); LinphoneStatus accept (const MediaSessionParams *msp = nullptr); LinphoneStatus acceptEarlyMedia (const MediaSessionParams *msp = nullptr);