comparison base/EventSeries.cpp @ 1642:d591836e47ef single-point

Fix compiler warning
author Chris Cannam
date Wed, 13 Mar 2019 14:46:54 +0000
parents e7f557789f99
children 513192aa9b03
comparison
equal deleted inserted replaced
1641:751a52865270 1642:d591836e47ef
406 406
407 int 407 int
408 EventSeries::getIndexForEvent(const Event &e) const 408 EventSeries::getIndexForEvent(const Event &e) const
409 { 409 {
410 auto pitr = lower_bound(m_events.begin(), m_events.end(), e); 410 auto pitr = lower_bound(m_events.begin(), m_events.end(), e);
411 return distance(m_events.begin(), pitr); 411 auto d = distance(m_events.begin(), pitr);
412 if (d < 0 || d > INT_MAX) return 0;
413 return int(d);
412 } 414 }
413 415
414 void 416 void
415 EventSeries::toXml(QTextStream &out, 417 EventSeries::toXml(QTextStream &out,
416 QString indent, 418 QString indent,