diff options
author | danfe <danfe@FreeBSD.org> | 2004-09-22 13:47:15 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2004-09-22 13:47:15 +0800 |
commit | 98ba5f1abddbe98621721b0fabb751081da80688 (patch) | |
tree | 19261bf6b6913a372988695c1daf9fa0913a3b28 /games/rtb/files | |
parent | 138f567083c5e2627069dd01679aa6756320e0a5 (diff) | |
download | freebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.tar.gz freebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.tar.zst freebsd-ports-gnome-98ba5f1abddbe98621721b0fabb751081da80688.zip |
Fix bad C++ code to unbreak the build with latest GCC.
Reported by: kris
Approved by: portmgr (marcus), fjoe (mentor, implicit)
Diffstat (limited to 'games/rtb/files')
-rw-r--r-- | games/rtb/files/patch-include::List.h | 29 | ||||
-rw-r--r-- | games/rtb/files/patch-src::GeometricalObjects.cc | 47 | ||||
-rw-r--r-- | games/rtb/files/patch-src::StartTournamentWindow.cc | 20 |
3 files changed, 96 insertions, 0 deletions
diff --git a/games/rtb/files/patch-include::List.h b/games/rtb/files/patch-include::List.h new file mode 100644 index 000000000000..324c09e88897 --- /dev/null +++ b/games/rtb/files/patch-include::List.h @@ -0,0 +1,29 @@ +--- include/List.h.orig Tue Sep 21 15:50:15 2004 ++++ include/List.h Tue Sep 21 17:22:32 2004 +@@ -96,7 +96,7 @@ + inline T* + ListIterator<T>::operator() () const + { +- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator()"); ++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator()"); + + return listp->element; + } +@@ -105,7 +105,7 @@ + inline const ListIterator<T>& + ListIterator<T>::operator++ (int) + { +- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator++"); ++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator++"); + listp = listp->next; + return *this; + } +@@ -114,7 +114,7 @@ + inline const ListIterator<T>& + ListIterator<T>::operator-- (int) + { +- if ( listp == NULL ) Error(true, "NULL pointer", "ListIterator::operator--"); ++ if ( listp == NULL ) Error(true, (const String&)"NULL pointer", (const String&)"ListIterator::operator--"); + listp = listp->prev; + return *this; + } diff --git a/games/rtb/files/patch-src::GeometricalObjects.cc b/games/rtb/files/patch-src::GeometricalObjects.cc new file mode 100644 index 000000000000..0a1802159038 --- /dev/null +++ b/games/rtb/files/patch-src::GeometricalObjects.cc @@ -0,0 +1,47 @@ +--- src/GeometricalObjects.cc.orig Tue Sep 21 18:01:56 2004 ++++ src/GeometricalObjects.cc Tue Sep 21 18:02:43 2004 +@@ -89,7 +89,7 @@ + if( s < 0 || s > length ) return infinity; + if( t < 0 && ((d=-dot(y, direction)) < 0.0 || d > length ) ) return infinity; + +- return max(t, 0); ++ return Max(t, 0); + } + + Vector2D +@@ -169,7 +169,7 @@ + double r = size+radius; + double c = dt*dt + speedsqr * (r*r - lengthsqr(y)); + if( c < 0.0 || dt <= 0.0) return infinity; +- return max( (dt - sqrt(c))/speedsqr, 0); ++ return Max( (dt - sqrt(c))/speedsqr, 0); + } + + bool +@@ -231,7 +231,7 @@ + if( speedsqr == 0.0 ) return infinity; + double dt = dot(vel, y); + double c = dt*dt + speedsqr*((size-radius)*(size-radius) - lengthsqr(y)); +- return max( (dt + sqrt(c))/speedsqr, 0 ); ++ return Max( (dt + sqrt(c))/speedsqr, 0 ); + } + + bool +@@ -318,7 +318,7 @@ + r = size + outer_radius; + c = dt*dt + speedsqr * (r*r - lengthsqr(d)); + if( c < 0.0 || dt <= 0.0) return infinity; +- t = max( (dt - sqrt(c))/speedsqr, 0); ++ t = Max( (dt - sqrt(c))/speedsqr, 0); + + if( within_angle( vec2angle( vel * t - d ) ) ) + return t; +@@ -336,7 +336,7 @@ + c = dt*dt + speedsqr*( r*r - lengthsqr(d) ); + if( c < 0.0 ) return infinity; // Can happen if object outside circle + +- t = max( (dt + sqrt(c))/speedsqr, 0 ); ++ t = Max( (dt + sqrt(c))/speedsqr, 0 ); + + if( !within_angle( vec2angle( vel * t - d ) ) ) + return infinity; diff --git a/games/rtb/files/patch-src::StartTournamentWindow.cc b/games/rtb/files/patch-src::StartTournamentWindow.cc new file mode 100644 index 000000000000..840ac3db971f --- /dev/null +++ b/games/rtb/files/patch-src::StartTournamentWindow.cc @@ -0,0 +1,20 @@ +--- src/StartTournamentWindow.cc.orig Tue Sep 21 18:05:42 2004 ++++ src/StartTournamentWindow.cc Tue Sep 21 18:06:01 2004 +@@ -660,7 +660,7 @@ + max_value = 10000; + else + { +- max_value = min( the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number); ++ max_value = Min( the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number); + } + if(i != 1) + min_value = 1; +@@ -805,7 +805,7 @@ + max_value = 10000; + else + { +- max_value = min(the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number); ++ max_value = Min(the_opts.get_l( OPTION_MAX_ROBOTS_ALLOWED ),robot_number); + } + if(i != 1) + min_value = 1; |