use C++ std function for max()
authorRobin Gareus <robin@gareus.org>
Wed, 27 Mar 2013 17:45:08 +0000 (18:45 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 27 Mar 2013 17:45:08 +0000 (18:45 +0100)
gtk2_ardour/editor_drag.cc
gtk2_ardour/video_timeline.cc

index d66690319d80c6dfb737ec31d3c7bc4f3b5cc456..1713fe58c08e1f5e7b2d7375e59b0f856133530d 100644 (file)
@@ -22,6 +22,7 @@
 #endif
 
 #include <stdint.h>
+#include <algorithm>
 
 #include "pbd/memento_command.h"
 #include "pbd/basename.h"
@@ -1611,11 +1612,6 @@ NoteResizeDrag::aborted (bool)
 
 #ifdef WITH_VIDEOTIMELINE
 
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
-
 AVDraggingView::AVDraggingView (RegionView* v)
        : view (v)
 {
@@ -1757,8 +1753,8 @@ VideoTimeLineDrag::finished (GdkEvent * /*event*/, bool movement_occurred)
        }
 
        _editor->session()->maybe_update_session_range(
-                       MAX(ARDOUR_UI::instance()->video_timeline->get_offset(), 0),
-                       MAX(ARDOUR_UI::instance()->video_timeline->get_offset() + ARDOUR_UI::instance()->video_timeline->get_duration(), 0)
+                       std::max(ARDOUR_UI::instance()->video_timeline->get_offset(), (ARDOUR::frameoffset_t) 0),
+                       std::max(ARDOUR_UI::instance()->video_timeline->get_offset() + ARDOUR_UI::instance()->video_timeline->get_duration(), (ARDOUR::frameoffset_t) 0)
                        );
 
 
index 398859c1a1f77b0dcd09aaaae82cb1e7cac795ae..f751866ba7dc74c23693635f89aa7543c7bf3048 100644 (file)
@@ -19,6 +19,7 @@
 */
 #ifdef WITH_VIDEOTIMELINE
 
+#include <algorithm>
 #include <sigc++/bind.h>
 #include "ardour/tempo.h"
 
@@ -46,10 +47,6 @@ using namespace ARDOUR;
 using namespace PBD;
 using namespace Timecode;
 
-#ifndef MAX
-#define MAX(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
 VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Group *vbg, int initial_height)
        : editor (ed)
                , videotl_bar_group(vbg)
@@ -519,8 +516,8 @@ VideoTimeLine::video_file_info (std::string filename, bool local)
        flush_local_cache ();
 
        _session->maybe_update_session_range(
-                       MAX(get_offset(), 0),
-                       MAX(get_offset() + get_duration(), 0)
+                       std::max(get_offset(), (ARDOUR::frameoffset_t) 0),
+                       std::max(get_offset() + get_duration(), (ARDOUR::frameoffset_t) 0)
                        );
 
        if (found_xjadeo() && local_file) {