Replace boost::scoped_ptr with std::unique_ptr (1/2)

This commit is contained in:
Alejandro Domínguez 2024-08-26 04:32:38 +02:00 committed by Robin Gareus
parent 883a7cc65b
commit 1ffb70f670
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
12 changed files with 9 additions and 28 deletions

View file

@ -47,7 +47,6 @@
#include <stdint.h> #include <stdint.h>
#include <boost/dynamic_bitset.hpp> #include <boost/dynamic_bitset.hpp>
#include <boost/scoped_ptr.hpp>
#include <glibmm/threads.h> #include <glibmm/threads.h>
#include <ltc.h> #include <ltc.h>
@ -1553,7 +1552,7 @@ private:
bool loop_changing; bool loop_changing;
samplepos_t last_loopend; samplepos_t last_loopend;
boost::scoped_ptr<SessionDirectory> _session_dir; const std::unique_ptr<SessionDirectory> _session_dir;
void hookup_io (); void hookup_io ();
void graph_reordered (bool called_from_backend); void graph_reordered (bool called_from_backend);

View file

@ -21,7 +21,6 @@
*/ */
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include "pbd/signals.h" #include "pbd/signals.h"

View file

@ -49,8 +49,6 @@
#include <glib.h> #include <glib.h>
#include "pbd/gstdio_compat.h" #include "pbd/gstdio_compat.h"
#include <boost/scoped_ptr.hpp>
#include <glibmm/fileutils.h> #include <glibmm/fileutils.h>
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>

View file

