From 13ff63532cda2170e7e42068da01cee0368054ad Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Wed, 10 May 2023 09:56:38 +0200 Subject: [PATCH] MT#57391 sems (CE): eliminate the `auto_ptr` usage (deprecated in C++11) Eliminate the `auto_ptr` usage for core/* , since this pointer type has been deprecated in C++11. Use, as recommended, `unique_ptr` instead. Change-Id: I352e03bd0c8401d9a4890d8a1845913e4c22dab3 --- apps/announcement/Announcement.h | 2 +- apps/annrecorder/AnnRecorder.h | 4 ++-- apps/click2dial/Click2Dial.h | 4 ++-- apps/conference/Conference.cpp | 2 +- apps/conference/Conference.h | 16 ++++++++-------- apps/dsm/DSMCall.h | 6 +++--- apps/dsm/DSMSession.cpp | 2 +- apps/dsm/DSMSession.h | 2 +- apps/dsm/mods/mod_conference/ModConference.h | 6 +++--- apps/examples/cacheannounce/CacheAnnounce.h | 4 ++-- apps/examples/dtmftester/DtmfTester.h | 2 +- apps/examples/early_record/EarlyRecord.h | 2 +- apps/examples/jukecall/Jukecall.h | 4 ++-- .../pinauthconference/PinAuthConference.h | 2 +- .../simple_conference/SimpleConference.h | 4 ++-- apps/monitoring/Monitoring.cpp | 2 +- apps/monitoring/Monitoring.h | 2 +- apps/rtmp/RtmpConnection.cpp | 2 +- apps/sbc/RegisterCache.h | 4 ++-- apps/sbc/SBC.h | 4 ++-- apps/sbc/SBCCallLeg.h | 2 +- apps/sbc/SBCEventLog.h | 4 ++-- apps/sbc/SBCSimpleRelay.h | 4 ++-- apps/sbc/call_control/dsm/SBCDSMInstance.cpp | 4 ++-- apps/sbc/call_control/dsm/SBCDSMInstance.h | 4 ++-- apps/sw_vsc/SW_Vsc.h | 2 +- apps/voicebox/VoiceboxDialog.h | 2 +- apps/webconference/WebConferenceDialog.h | 4 ++-- core/AmAudio.cpp | 8 ++++---- core/AmAudio.h | 8 ++++---- core/AmDtmfDetector.h | 2 +- core/AmMimeBody.cpp | 4 ++-- core/AmRtpAudio.cpp | 2 +- core/AmRtpAudio.h | 4 ++-- core/AmRtpStream.h | 6 +++--- core/AmSession.h | 2 +- core/AmSessionContainer.cpp | 4 ++-- core/AmSipSubscription.cpp | 5 ++--- core/AmSipSubscription.h | 2 +- core/sip/parse_common.cpp | 4 ++-- core/sip/parse_header.cpp | 4 ++-- core/sip/parse_route.cpp | 4 ++-- core/sip/parse_via.cpp | 4 ++-- core/sip/sip_parser.cpp | 12 ++++++------ core/sip/trans_layer.cpp | 4 ++-- 45 files changed, 90 insertions(+), 91 deletions(-) diff --git a/apps/announcement/Announcement.h b/apps/announcement/Announcement.h index b07b045c..6aabb9c9 100644 --- a/apps/announcement/Announcement.h +++ b/apps/announcement/Announcement.h @@ -63,7 +63,7 @@ class AnnouncementDialog : public AmSession, AmAudioFile wav_file; string filename; - std::auto_ptr cred; + std::unique_ptr cred; public: AnnouncementDialog(const string& filename, UACAuthCred* credentials = NULL); diff --git a/apps/annrecorder/AnnRecorder.h b/apps/annrecorder/AnnRecorder.h index 9cad5869..93b5b952 100644 --- a/apps/annrecorder/AnnRecorder.h +++ b/apps/annrecorder/AnnRecorder.h @@ -88,7 +88,7 @@ class AnnRecorderDialog : public AmSession, AmPromptCollection& prompts; AmPlaylist playlist; // we need only one separator in queue - auto_ptr playlist_separator; + unique_ptr playlist_separator; AmAudioFile wav_file; std::map params; @@ -97,7 +97,7 @@ class AnnRecorderDialog : public AmSession, AmDynInvoke* msg_storage; - std::auto_ptr cred; + std::unique_ptr cred; enum AnnRecorderState { S_WAIT_START, diff --git a/apps/click2dial/Click2Dial.h b/apps/click2dial/Click2Dial.h index 4a47d443..57bdfe38 100644 --- a/apps/click2dial/Click2Dial.h +++ b/apps/click2dial/Click2Dial.h @@ -62,7 +62,7 @@ class C2DCallerDialog: public AmB2BCallerSession, public CredentialHolder AmAudioFile wav_file; string filename; string callee_uri; - std::auto_ptr cred; + std::unique_ptr cred; public: @@ -81,7 +81,7 @@ class C2DCallerDialog: public AmB2BCallerSession, public CredentialHolder class C2DCalleeDialog : public AmB2BCalleeSession, public CredentialHolder { - std::auto_ptr cred; + std::unique_ptr cred; void setAuthHandler(); public: diff --git a/apps/conference/Conference.cpp b/apps/conference/Conference.cpp index 7f9a025a..57871bc5 100644 --- a/apps/conference/Conference.cpp +++ b/apps/conference/Conference.cpp @@ -382,7 +382,7 @@ AmSession* ConferenceFactory::onRefer(const AmSipRequest& req, const string& app ConferenceDialog::ConferenceDialog(const string& conf_id, AmConferenceChannel* dialout_channel) : conf_id(conf_id), - channel(0), + channel(nullptr), play_list(this), dialout_channel(dialout_channel), state(CS_normal), diff --git a/apps/conference/Conference.h b/apps/conference/Conference.h index bed0da7d..07eba82c 100644 --- a/apps/conference/Conference.h +++ b/apps/conference/Conference.h @@ -105,22 +105,22 @@ class ConferenceDialog : public AmSession { AmPlaylist play_list; - auto_ptr LonelyUserFile; - auto_ptr JoinSound; - auto_ptr DropSound; - auto_ptr RingTone; - auto_ptr ErrorTone; + unique_ptr LonelyUserFile; + unique_ptr JoinSound; + unique_ptr DropSound; + unique_ptr RingTone; + unique_ptr ErrorTone; string conf_id; - auto_ptr channel; + unique_ptr channel; int state; string dtmf_seq; bool dialedout; string dialout_suffix; string dialout_id; - auto_ptr dialout_channel; + unique_ptr dialout_channel; bool allow_dialout; @@ -130,7 +130,7 @@ class ConferenceDialog : public AmSession bool listen_only; - auto_ptr transfer_req; + unique_ptr transfer_req; void createDialoutParticipant(const string& uri); diff --git a/apps/dsm/DSMCall.h b/apps/dsm/DSMCall.h index 312f8708..56b79ccc 100644 --- a/apps/dsm/DSMCall.h +++ b/apps/dsm/DSMCall.h @@ -41,7 +41,7 @@ class DSMCall : public AmB2BCallerSession, public DSMSession, public CredentialHolder { - std::auto_ptr cred; + std::unique_ptr cred; DSMStateEngine engine; AmPromptCollection* prompts; @@ -162,8 +162,8 @@ public: class DSMCallCalleeSession : public AmB2BCalleeSession, public CredentialHolder { - std::auto_ptr cred; - std::auto_ptr auth; + std::unique_ptr cred; + std::unique_ptr auth; protected: diff --git a/apps/dsm/DSMSession.cpp b/apps/dsm/DSMSession.cpp index 52e13373..f523adc1 100644 --- a/apps/dsm/DSMSession.cpp +++ b/apps/dsm/DSMSession.cpp @@ -28,7 +28,7 @@ #include "DSMSession.h" DSMSession::DSMSession() - : last_req(0) { + : last_req(nullptr) { } DSMSession::~DSMSession() { diff --git a/apps/dsm/DSMSession.h b/apps/dsm/DSMSession.h index c2840926..4481e57b 100644 --- a/apps/dsm/DSMSession.h +++ b/apps/dsm/DSMSession.h @@ -197,7 +197,7 @@ class DSMSession { AmArg di_res; /* last received request */ - std::auto_ptr last_req; + std::unique_ptr last_req; }; class DSMStateDiagramCollection; diff --git a/apps/dsm/mods/mod_conference/ModConference.h b/apps/dsm/mods/mod_conference/ModConference.h index fa4714fd..bdd2a098 100644 --- a/apps/dsm/mods/mod_conference/ModConference.h +++ b/apps/dsm/mods/mod_conference/ModConference.h @@ -45,7 +45,7 @@ DECLARE_MODULE(MOD_CLS_NAME); class DSMConfChannel : public DSMDisposable, public AmObject { - std::auto_ptr chan; + std::unique_ptr chan; public: DSMConfChannel(AmConferenceChannel* channel) : chan(channel) { } @@ -58,7 +58,7 @@ class DSMConfChannel class DSMTeeConfChannel : public DSMDisposable, public AmObject { - std::auto_ptr chan; + std::unique_ptr chan; AmAudioQueue audio_queue; public: @@ -73,7 +73,7 @@ class DSMTeeConfChannel template class DSMDisposableT : public DSMDisposable, public AmObject { - std::auto_ptr pobj; + std::unique_ptr pobj; public: DSMDisposableT(T* _pobj) : pobj(_pobj) { } diff --git a/apps/examples/cacheannounce/CacheAnnounce.h b/apps/examples/cacheannounce/CacheAnnounce.h index ba2b550e..b0f403e0 100644 --- a/apps/examples/cacheannounce/CacheAnnounce.h +++ b/apps/examples/cacheannounce/CacheAnnounce.h @@ -33,7 +33,7 @@ #include "AmCachedAudioFile.h" #include -using std::auto_ptr; +using std::unique_ptr; #include using std::string; @@ -56,7 +56,7 @@ public: class CacheAnnounceDialog : public AmSession { - auto_ptr wav_file; + unique_ptr wav_file; AmFileCache* announce; public: diff --git a/apps/examples/dtmftester/DtmfTester.h b/apps/examples/dtmftester/DtmfTester.h index e5856aec..41b5b8ad 100644 --- a/apps/examples/dtmftester/DtmfTester.h +++ b/apps/examples/dtmftester/DtmfTester.h @@ -66,7 +66,7 @@ class DtmfTesterDialog : public AmSession, AmPlaylist play_list; - std::auto_ptr cred; + std::unique_ptr cred; vector del_files; diff --git a/apps/examples/early_record/EarlyRecord.h b/apps/examples/early_record/EarlyRecord.h index 3f4636ac..47de9c7a 100644 --- a/apps/examples/early_record/EarlyRecord.h +++ b/apps/examples/early_record/EarlyRecord.h @@ -30,7 +30,7 @@ class EarlyRecordDialog string msg_filename; AmAudioFile a_msg; - std::auto_ptr cred; + std::unique_ptr cred; protected: void process(AmEvent* event); diff --git a/apps/examples/jukecall/Jukecall.h b/apps/examples/jukecall/Jukecall.h index fd018a01..576a7631 100644 --- a/apps/examples/jukecall/Jukecall.h +++ b/apps/examples/jukecall/Jukecall.h @@ -62,7 +62,7 @@ private: JukeLeg1_state state; AmAudioFile initial_announcement; - auto_ptr song; + unique_ptr song; protected: AmB2ABCalleeSession* createCalleeSession(); @@ -82,7 +82,7 @@ class JukecalleeSession : public AmB2ABCalleeSession { void process(AmEvent* event); - auto_ptr song; + unique_ptr song; public: JukecalleeSession(const string& other_tag, diff --git a/apps/examples/pinauthconference/PinAuthConference.h b/apps/examples/pinauthconference/PinAuthConference.h index a959d88f..108a65bd 100644 --- a/apps/examples/pinauthconference/PinAuthConference.h +++ b/apps/examples/pinauthconference/PinAuthConference.h @@ -84,7 +84,7 @@ private: AmPromptCollection& prompts; // our connection to the conference - auto_ptr channel; + unique_ptr channel; string conf_id; string pin_str; diff --git a/apps/examples/simple_conference/SimpleConference.h b/apps/examples/simple_conference/SimpleConference.h index 69411b6c..7c80c245 100644 --- a/apps/examples/simple_conference/SimpleConference.h +++ b/apps/examples/simple_conference/SimpleConference.h @@ -58,14 +58,14 @@ class SimpleConferenceDialog : public AmSession { string conf_id; // our connection to the conference - auto_ptr channel; + unique_ptr channel; // we use a playlist so we can put e.g. // announcement files to be played to the // user in front and after its finished we will // be connected back to conference automatically AmPlaylist play_list; - auto_ptr BeepSound; + unique_ptr BeepSound; public: diff --git a/apps/monitoring/Monitoring.cpp b/apps/monitoring/Monitoring.cpp index a6ae1712..c2673bcd 100644 --- a/apps/monitoring/Monitoring.cpp +++ b/apps/monitoring/Monitoring.cpp @@ -57,7 +57,7 @@ Monitor* Monitor::instance() } Monitor::Monitor(const string& name) - : AmDynInvokeFactory(MOD_NAME), gc_thread(NULL) { + : AmDynInvokeFactory(MOD_NAME), gc_thread(nullptr) { } Monitor::~Monitor() { diff --git a/apps/monitoring/Monitoring.h b/apps/monitoring/Monitoring.h index 8238ede7..c8ac14a7 100644 --- a/apps/monitoring/Monitoring.h +++ b/apps/monitoring/Monitoring.h @@ -71,7 +71,7 @@ class Monitor public AmDynInvoke { static Monitor* _instance; - std::auto_ptr gc_thread; + std::unique_ptr gc_thread; LogBucket logs[NUM_LOG_BUCKETS]; diff --git a/apps/rtmp/RtmpConnection.cpp b/apps/rtmp/RtmpConnection.cpp index b256e891..3caebf55 100644 --- a/apps/rtmp/RtmpConnection.cpp +++ b/apps/rtmp/RtmpConnection.cpp @@ -669,7 +669,7 @@ void RtmpConnection::rxAudio(RTMPPacket *packet) RtmpSession* RtmpConnection::startSession(const char* uri) { - auto_ptr n_session(new RtmpSession(this)); + unique_ptr n_session(new RtmpSession(this)); AmSipDialog* dialout_dlg = n_session->dlg; string dialout_id = AmSession::getNewId(); diff --git a/apps/sbc/RegisterCache.h b/apps/sbc/RegisterCache.h index c68d28e9..c41097a5 100644 --- a/apps/sbc/RegisterCache.h +++ b/apps/sbc/RegisterCache.h @@ -14,7 +14,7 @@ #include using std::string; using std::map; -using std::auto_ptr; +using std::unique_ptr; #define REG_CACHE_TABLE_POWER 10 #define REG_CACHE_TABLE_ENTRIES (1< id_idx; hash_table contact_idx; - auto_ptr storage_handler; + unique_ptr storage_handler; unsigned int gbc_bucket_id; diff --git a/apps/sbc/SBC.h b/apps/sbc/SBC.h index e11f5ba6..d1435f53 100644 --- a/apps/sbc/SBC.h +++ b/apps/sbc/SBC.h @@ -76,8 +76,8 @@ class SBCFactory: public AmSessionFactory, bool core_options_handling; - auto_ptr callLegCreator; - auto_ptr simpleRelayCreator; + unique_ptr callLegCreator; + unique_ptr simpleRelayCreator; void listProfiles(const AmArg& args, AmArg& ret); void reloadProfiles(const AmArg& args, AmArg& ret); diff --git a/apps/sbc/SBCCallLeg.h b/apps/sbc/SBCCallLeg.h index 8ae9e50d..a90e0c18 100644 --- a/apps/sbc/SBCCallLeg.h +++ b/apps/sbc/SBCCallLeg.h @@ -80,7 +80,7 @@ class SBCCallLeg : public CallLeg, public CredentialHolder SBCCallProfile call_profile; // Rate limiting - auto_ptr rtp_relay_rate_limit; + unique_ptr rtp_relay_rate_limit; // Measurements list rtp_pegs; diff --git a/apps/sbc/SBCEventLog.h b/apps/sbc/SBCEventLog.h index d968e513..d8355bdc 100644 --- a/apps/sbc/SBCEventLog.h +++ b/apps/sbc/SBCEventLog.h @@ -34,7 +34,7 @@ #include #include #include -using std::auto_ptr; +using std::unique_ptr; using std::string; using std::map; @@ -46,7 +46,7 @@ struct SBCEventLogHandler class _SBCEventLog { - auto_ptr log_handler; + unique_ptr log_handler; protected: _SBCEventLog() {} diff --git a/apps/sbc/SBCSimpleRelay.h b/apps/sbc/SBCSimpleRelay.h index d7bb5eac..6822000c 100644 --- a/apps/sbc/SBCSimpleRelay.h +++ b/apps/sbc/SBCSimpleRelay.h @@ -69,8 +69,8 @@ class SimpleRelayDialog std::list cc_ext; // auth support - std::auto_ptr auth_cred; - std::auto_ptr auth_h; + std::unique_ptr auth_cred; + std::unique_ptr auth_h; UACAuthCred* getCredentials() { return auth_cred.get(); } AmBasicSipDialog* getDlg() { return this; } diff --git a/apps/sbc/call_control/dsm/SBCDSMInstance.cpp b/apps/sbc/call_control/dsm/SBCDSMInstance.cpp index 778df709..a555d5a0 100644 --- a/apps/sbc/call_control/dsm/SBCDSMInstance.cpp +++ b/apps/sbc/call_control/dsm/SBCDSMInstance.cpp @@ -203,8 +203,8 @@ void SBCDSMInstance::onStateChange(SBCCallLeg *call, const CallLeg::StatusChange VarMapT event_params; event_params["SBCCallStatus"] = call->getCallStatusStr(); - auto_ptr dsm_request; - auto_ptr dsm_reply; + unique_ptr dsm_request; + unique_ptr dsm_reply; switch (cause.reason) { case CallLeg::StatusChangeCause::SipReply: diff --git a/apps/sbc/call_control/dsm/SBCDSMInstance.h b/apps/sbc/call_control/dsm/SBCDSMInstance.h index d7ec646e..f137bfd5 100644 --- a/apps/sbc/call_control/dsm/SBCDSMInstance.h +++ b/apps/sbc/call_control/dsm/SBCDSMInstance.h @@ -49,9 +49,9 @@ class SBCDSMInstance std::set gc_trash; vector audiofiles; - auto_ptr dummy_session; + unique_ptr dummy_session; - auto_ptr playlist; + unique_ptr playlist; void resetDummySession(SimpleRelayDialog *relay); diff --git a/apps/sw_vsc/SW_Vsc.h b/apps/sw_vsc/SW_Vsc.h index 2b8fc841..0595c278 100644 --- a/apps/sw_vsc/SW_Vsc.h +++ b/apps/sw_vsc/SW_Vsc.h @@ -98,7 +98,7 @@ class SW_VscDialog : public AmSession, sw_vsc_patterns_t *m_patterns; - std::auto_ptr cred; + std::unique_ptr cred; u_int64_t getAttributeId(MYSQL *my_handler, const char *attribute); u_int64_t getSubscriberId(MYSQL *my_handler, const char *uuid, diff --git a/apps/voicebox/VoiceboxDialog.h b/apps/voicebox/VoiceboxDialog.h index 726e0319..3d169a7c 100644 --- a/apps/voicebox/VoiceboxDialog.h +++ b/apps/voicebox/VoiceboxDialog.h @@ -43,7 +43,7 @@ public: private: AmPlaylist play_list; // we need only one separator in queue - auto_ptr playlist_separator; + unique_ptr playlist_separator; AmPromptCollection* prompts; PromptOptions prompt_options; diff --git a/apps/webconference/WebConferenceDialog.h b/apps/webconference/WebConferenceDialog.h index 69bbfd25..f2db91ab 100644 --- a/apps/webconference/WebConferenceDialog.h +++ b/apps/webconference/WebConferenceDialog.h @@ -59,10 +59,10 @@ private: AmPromptCollection& prompts; // our ring tone - auto_ptr RingTone; + unique_ptr RingTone; // our connection to the conference - auto_ptr channel; + unique_ptr channel; string conf_id; string pin_str; diff --git a/core/AmAudio.cpp b/core/AmAudio.cpp index bb9f2132..4856bb82 100644 --- a/core/AmAudio.cpp +++ b/core/AmAudio.cpp @@ -256,8 +256,8 @@ AmAudio::AmAudio() : fmt(new AmAudioFormat(CODEC_PCM16)), max_rec_time(-1), rec_time(0), - input_resampling_state(NULL), - output_resampling_state(NULL) + input_resampling_state(nullptr), + output_resampling_state(nullptr) { } @@ -265,8 +265,8 @@ AmAudio::AmAudio(AmAudioFormat *_fmt) : fmt(_fmt), max_rec_time(-1), rec_time(0), - input_resampling_state(NULL), - output_resampling_state(NULL) + input_resampling_state(nullptr), + output_resampling_state(nullptr) { } diff --git a/core/AmAudio.h b/core/AmAudio.h index e87fe235..9caea19c 100644 --- a/core/AmAudio.h +++ b/core/AmAudio.h @@ -36,7 +36,7 @@ #include #include -using std::auto_ptr; +using std::unique_ptr; #include using std::string; #include @@ -256,11 +256,11 @@ protected: DblBuffer samples; /** Audio format. @see AmAudioFormat */ - auto_ptr fmt; + unique_ptr fmt; /** Resampling states. @see AmResamplingState */ - auto_ptr input_resampling_state; - auto_ptr output_resampling_state; + unique_ptr input_resampling_state; + unique_ptr output_resampling_state; AmAudio(); AmAudio(AmAudioFormat *); diff --git a/core/AmDtmfDetector.h b/core/AmDtmfDetector.h index 8fbcb302..74b9d887 100644 --- a/core/AmDtmfDetector.h +++ b/core/AmDtmfDetector.h @@ -411,7 +411,7 @@ class AmDtmfDetector AmDtmfSink *m_dtmfSink; AmRtpDtmfDetector m_rtpDetector; AmSipDtmfDetector m_sipDetector; - std::auto_ptr m_inbandDetector; + std::unique_ptr m_inbandDetector; Dtmf::InbandDetectorType m_inband_type; struct timeval m_startTime; diff --git a/core/AmMimeBody.cpp b/core/AmMimeBody.cpp index be5ee62f..f7dc8a4b 100644 --- a/core/AmMimeBody.cpp +++ b/core/AmMimeBody.cpp @@ -7,7 +7,7 @@ #include "AmUtils.h" #include -using std::auto_ptr; +using std::unique_ptr; #define MULTIPART "multipart" #define MULTIPART_MIXED "multipart/mixed" @@ -488,7 +488,7 @@ int AmMimeBody::parseSinglePart(unsigned char* buf, unsigned int len) return -1; } - auto_ptr sub_part(new AmMimeBody()); + unique_ptr sub_part(new AmMimeBody()); string sub_part_hdrs; string sub_part_ct; diff --git a/core/AmRtpAudio.cpp b/core/AmRtpAudio.cpp index 5d20a942..b9945585 100644 --- a/core/AmRtpAudio.cpp +++ b/core/AmRtpAudio.cpp @@ -108,7 +108,7 @@ void AmAudioRtpFormat::initCodec() AmRtpAudio::AmRtpAudio(AmSession* _s, int _if) : AmRtpStream(_s,_if), AmAudio(0), /*last_ts_i(false),*/ use_default_plc(true), - playout_buffer(NULL), + playout_buffer(nullptr), m_playout_type(SIMPLE_PLAYOUT), last_check(0),last_check_i(false),send_int(false), last_send_ts_i(false) diff --git a/core/AmRtpAudio.h b/core/AmRtpAudio.h index 9e7c8d33..d3816608 100644 --- a/core/AmRtpAudio.h +++ b/core/AmRtpAudio.h @@ -98,12 +98,12 @@ public: class AmRtpAudio: public AmRtpStream, public AmAudio, public AmPLCBuffer { PlayoutType m_playout_type; - auto_ptr playout_buffer; + unique_ptr playout_buffer; #ifdef USE_SPANDSP_PLC plc_state_t* plc_state; #else - std::auto_ptr fec; + std::unique_ptr fec; #endif bool use_default_plc; diff --git a/core/AmRtpStream.h b/core/AmRtpStream.h index 8396ab0f..28875888 100644 --- a/core/AmRtpStream.h +++ b/core/AmRtpStream.h @@ -43,7 +43,7 @@ #include #include using std::string; -using std::auto_ptr; +using std::unique_ptr; using std::pair; // return values of AmRtpStream::receive @@ -239,8 +239,8 @@ protected: bool monitor_rtp_timeout; /** Payload type for telephone event */ - auto_ptr remote_telephone_event_pt; - auto_ptr local_telephone_event_pt; + unique_ptr remote_telephone_event_pt; + unique_ptr local_telephone_event_pt; /** DTMF sender */ AmDtmfSender dtmf_sender; diff --git a/core/AmSession.h b/core/AmSession.h index fdd33fd1..1b910da5 100644 --- a/core/AmSession.h +++ b/core/AmSession.h @@ -126,7 +126,7 @@ private: friend class AmSessionFactory; friend class AmSessionProcessorThread; - auto_ptr _rtp_str; + unique_ptr _rtp_str; /** Application parameters passed through P-App-Param HF */ map app_params; diff --git a/core/AmSessionContainer.cpp b/core/AmSessionContainer.cpp index 2c56dbc8..f18c9651 100644 --- a/core/AmSessionContainer.cpp +++ b/core/AmSessionContainer.cpp @@ -207,7 +207,7 @@ void AmSessionContainer::destroySession(AmSession* s) string AmSessionContainer::startSessionUAC(const AmSipRequest& req, string& app_name, AmArg* session_params) { - auto_ptr session; + unique_ptr session; try { session.reset(createSession(req, app_name, session_params)); if(session.get() != 0) { @@ -280,7 +280,7 @@ void AmSessionContainer::startSessionUAS(AmSipRequest& req) { try { // Call-ID and From-Tag are unknown: it's a new session - auto_ptr session; + unique_ptr session; string app_name; session.reset(createSession(req,app_name)); diff --git a/core/AmSipSubscription.cpp b/core/AmSipSubscription.cpp index 7e2b3f5a..26e4cb3c 100644 --- a/core/AmSipSubscription.cpp +++ b/core/AmSipSubscription.cpp @@ -665,7 +665,6 @@ void AmSipSubscription::debug() } } - SIPSubscriptionEvent::SIPSubscriptionEvent(SubscriptionStatus status, const string& handle, unsigned int expires, @@ -673,9 +672,9 @@ SIPSubscriptionEvent::SIPSubscriptionEvent(SubscriptionStatus status, const string& reason) : AmEvent(E_SIP_SUBSCRIPTION), status(status), handle(handle), expires(expires), code(code), - reason(reason), notify_body(0) + reason(reason), notify_body(nullptr) {} - + const char* SIPSubscriptionEvent::getStatusText() { switch (status) { diff --git a/core/AmSipSubscription.h b/core/AmSipSubscription.h index f37c4b84..9d23df67 100644 --- a/core/AmSipSubscription.h +++ b/core/AmSipSubscription.h @@ -235,7 +235,7 @@ struct SIPSubscriptionEvent string reason; SubscriptionStatus status; unsigned int expires; - std::auto_ptr notify_body; + std::unique_ptr notify_body; SIPSubscriptionEvent(SubscriptionStatus status, const string& handle, unsigned int expires = 0, diff --git a/core/sip/parse_common.cpp b/core/sip/parse_common.cpp index 3953377f..9bb5d58a 100644 --- a/core/sip/parse_common.cpp +++ b/core/sip/parse_common.cpp @@ -34,7 +34,7 @@ #include #include -using std::auto_ptr; +using std::unique_ptr; int parse_sip_version(const char* beg, int len) { @@ -83,7 +83,7 @@ static int _parse_gen_params(list* params, const char** c, int st = beg_w_sc ? VP_PARAM_SEP : VP_PARAM_SEP_SWS; - auto_ptr avp(new sip_avp()); + unique_ptr avp(new sip_avp()); for(;*c!=end;(*c)++){ diff --git a/core/sip/parse_header.cpp b/core/sip/parse_header.cpp index e92d1de3..7730b5a5 100644 --- a/core/sip/parse_header.cpp +++ b/core/sip/parse_header.cpp @@ -35,7 +35,7 @@ #include "log.h" #include -using std::auto_ptr; +using std::unique_ptr; // @@ -288,7 +288,7 @@ int parse_headers(list& hdrs, char** c, char* end) return 0; } - auto_ptr hdr(new sip_header()); + unique_ptr hdr(new sip_header()); for(;(*c < end) && **c;(*c)++){ diff --git a/core/sip/parse_route.cpp b/core/sip/parse_route.cpp index e61425f0..3fb734f0 100644 --- a/core/sip/parse_route.cpp +++ b/core/sip/parse_route.cpp @@ -29,7 +29,7 @@ #include "parse_common.h" #include -using std::auto_ptr; +using std::unique_ptr; route_elmt::~route_elmt() { if(addr) delete addr; @@ -222,7 +222,7 @@ int parse_first_route_uri(sip_header* fr) cstring route_str((*route_it)->route); const char* c = route_str.s; - auto_ptr na(new sip_nameaddr()); + unique_ptr na(new sip_nameaddr()); if(parse_nameaddr(na.get(), &c, route_str.len)<0) { DBG("Parsing name-addr failed\n"); diff --git a/core/sip/parse_via.cpp b/core/sip/parse_via.cpp index 32e37749..6cd8a207 100644 --- a/core/sip/parse_via.cpp +++ b/core/sip/parse_via.cpp @@ -36,7 +36,7 @@ using std::string; #include -using std::auto_ptr; +using std::unique_ptr; #include "AmUtils.h" @@ -563,7 +563,7 @@ int parse_via(sip_via* via, const char* beg, int len) int saved_st=0, st=V_TRANS; - auto_ptr parm(new sip_via_parm()); + unique_ptr parm(new sip_via_parm()); int ret = 0; for(;c -using std::auto_ptr; +using std::unique_ptr; sip_msg::sip_msg(const char* msg_buf, int msg_len) : buf(NULL), @@ -572,7 +572,7 @@ int parse_sip_msg(sip_msg* msg, char*& err_msg) return INCOMPLETE_SIP_MSG; } - auto_ptr via(new sip_via()); + unique_ptr via(new sip_via()); if(!parse_via(via.get(), msg->via1->value.s, msg->via1->value.len) && @@ -586,7 +586,7 @@ int parse_sip_msg(sip_msg* msg, char*& err_msg) return MALFORMED_SIP_MSG; } - auto_ptr cseq(new sip_cseq()); + unique_ptr cseq(new sip_cseq()); if(!parse_cseq(cseq.get(), msg->cseq->value.s, msg->cseq->value.len) && @@ -600,7 +600,7 @@ int parse_sip_msg(sip_msg* msg, char*& err_msg) return MALFORMED_SIP_MSG; } - auto_ptr from(new sip_from_to()); + unique_ptr from(new sip_from_to()); if(parse_from_to(from.get(), msg->from->value.s, msg->from->value.len) != 0) { err_msg = (char*)"could not parse From hf"; return MALFORMED_SIP_MSG; @@ -611,7 +611,7 @@ int parse_sip_msg(sip_msg* msg, char*& err_msg) } msg->from->p = from.release(); - auto_ptr to(new sip_from_to()); + unique_ptr to(new sip_from_to()); if(!parse_from_to(to.get(), msg->to->value.s, msg->to->value.len)) { @@ -624,7 +624,7 @@ int parse_sip_msg(sip_msg* msg, char*& err_msg) } if (msg->rack) { - auto_ptr rack(new sip_rack()); + unique_ptr rack(new sip_rack()); if (parse_rack(rack.get(), msg->rack->value.s, msg->rack->value.len)) { msg->rack->p = rack.release(); } else { diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp index ce5bcdb5..7bcdf279 100644 --- a/core/sip/trans_layer.cpp +++ b/core/sip/trans_layer.cpp @@ -1242,7 +1242,7 @@ int _trans_layer::send_request(sip_msg* msg, trans_ticket* tt, dest_list.push_back(dest); } - auto_ptr targets(new sip_target_set()); + unique_ptr targets(new sip_target_set()); res = resolver::instance()->resolve_targets(dest_list,targets.get()); if(res < 0){ DBG("resolve_targets failed\n"); @@ -2652,7 +2652,7 @@ int _trans_layer::try_next_ip(trans_bucket* bucket, sip_trans* tr, if(use_new_trans) { string n_uri; cstring old_uri; - auto_ptr n_tr(copy_uac_trans(tr)); + unique_ptr n_tr(copy_uac_trans(tr)); // Warning: no deep copy!!! // -> do not forget to release() before it's too late!