comparison base/Selection.cpp @ 928:6a94bb528e9d warnfix_no_size_t

Remove size_t's, fix compiler warnings
author Chris Cannam
date Tue, 17 Jun 2014 13:52:07 +0100
parents 70a232b1f12a
children cc27f35aa75c
comparison
equal deleted inserted replaced
917:49618f39ff09 928:6a94bb528e9d
20 m_startFrame(0), 20 m_startFrame(0),
21 m_endFrame(0) 21 m_endFrame(0)
22 { 22 {
23 } 23 }
24 24
25 Selection::Selection(size_t startFrame, size_t endFrame) : 25 Selection::Selection(int startFrame, int endFrame) :
26 m_startFrame(startFrame), 26 m_startFrame(startFrame),
27 m_endFrame(endFrame) 27 m_endFrame(endFrame)
28 { 28 {
29 if (m_startFrame > m_endFrame) { 29 if (m_startFrame > m_endFrame) {
30 size_t tmp = m_endFrame; 30 int tmp = m_endFrame;
31 m_endFrame = m_startFrame; 31 m_endFrame = m_startFrame;
32 m_startFrame = tmp; 32 m_startFrame = tmp;
33 } 33 }
34 } 34 }
35 35
57 Selection::isEmpty() const 57 Selection::isEmpty() const
58 { 58 {
59 return m_startFrame == m_endFrame; 59 return m_startFrame == m_endFrame;
60 } 60 }
61 61
62 size_t 62 int
63 Selection::getStartFrame() const 63 Selection::getStartFrame() const
64 { 64 {
65 return m_startFrame; 65 return m_startFrame;
66 } 66 }
67 67
68 size_t 68 int
69 Selection::getEndFrame() const 69 Selection::getEndFrame() const
70 { 70 {
71 return m_endFrame; 71 return m_endFrame;
72 } 72 }
73 73
74 bool 74 bool
75 Selection::contains(size_t frame) const 75 Selection::contains(int frame) const
76 { 76 {
77 return (frame >= m_startFrame) && (frame < m_endFrame); 77 return (frame >= m_startFrame) && (frame < m_endFrame);
78 } 78 }
79 79
80 bool 80 bool
172 m_selections.clear(); 172 m_selections.clear();
173 } 173 }
174 } 174 }
175 175
176 void 176 void
177 MultiSelection::getExtents(size_t &startFrame, size_t &endFrame) const 177 MultiSelection::getExtents(int &startFrame, int &endFrame) const
178 { 178 {
179 startFrame = 0; 179 startFrame = 0;
180 endFrame = 0; 180 endFrame = 0;
181 181
182 for (SelectionList::const_iterator i = m_selections.begin(); 182 for (SelectionList::const_iterator i = m_selections.begin();
191 } 191 }
192 } 192 }
193 } 193 }
194 194
195 Selection 195 Selection
196 MultiSelection::getContainingSelection(size_t frame, bool defaultToFollowing) const 196 MultiSelection::getContainingSelection(int frame, bool defaultToFollowing) const
197 { 197 {
198 // This scales very badly with the number of selections, but it's 198 // This scales very badly with the number of selections, but it's
199 // more efficient for very small numbers of selections than a more 199 // more efficient for very small numbers of selections than a more
200 // scalable method, and I think that may be what we need 200 // scalable method, and I think that may be what we need
201 201