@ -40,7 +40,6 @@
#include "pbd/gstdio_compat.h" #include "pbd/gstdio_compat.h"
#include <glibmm.h> #include <glibmm.h>
#include <boost/scoped_ptr.hpp>
#include <boost/shared_array.hpp> #include <boost/shared_array.hpp>
#include "pbd/basename.h" #include "pbd/basename.h"
@ -544,8 +543,7 @@ Session::deinterlace_midi_region (std::shared_ptr<MidiRegion> mr)
smf->session_saved(); //TODO: should we just expose flush_midi() instead? smf->session_saved(); //TODO: should we just expose flush_midi() instead?
/* open the SMF file for reading */ /* open the SMF file for reading */
boost::scoped_ptr<Evoral::SMF> smf_reader; const std::unique_ptr<Evoral::SMF> smf_reader (new Evoral::SMF());
smf_reader.reset (new Evoral::SMF());
if (smf_reader->open (source_path)) { if (smf_reader->open (source_path)) {
throw Evoral::SMF::FileError (source_path); throw Evoral::SMF::FileError (source_path);
} }
@ -647,7 +645,7 @@ Session::import_files (ImportStatus& status)
std::shared_ptr<ImportableSource> source; std::shared_ptr<ImportableSource> source;
const DataType type = SMFSource::safe_midi_file_extension (*p) ? DataType::MIDI : DataType::AUDIO; const DataType type = SMFSource::safe_midi_file_extension (*p) ? DataType::MIDI : DataType::AUDIO;
boost::scoped_ptr<Evoral::SMF> smf_reader; std::unique_ptr<Evoral::SMF> smf_reader;
if (type == DataType::AUDIO) { if (type == DataType::AUDIO) {
try { try {

View file

@ -364,7 +364,6 @@ def configure(conf):
conf.write_config_header('libardour-config.h', remove=False) conf.write_config_header('libardour-config.h', remove=False)
# Boost headers # Boost headers
autowaf.check_header(conf, 'cxx', 'boost/scoped_ptr.hpp')
autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp') autowaf.check_header(conf, 'cxx', 'boost/ptr_container/ptr_list.hpp')
if conf.env['WINDOWS_VST_SUPPORT'] == True: if conf.env['WINDOWS_VST_SUPPORT'] == True:

View file

@ -22,7 +22,6 @@
#include <list> #include <list>
#include <math.h> #include <math.h>
#include <boost/scoped_ptr.hpp>
#include <glibmm/timer.h> #include <glibmm/timer.h>
#include <glibmm/spawn.h> #include <glibmm/spawn.h>

View file

@ -18,8 +18,6 @@
*/ */
#include <iostream> #include <iostream>
#include <boost/scoped_ptr.hpp>
#include <glibmm/timer.h> #include <glibmm/timer.h>
#include "pbd/epa.h" #include "pbd/epa.h"
@ -63,7 +61,7 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
*/ */
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa; std::unique_ptr<EnvironmentalProtectionAgency> current_epa;
/* revert all environment settings back to whatever they were when /* revert all environment settings back to whatever they were when
* ardour started, because ardour's startup script may have reset * ardour started, because ardour's startup script may have reset
@ -97,7 +95,7 @@ int
JackConnection::open () JackConnection::open ()
{ {
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa; std::unique_ptr<EnvironmentalProtectionAgency> current_epa;
jack_status_t status; jack_status_t status;
close (); close ();

View file

@ -42,8 +42,6 @@
#include <portaudio.h> #include <portaudio.h>
#endif #endif
#include <boost/scoped_ptr.hpp>
#include "pbd/gstdio_compat.h" #include "pbd/gstdio_compat.h"
#include <glibmm/miscutils.h> #include <glibmm/miscutils.h>

View file

@ -27,8 +27,6 @@
#include <string> #include <string>
#include <boost/scoped_ptr.hpp>
#include <pbd/ringbuffer.h> #include <pbd/ringbuffer.h>
namespace ARDOUR { namespace ARDOUR {
@ -95,7 +93,7 @@ private: // data
std::string m_name; std::string m_name;
// can't use unique_ptr yet // can't use unique_ptr yet
boost::scoped_ptr<PBD::RingBuffer<uint8_t> > m_midi_buffer; const std::unique_ptr<PBD::RingBuffer<uint8_t> > m_midi_buffer;
std::unique_ptr<uint8_t[]> m_sysex_buffer; std::unique_ptr<uint8_t[]> m_sysex_buffer;
}; };

View file

@ -27,8 +27,6 @@
#include <string> #include <string>
#include <boost/scoped_ptr.hpp>
#include <pbd/ringbuffer.h> #include <pbd/ringbuffer.h>
#define MaxWinMidiEventSize 256 #define MaxWinMidiEventSize 256
@ -98,7 +96,7 @@ private: // Data
bool m_thread_running; bool m_thread_running;
bool m_thread_quit; bool m_thread_quit;
boost::scoped_ptr<PBD::RingBuffer<uint8_t> > m_midi_buffer; const std::unique_ptr<PBD::RingBuffer<uint8_t> > m_midi_buffer;
}; };
} // namespace ARDOUR } // namespace ARDOUR

View file

@ -22,7 +22,6 @@
#include "libpbd-config.h" #include "libpbd-config.h"
#endif #endif
#include <boost/scoped_ptr.hpp>
#include <string> #include <string>
#include <glibmm/spawn.h> #include <glibmm/spawn.h>
@ -55,7 +54,7 @@ PBD::open_uri (const char* uri)
return cocoa_open_url (uri); return cocoa_open_url (uri);
#else #else
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa (); EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa; std::unique_ptr<EnvironmentalProtectionAgency> current_epa;
/* revert all environment settings back to whatever they were when ardour started /* revert all environment settings back to whatever they were when ardour started
*/ */

View file

@ -23,8 +23,6 @@
#include <memory> #include <memory>
#include <boost/scoped_ptr.hpp>
#include <glibmm/refptr.h> #include <glibmm/refptr.h>
#include "ardour/types.h" #include "ardour/types.h"
@ -152,7 +150,7 @@ private:
std::shared_ptr<ARDOUR::AudioRegion> _region; std::shared_ptr<ARDOUR::AudioRegion> _region;
boost::scoped_ptr<WaveViewProperties> _props; const std::unique_ptr<WaveViewProperties> _props;
mutable std::shared_ptr<WaveViewImage> _image; mutable std::shared_ptr<WaveViewImage> _image;