torcs/torcs-1.3.7-gcc6-isnan.patch

26 lines
825 B
Diff

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;
}