# HG changeset patch # User Chris Cannam # Date 1552488414 0 # Node ID d591836e47efd3f283a5ae219c0a6ad4fd9f44a9 # Parent 751a52865270cb4c4c1e417f7e88d7da2a512894 Fix compiler warning diff -r 751a52865270 -r d591836e47ef base/EventSeries.cpp --- a/base/EventSeries.cpp Wed Mar 13 14:46:40 2019 +0000 +++ b/base/EventSeries.cpp Wed Mar 13 14:46:54 2019 +0000 @@ -408,7 +408,9 @@ EventSeries::getIndexForEvent(const Event &e) const { auto pitr = lower_bound(m_events.begin(), m_events.end(), e); - return distance(m_events.begin(), pitr); + auto d = distance(m_events.begin(), pitr); + if (d < 0 || d > INT_MAX) return 0; + return int(d); } void