From 9a20433d9890af935e03f004fa7707f8d2942c31 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 12 Feb 2018 07:04:47 -0500 Subject: [PATCH] fix definition of Temporal::Beats::max() Ticks can exceed PPQN, but if beats are already INT32_MAX, ::normalize() will not work correctly --- libs/temporal/temporal/beats.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/temporal/temporal/beats.h b/libs/temporal/temporal/beats.h index 3c92ac7561..e1790668d5 100644 --- a/libs/temporal/temporal/beats.h +++ b/libs/temporal/temporal/beats.h @@ -308,8 +308,7 @@ namespace std { template<> struct numeric_limits { static Temporal::Beats lowest() { - return Temporal::Beats(std::numeric_limits::min(), - std::numeric_limits::min()); + return Temporal::Beats(std::numeric_limits::min(), std::numeric_limits::min()); } /* We don't define min() since this has different behaviour for integral and floating point types, @@ -317,8 +316,7 @@ namespace std { than a confusing one. */ static Temporal::Beats max() { - return Temporal::Beats(std::numeric_limits::max(), - std::numeric_limits::max()); + return Temporal::Beats(std::numeric_limits::max(), Temporal::Beats::PPQN-1); } }; }