summarylogtreecommitdiffstats
path: root/gcc6-isnan.patch
blob: ff415fe5d279f615fb64ebbf9446202ce681b9d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From: Aurelien Jarno <aurelien@aurel32.net>
Date: Mon, 1 May 2017 15:53:17 +0200
Subject: gcc6-isnan

car->ctrl->gear is defined as int, therefore it can never be infinite or
NaN. Just drop the tests.

Forwarded: https://sourceforge.net/p/torcs/mailman/message/35831161/
---
 src/drivers/olethros/geometry.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drivers/olethros/geometry.cpp b/src/drivers/olethros/geometry.cpp
index 7b6bc82..846aef7 100644
--- a/src/drivers/olethros/geometry.cpp
+++ b/src/drivers/olethros/geometry.cpp
@@ -370,7 +370,7 @@ void EstimateSphere (std::vector<Vector> P, ParametricSphere* sphere)
 				}
 				delta_total += delta;
 			}
-			if (isnan(r)) {
+			if (std::isnan(r)) {
 				for (i=0; i<d; i++) {
 					center[i] =  ((*(sphere->C))[i] - mean[i]) / scale;
 				}