From 73b8cef5e660767dbf0ae216917d9f502b2c056b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 23 Jun 2009 12:12:08 +0000 Subject: [PATCH] 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 --- .../debugger/gui/team_window/SourceView.cpp | 58 +++++++++++++++---- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/src/apps/debugger/gui/team_window/SourceView.cpp b/src/apps/debugger/gui/team_window/SourceView.cpp index cd00fdf66a..bf3355d236 100644 --- a/src/apps/debugger/gui/team_window/SourceView.cpp +++ b/src/apps/debugger/gui/team_window/SourceView.cpp @@ -96,13 +96,22 @@ private: MarkerList& markers); BreakpointMarker* _BreakpointMarkerAtLine(uint32 line); - template - static int _CompareMarkers(const MarkerType* a, - const MarkerType* b); +// TODO: "public" to workaround a GCC2 problem: +public: + static int _CompareMarkers(const Marker* a, + const Marker* b); + static int _CompareBreakpointMarkers( + const BreakpointMarker* a, + const BreakpointMarker* b); template - static int _CompareLineMarker(const uint32* line, + static int _CompareLineMarkerTemplate(const uint32* line, const MarkerType* marker); + static int _CompareLineMarker(const uint32* line, + const Marker* marker); + static int _CompareLineBreakpointMarker( + const uint32* line, + const BreakpointMarker* marker); private: TeamDebugModel* fDebugModel; @@ -173,7 +182,7 @@ struct SourceView::MarkerView::MarkerByLinePredicate virtual int operator()(const MarkerType* marker) const { - return -_CompareLineMarker(&fLine, marker); + return -_CompareLineMarkerTemplate(&fLine, marker); } private: @@ -601,7 +610,7 @@ SourceView::MarkerView::_UpdateIPMarkers() } // sort by line - fIPMarkers.SortItems(&_CompareMarkers); + fIPMarkers.SortItems(&_CompareMarkers); // TODO: Filter duplicate IP markers (recursive functions)! } @@ -648,7 +657,7 @@ SourceView::MarkerView::_UpdateBreakpointMarkers() } // sort by line - fBreakpointMarkers.SortItems(&_CompareMarkers); + fBreakpointMarkers.SortItems(&_CompareBreakpointMarkers); } fBreakpointMarkersValid = true; @@ -697,14 +706,23 @@ SourceView::MarkerView::BreakpointMarker* SourceView::MarkerView::_BreakpointMarkerAtLine(uint32 line) { return fBreakpointMarkers.BinarySearchByKey(line, - &_CompareLineMarker); + &_CompareLineBreakpointMarker); } -template /*static*/ int -SourceView::MarkerView::_CompareMarkers(const MarkerType* a, - const MarkerType* b) +SourceView::MarkerView::_CompareMarkers(const Marker* a, + 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()) return -1; @@ -714,7 +732,7 @@ SourceView::MarkerView::_CompareMarkers(const MarkerType* a, template /*static*/ int -SourceView::MarkerView::_CompareLineMarker(const uint32* line, +SourceView::MarkerView::_CompareLineMarkerTemplate(const uint32* line, const MarkerType* marker) { 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(line, marker); +} + + +/*static*/ int +SourceView::MarkerView::_CompareLineBreakpointMarker(const uint32* line, + const BreakpointMarker* marker) +{ + return _CompareLineMarkerTemplate(line, marker); +} + + // #pragma mark - TextView