Fix some compiling warnings and errors in OS X

git-svn-id: svn://localhost/ardour2/branches/3.0@4358 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sakari Bergen
2008-12-29 19:50:19 +00:00
parent 22d73333c6
commit 3d239bb9d5
8 changed files with 31 additions and 26 deletions

View File

@@ -31,7 +31,7 @@
#include <gtkmm/checkbutton.h>
#include <iostream>
#include <cmath>
PluginEqGui::PluginEqGui(boost::shared_ptr<ARDOUR::PluginInsert> pluginInsert)
: _min_dB(-12.0),
@@ -683,13 +683,13 @@ PluginEqGui::plot_signal_amplitude_difference(Gtk::Widget *w, cairo_t *cr)
}
*/
if (isinf(power)) {
if (std::isinf(power)) {
if (power < 0) {
power = _min_dB - 1.0;
} else {
power = _max_dB - 1.0;
}
} else if (isnan(power)) {
} else if (std::isnan(power)) {
power = _min_dB - 1.0;
}

View File

@@ -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:

View File

@@ -77,8 +77,9 @@ class SndfileWriterBase : public ExportFileWriter
template <typename T>
class SndfileWriter : public SndfileWriterBase, public GraphSink<T>
{
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);

View File

@@ -400,8 +400,6 @@ ExportFileFactory::create_sndfile (FormatPtr format, unsigned int channels, ustr
typedef boost::shared_ptr<SndfileWriter<int> > IntWriterPtr;
typedef boost::shared_ptr<SndfileWriter<float> > 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<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
} else {
FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter<float> (channels, format->dither_type(), data_width));
FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter<float> (channels, format->sample_rate(), real_format, filename));
sfc->pipe_to (sfw);
return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));;
}
FloatConverterPtr sfc = FloatConverterPtr (new SampleFormatConverter<float> (channels, format->dither_type(), data_width));
FloatWriterPtr sfw = FloatWriterPtr (new SndfileWriter<float> (channels, format->sample_rate(), real_format, filename));
sfc->pipe_to (sfw);
return std::make_pair (boost::static_pointer_cast<FloatSink> (sfc), boost::static_pointer_cast<ExportFileWriter> (sfw));
}
bool

View File

@@ -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);

View File

@@ -12,7 +12,8 @@ evoral.Merge([
libraries['sigc2'],
libraries['glibmm2'],
libraries['xml'],
libraries['pbd'],
libraries['pbd'],
libraries['boost']
])
if evoral['IS_OSX']:

View File

@@ -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'], [])

View File

@@ -64,6 +64,8 @@ taglib.Append (CPPATH= [ '#libs/taglib/taglib',
]
)
if env['IS_OSX']:
taglib.Append (LINKFLAGS= [ "-lz" ] )
#conf = Configure(taglib)
#taglib = conf.finish ()