From 05740e7069451681d46696b4bbcb058064010e73 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 12 Dec 2020 17:21:43 -0700 Subject: [PATCH] Temporal: mark Beats::operator bool() as explicit, to avoid unintended/accidental use when implicitly casting to int/float types --- libs/temporal/temporal/beats.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/temporal/temporal/beats.h b/libs/temporal/temporal/beats.h index e27358cb27..3ba67d4e73 100644 --- a/libs/temporal/temporal/beats.h +++ b/libs/temporal/temporal/beats.h @@ -46,8 +46,7 @@ class MidiModel; class AutomationList; class MidiSource; class MidiRegion; -/* these use ::to_double() but should be removed */ -class DoubleBeatsSamplesConverter; +class Quantize; } namespace Evoral { @@ -339,7 +338,7 @@ public: } bool operator!() const { return _beats == 0 && _ticks == 0; } - operator bool () const { return _beats != 0 || _ticks != 0; } + explicit operator bool () const { return _beats != 0 || _ticks != 0; } static Beats one_tick() { return Beats(0, 1); } @@ -356,7 +355,7 @@ private: friend class ARDOUR::AutomationList; friend class ARDOUR::MidiSource; friend class ARDOUR::MidiRegion; - friend class ARDOUR::DoubleBeatsSamplesConverter; + friend class ARDOUR::Quantize; friend class ::QuantizeDialog; friend class ::NoteDrag; friend class ::NoteCreateDrag;