From 3d239bb9d59f555d08fd9362e9ce50de1255c633 Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Mon, 29 Dec 2008 19:50:19 +0000 Subject: Fix some compiling warnings and errors in OS X git-svn-id: svn://localhost/ardour2/branches/3.0@4358 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/export_channel.h | 23 +++++++++++++---------- libs/ardour/ardour/export_file_io.h | 3 ++- libs/ardour/export_file_io.cc | 15 ++++++--------- libs/ardour/midi_buffer.cc | 2 +- libs/evoral/SConscript | 3 ++- libs/pbd/SConscript | 3 ++- libs/taglib/SConscript | 2 ++ 7 files changed, 28 insertions(+), 23 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/export_channel.h b/libs/ardour/ardour/export_channel.h index d9e39c8850..213bd2d9fa 100644 --- a/libs/ardour/ardour/export_channel.h +++ b/libs/ardour/ardour/export_channel.h @@ -38,6 +38,9 @@ class Session; class ExportChannel { public: + + virtual ~ExportChannel () {} + virtual void read (Sample * data, nframes_t frames) const = 0; virtual bool empty () const = 0; @@ -69,13 +72,13 @@ class PortExportChannel : public ExportChannel PortExportChannel () {} - virtual void read (Sample * data, nframes_t frames) const; - virtual bool empty () const { return ports.empty(); } + void read (Sample * data, nframes_t frames) const; + bool empty () const { return ports.empty(); } - virtual void get_state (XMLNode * node) const; - virtual void set_state (XMLNode * node, Session & session); + void get_state (XMLNode * node) const; + void set_state (XMLNode * node, Session & session); - virtual bool operator< (ExportChannel const & other) const; + bool operator< (ExportChannel const & other) const; void add_port (AudioPort * port) { ports.insert (port); } PortSet const & get_ports () { return ports; } @@ -126,12 +129,12 @@ class RegionExportChannel : public ExportChannel friend class RegionExportChannelFactory; public: - virtual void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); } - virtual void get_state (XMLNode * node) const {}; - virtual void set_state (XMLNode * node, Session & session) {}; - virtual bool empty () const { return false; } + void read (Sample * data, nframes_t frames_to_read) const { factory.read (channel, data, frames_to_read); } + void get_state (XMLNode * node) const {}; + void set_state (XMLNode * node, Session & session) {}; + bool empty () const { return false; } // Region export should never have duplicate channels, so there need not be any semantics here - virtual bool operator< (ExportChannel const & other) const { return this < &other; } + bool operator< (ExportChannel const & other) const { return this < &other; } private: diff --git a/libs/ardour/ardour/export_file_io.h b/libs/ardour/ardour/export_file_io.h index 6705b7736a..0e15981c25 100644 --- a/libs/ardour/ardour/export_file_io.h +++ b/libs/ardour/ardour/export_file_io.h @@ -77,8 +77,9 @@ class SndfileWriterBase : public ExportFileWriter template class SndfileWriter : public SndfileWriterBase, public GraphSink { - protected: + // FIXME: having this protected doesn't work with Apple's gcc // Should only be created vie ExportFileFactory and derived classes + public: // protected friend class ExportFileFactory; SndfileWriter (int channels, nframes_t samplerate, int format, string const & path); diff --git a/libs/ardour/export_file_io.cc b/libs/ardour/export_file_io.cc index d4aa1870ba..793b1dbea4 100644 --- a/libs/ardour/export_file_io.cc +++ b/libs/ardour/export_file_io.cc @@ -400,8 +400,6 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr typedef boost::shared_ptr > IntWriterPtr; typedef boost::shared_ptr > FloatWriterPtr; - FilePair ret; - int real_format = format->format_id() | format->sample_format() | format->endianness(); uint32_t data_width = sndfile_data_width (real_format); @@ -422,14 +420,13 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr return std::make_pair (boost::static_pointer_cast (sfc), boost::static_pointer_cast (sfw)); - } else { - - FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter (channels, format->dither_type(), data_width)); - FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter (channels, format->sample_rate(), real_format, filename)); - sfc->pipe_to (sfw); - - return std::make_pair (boost::static_pointer_cast (sfc), boost::static_pointer_cast (sfw));; } + + FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter (channels, format->dither_type(), data_width)); + FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter (channels, format->sample_rate(), real_format, filename)); + sfc->pipe_to (sfw); + + return std::make_pair (boost::static_pointer_cast (sfc), boost::static_pointer_cast (sfw)); } bool diff --git a/libs/ardour/midi_buffer.cc b/libs/ardour/midi_buffer.cc index 705b94f422..1f5b0c5fa9 100644 --- a/libs/ardour/midi_buffer.cc +++ b/libs/ardour/midi_buffer.cc @@ -74,7 +74,7 @@ MidiBuffer::resize (size_t size) _capacity = size; #ifdef NO_POSIX_MEMALIGN - _events = (Evoral::Event *) malloc(sizeof(Evoral::Event) * _capacity); + _events = (Evoral::MIDIEvent *) malloc(sizeof(Evoral::MIDIEvent) * _capacity); _data = (uint8_t *) malloc(sizeof(uint8_t) * _capacity * MAX_EVENT_SIZE); #else posix_memalign((void**)&_events, CPU_CACHE_ALIGN, sizeof(Evoral::Event) * _capacity); diff --git a/libs/evoral/SConscript b/libs/evoral/SConscript index 29d0dfcaf9..3f901e8fd9 100644 --- a/libs/evoral/SConscript +++ b/libs/evoral/SConscript @@ -12,7 +12,8 @@ evoral.Merge([ libraries['sigc2'], libraries['glibmm2'], libraries['xml'], - libraries['pbd'], + libraries['pbd'], + libraries['boost'] ]) if evoral['IS_OSX']: diff --git a/libs/pbd/SConscript b/libs/pbd/SConscript index 5f2d20e405..d7981be771 100644 --- a/libs/pbd/SConscript +++ b/libs/pbd/SConscript @@ -60,7 +60,8 @@ pbd.Merge ([ libraries['sigc2'], libraries['xml'], libraries['uuid'], libraries['glibmm2'], - libraries['glib2'] ]) + libraries['glib2'], + libraries['boost'] ]) pbd.VersionBuild(['version.cc','pbd/version.h'], []) diff --git a/libs/taglib/SConscript b/libs/taglib/SConscript index fed92ce0a3..d9062889b6 100644 --- a/libs/taglib/SConscript +++ b/libs/taglib/SConscript @@ -64,6 +64,8 @@ taglib.Append (CPPATH= [ '#libs/taglib/taglib', ] ) +if env['IS_OSX']: + taglib.Append (LINKFLAGS= [ "-lz" ] ) #conf = Configure(taglib) #taglib = conf.finish () -- cgit v1.2.3