Sorry for messing in this code, but I was a bit helpless how to fix the GCC2

build in another way...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31200 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2009-06-23 12:12:08 +00:00
parent b9bbf08852
commit 73b8cef5e6
@@ -96,13 +96,22 @@ private:
MarkerList& markers); MarkerList& markers);
BreakpointMarker* _BreakpointMarkerAtLine(uint32 line); BreakpointMarker* _BreakpointMarkerAtLine(uint32 line);
template<typename MarkerType> // TODO: "public" to workaround a GCC2 problem:
static int _CompareMarkers(const MarkerType* a, public:
const MarkerType* b); static int _CompareMarkers(const Marker* a,
const Marker* b);
static int _CompareBreakpointMarkers(
const BreakpointMarker* a,
const BreakpointMarker* b);
template<typename MarkerType> template<typename MarkerType>
static int _CompareLineMarker(const uint32* line, static int _CompareLineMarkerTemplate(const uint32* line,
const MarkerType* marker); const MarkerType* marker);
static int _CompareLineMarker(const uint32* line,
const Marker* marker);
static int _CompareLineBreakpointMarker(
const uint32* line,
const BreakpointMarker* marker);
private: private:
TeamDebugModel* fDebugModel; TeamDebugModel* fDebugModel;
@@ -173,7 +182,7 @@ struct SourceView::MarkerView::MarkerByLinePredicate
virtual int operator()(const MarkerType* marker) const virtual int operator()(const MarkerType* marker) const
{ {
return -_CompareLineMarker<MarkerType>(&fLine, marker); return -_CompareLineMarkerTemplate<MarkerType>(&fLine, marker);
} }
private: private:
@@ -601,7 +610,7 @@ SourceView::MarkerView::_UpdateIPMarkers()
} }
// sort by line // sort by line
fIPMarkers.SortItems(&_CompareMarkers<Marker>); fIPMarkers.SortItems(&_CompareMarkers);
// TODO: Filter duplicate IP markers (recursive functions)! // TODO: Filter duplicate IP markers (recursive functions)!
} }
@@ -648,7 +657,7 @@ SourceView::MarkerView::_UpdateBreakpointMarkers()
} }
// sort by line // sort by line
fBreakpointMarkers.SortItems(&_CompareMarkers<BreakpointMarker>); fBreakpointMarkers.SortItems(&_CompareBreakpointMarkers);
} }
fBreakpointMarkersValid = true; fBreakpointMarkersValid = true;
@@ -697,14 +706,23 @@ SourceView::MarkerView::BreakpointMarker*
SourceView::MarkerView::_BreakpointMarkerAtLine(uint32 line) SourceView::MarkerView::_BreakpointMarkerAtLine(uint32 line)
{ {
return fBreakpointMarkers.BinarySearchByKey(line, return fBreakpointMarkers.BinarySearchByKey(line,
&_CompareLineMarker<BreakpointMarker>); &_CompareLineBreakpointMarker);
} }
template<typename MarkerType>
/*static*/ int /*static*/ int
SourceView::MarkerView::_CompareMarkers(const MarkerType* a, SourceView::MarkerView::_CompareMarkers(const Marker* a,
const MarkerType* b) const Marker* b)
{
if (a->Line() < b->Line())
return -1;
return a->Line() == b->Line() ? 0 : 1;
}
/*static*/ int
SourceView::MarkerView::_CompareBreakpointMarkers(const BreakpointMarker* a,
const BreakpointMarker* b)
{ {
if (a->Line() < b->Line()) if (a->Line() < b->Line())
return -1; return -1;
@@ -714,7 +732,7 @@ SourceView::MarkerView::_CompareMarkers(const MarkerType* a,
template<typename MarkerType> template<typename MarkerType>
/*static*/ int /*static*/ int
SourceView::MarkerView::_CompareLineMarker(const uint32* line, SourceView::MarkerView::_CompareLineMarkerTemplate(const uint32* line,
const MarkerType* marker) const MarkerType* marker)
{ {
if (*line < marker->Line()) if (*line < marker->Line())
@@ -723,6 +741,22 @@ SourceView::MarkerView::_CompareLineMarker(const uint32* line,
} }
/*static*/ int
SourceView::MarkerView::_CompareLineMarker(const uint32* line,
const Marker* marker)
{
return _CompareLineMarkerTemplate<Marker>(line, marker);
}
/*static*/ int
SourceView::MarkerView::_CompareLineBreakpointMarker(const uint32* line,
const BreakpointMarker* marker)
{
return _CompareLineMarkerTemplate<BreakpointMarker>(line, marker);
}
// #pragma mark - TextView // #pragma mark - TextView