[Haiku-commits] r31200 - haiku/trunk/src/apps/debugger/gui/team_window

stippi at mail.berlios.de stippi at mail.berlios.de
Tue Jun 23 14:12:10 CEST 2009


Author: stippi
Date: 2009-06-23 14:12:08 +0200 (Tue, 23 Jun 2009)
New Revision: 31200
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31200&view=rev

Modified:
   haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp
Log:
Sorry for messing in this code, but I was a bit helpless how to fix the GCC2
build in another way...


Modified: haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp	2009-06-23 11:05:16 UTC (rev 31199)
+++ haiku/trunk/src/apps/debugger/gui/team_window/SourceView.cpp	2009-06-23 12:12:08 UTC (rev 31200)
@@ -96,13 +96,22 @@
 									MarkerList& markers);
 			BreakpointMarker*	_BreakpointMarkerAtLine(uint32 line);
 
-	template<typename MarkerType>
-	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<typename MarkerType>
+	static	int					_CompareLineMarkerTemplate(const uint32* line,
+									const MarkerType* marker);
 	static	int					_CompareLineMarker(const uint32* line,
-									const MarkerType* marker);
+									const Marker* marker);
+	static	int					_CompareLineBreakpointMarker(
+									const uint32* line,
+									const BreakpointMarker* marker);
 
 private:
 			TeamDebugModel*		fDebugModel;
@@ -173,7 +182,7 @@
 
 	virtual int operator()(const MarkerType* marker) const
 	{
-		return -_CompareLineMarker<MarkerType>(&fLine, marker);
+		return -_CompareLineMarkerTemplate<MarkerType>(&fLine, marker);
 	}
 
 private:
@@ -601,7 +610,7 @@
 		}
 
 		// sort by line
-		fIPMarkers.SortItems(&_CompareMarkers<Marker>);
+		fIPMarkers.SortItems(&_CompareMarkers);
 
 		// TODO: Filter duplicate IP markers (recursive functions)!
 	}
@@ -648,7 +657,7 @@
 		}
 
 		// sort by line
-		fBreakpointMarkers.SortItems(&_CompareMarkers<BreakpointMarker>);
+		fBreakpointMarkers.SortItems(&_CompareBreakpointMarkers);
 	}
 
 	fBreakpointMarkersValid = true;
@@ -697,14 +706,13 @@
 SourceView::MarkerView::_BreakpointMarkerAtLine(uint32 line)
 {
 	return fBreakpointMarkers.BinarySearchByKey(line,
-		&_CompareLineMarker<BreakpointMarker>);
+		&_CompareLineBreakpointMarker);
 }
 
 
-template<typename MarkerType>
 /*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;
@@ -712,9 +720,19 @@
 }
 
 
+/*static*/ int
+SourceView::MarkerView::_CompareBreakpointMarkers(const BreakpointMarker* a,
+	const BreakpointMarker* b)
+{
+	if (a->Line() < b->Line())
+		return -1;
+	return a->Line() == b->Line() ? 0 : 1;
+}
+
+
 template<typename MarkerType>
 /*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 @@
 }
 
 
+/*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
 
 




More information about the Haiku-commits mailing list