diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 21:46:44 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-12 21:46:44 -0400 |
commit | 4e84bc3a39ca624d62be590c532a8bc33b33baa4 (patch) | |
tree | e81eda4a9f866590e1a4bb5891fba057c9b86ccc /libs | |
parent | b05968fb4e303ce47b6e09cd1bc713f3af28a6f9 (diff) |
changes to get cairocanvas branch to build on OS X, with its stupid nil and Rect macros, plus some const_cast<> and unused variable fixes that should really be in master but will have to wait till we rebase master
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/graph.cc | 2 | ||||
-rw-r--r-- | libs/ardour/ltc_slave.cc | 2 | ||||
-rw-r--r-- | libs/ardour/midi_diskstream.cc | 18 | ||||
-rw-r--r-- | libs/canvas/item.cc | 26 | ||||
-rw-r--r-- | libs/pbd/pbd/signals.h | 5 |
5 files changed, 29 insertions, 24 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc index d2fbdbf552..30c9a167a9 100644 --- a/libs/ardour/graph.cc +++ b/libs/ardour/graph.cc @@ -232,7 +232,7 @@ Graph::trigger (GraphNode* n) void Graph::dec_ref() { - if (g_atomic_int_dec_and_test (&_finished_refcount)) { + if (g_atomic_int_dec_and_test (const_cast<gint*> (&_finished_refcount))) { /* We have run all the nodes that are at the `output' end of the graph, so there is nothing more to do this time around. diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc index 8d08fd6bb5..99dad70c94 100644 --- a/libs/ardour/ltc_slave.cc +++ b/libs/ardour/ltc_slave.cc @@ -588,7 +588,7 @@ LTC_Slave::approximate_current_delta() const if (last_timestamp == 0 || engine_dll_initstate == 0) { snprintf(delta, sizeof(delta), "\u2012\u2012\u2012\u2012"); } else if ((monotonic_cnt - last_timestamp) > 2 * frames_per_ltc_frame) { - snprintf(delta, sizeof(delta), _("flywheel")); + snprintf(delta, sizeof(delta), "%s", _("flywheel")); } else { snprintf(delta, sizeof(delta), "\u0394<span foreground=\"green\" face=\"monospace\" >%s%s%" PRIi64 "</span>sm", LEADINGZERO(abs(current_delta)), PLUSMINUS(-current_delta), abs(current_delta)); diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 9c11e818ac..26cd43aec4 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -202,8 +202,8 @@ MidiDiskstream::non_realtime_input_change () seek (_session.transport_frame()); } - g_atomic_int_set(&_frames_pending_write, 0); - g_atomic_int_set(&_num_captured_loops, 0); + g_atomic_int_set(const_cast<gint*>(&_frames_pending_write), 0); + g_atomic_int_set(const_cast<gint*>(&_num_captured_loops), 0); } int @@ -376,8 +376,8 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t } _write_source->mark_write_starting_now( capture_start_frame, capture_captured, loop_length); - g_atomic_int_set(&_frames_pending_write, 0); - g_atomic_int_set(&_num_captured_loops, 0); + g_atomic_int_set(const_cast<gint*>(&_frames_pending_write), 0); + g_atomic_int_set(const_cast<gint*>(&_num_captured_loops), 0); was_recording = true; } } @@ -446,7 +446,7 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t break; } } - g_atomic_int_add(&_frames_pending_write, nframes); + g_atomic_int_add(const_cast<gint*>(&_frames_pending_write), nframes); if (buf.size() != 0) { Glib::Threads::Mutex::Lock lm (_gui_feed_buffer_mutex, Glib::Threads::TRY_LOCK); @@ -785,7 +785,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush) return 0; } - const framecnt_t total = g_atomic_int_get(&_frames_pending_write); + const framecnt_t total = g_atomic_int_get(const_cast<gint*>(&_frames_pending_write)); if (total == 0 || _capture_buf->read_space() == 0 || @@ -794,7 +794,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush) } /* if there are 2+ chunks of disk i/o possible for - this track, let the caller know so that it can arrange + this track), let the caller know so that it can arrange for us to be called again, ASAP. if we are forcing a flush, then if there is* any* extra @@ -820,7 +820,7 @@ MidiDiskstream::do_flush (RunContext /*context*/, bool force_flush) error << string_compose(_("MidiDiskstream %1: cannot write to disk"), id()) << endmsg; return -1; } - g_atomic_int_add(&_frames_pending_write, -to_write); + g_atomic_int_add(const_cast<gint*>(&_frames_pending_write), -to_write); } out: @@ -1030,7 +1030,7 @@ MidiDiskstream::transport_looped (framepos_t) the Source and/or entirely after the capture is finished. */ if (was_recording) { - g_atomic_int_add(&_num_captured_loops, 1); + g_atomic_int_add(const_cast<gint*>(&_num_captured_loops), 1); } } diff --git a/libs/canvas/item.cc b/libs/canvas/item.cc index 9f34f8c208..2c4ec893e7 100644 --- a/libs/canvas/item.cc +++ b/libs/canvas/item.cc @@ -61,8 +61,8 @@ Item::~Item () } } -Rect -Item::item_to_parent (Rect const & r) const +ArdourCanvas::Rect +Item::item_to_parent (ArdourCanvas::Rect const & r) const { return r.translate (_position); } @@ -71,8 +71,8 @@ Item::item_to_parent (Rect const & r) const void Item::set_position (Duple p) { - boost::optional<Rect> bbox = bounding_box (); - boost::optional<Rect> pre_change_parent_bounding_box; + boost::optional<ArdourCanvas::Rect> bbox = bounding_box (); + boost::optional<ArdourCanvas::Rect> pre_change_parent_bounding_box; if (bbox) { pre_change_parent_bounding_box = item_to_parent (bbox.get()); @@ -146,8 +146,8 @@ Item::parent_to_item (Duple const & d) const return d.translate (- _position); } -Rect -Item::parent_to_item (Rect const & d) const +ArdourCanvas::Rect +Item::parent_to_item (ArdourCanvas::Rect const & d) const { return d.translate (- _position); } @@ -180,7 +180,7 @@ Item::grab_focus () } /** @return Bounding box in this item's coordinates */ -boost::optional<Rect> +boost::optional<ArdourCanvas::Rect> Item::bounding_box () const { if (_bounding_box_dirty) { @@ -194,7 +194,7 @@ Item::bounding_box () const Coord Item::height () const { - boost::optional<Rect> bb = bounding_box(); + boost::optional<ArdourCanvas::Rect> bb = bounding_box(); if (bb) { return bb->height (); @@ -205,7 +205,7 @@ Item::height () const Coord Item::width () const { - boost::optional<Rect> bb = bounding_box().get(); + boost::optional<ArdourCanvas::Rect> bb = bounding_box().get(); if (bb) { return bb->width (); @@ -314,10 +314,10 @@ Item::canvas_to_item (Coord& x, Coord& y) const y = d.y; } -Rect -Item::item_to_canvas (Rect const & area) const +ArdourCanvas::Rect +Item::item_to_canvas (ArdourCanvas::Rect const & area) const { - Rect r = area; + ArdourCanvas::Rect r = area; Item const * i = this; while (i) { @@ -337,7 +337,7 @@ Item::set_ignore_events (bool ignore) void Item::dump (ostream& o) const { - boost::optional<Rect> bb = bounding_box(); + boost::optional<ArdourCanvas::Rect> bb = bounding_box(); o << _canvas->indent() << whatami() << ' ' << this; diff --git a/libs/pbd/pbd/signals.h b/libs/pbd/pbd/signals.h index 69c52f57cf..140ea014e8 100644 --- a/libs/pbd/pbd/signals.h +++ b/libs/pbd/pbd/signals.h @@ -22,6 +22,11 @@ #include <list> #include <map> + +#ifdef nil +#undef nil +#endif + #include <glibmm/threads.h> #include <boost/noncopyable.hpp> |