]> git.mxchange.org Git - simgear.git/commitdiff
Portability: Fix compile errors on MSVC
authorJames Turner <zakalawe@mac.com>
Tue, 24 Mar 2015 16:05:57 +0000 (11:05 -0500)
committerJames Turner <zakalawe@mac.com>
Tue, 24 Mar 2015 16:05:57 +0000 (11:05 -0500)
From Scott (xDraconian)

15 files changed:
simgear/ephemeris/jupiter.cxx
simgear/ephemeris/mars.cxx
simgear/ephemeris/mercury.cxx
simgear/ephemeris/neptune.cxx
simgear/ephemeris/saturn.cxx
simgear/ephemeris/star.cxx
simgear/ephemeris/uranus.cxx
simgear/ephemeris/venus.cxx
simgear/io/sg_netChat.cxx
simgear/io/sg_socket_udp.cxx
simgear/magvar/coremag.cxx
simgear/magvar/magvar.cxx
simgear/magvar/testmagvar.cxx
simgear/misc/strutils.cxx
simgear/scene/tgdb/SGBuildingBin.cxx

index 1d9ca6bdcba39ee7a2414a01d5ac614b8b8c73b9..09f83c840b0cf66662710621df7c7f3360d00e7f 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "jupiter.hxx"
 
index 78c26f35d264a4f975d1b4265c835be13245e9ea..d153ef2e695c0879ddf12918a885a2fa2a0fc26f 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "mars.hxx"
 
index da4507828213c1b3d38c1a9021ce14c9b8b0ed8e..3c342ef3e0751e5f4e6d1407762f3905526c3a84 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "mercury.hxx"
 
index 2fbe75984e4340e3f4319bb720d1cb2cb7c92ccf..12e47ff6162370b3e1c52b47702644df8cd7afd2 100644 (file)
@@ -25,7 +25,7 @@
 #ifdef __BORLANDC__
 #  define exception c_exception
 #endif
-#include <math.h>
+#include <cmath>
 
 #include "neptune.hxx"
 
index 0038a290136dadafd0112fb1235e4d58738dee06..8aed124809573ab2a4731602c5071944a38fa870 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "saturn.hxx"
 
index dee21439f12b72695429e4ded15309eb1ba3d326..b36a9006bed85f488fcfaa53e720aaf8c51cb91c 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include <simgear/debug/logstream.hxx>
 
index f3d55601a48117c2ef112b2331e23aab7f3a36fc..e4e55dd2fea5a320ce0992e38013c54f56fc4ff5 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "uranus.hxx"
 
index b889107ed3dd2b57263a4037897c093e64771b81..54444390273d02aaa60fd6110132d921a4fbfb4a 100644 (file)
@@ -22,7 +22,7 @@
  * $Id$
  **************************************************************************/
 
-#include <math.h>
+#include <cmath>
 
 #include "venus.hxx"
 
index d445e4438ad22255febd27e3cda8122e3b694300..3baecdf8b64b564dc0fed0aa0e239d91a921c56b 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <cstring>
 #include <cstdlib>
+#include <algorithm>
 
 namespace  simgear {
 
index bfc8f7bdd5cc9ce24bdd8de16d1ce61b8a1324ad..6e43eb96098381dc6b6b4c52c6f7991c4d8369b0 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <cstring>
 #include <cstdlib> // for atoi
+#include <algorithm>
 
 using std::string;
 
index e6d42c1d1a5bf45341a2b476c19ea31ee9913337..8d0616fd33f9ebb46762b1d54952cb14fcb938ec 100644 (file)
@@ -79,7 +79,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <math.h>
+#include <cmath>
 
 #include <simgear/constants.h>
 #include <simgear/sg_inlines.h>
index 43563a71b6f2c3d919156c192e1bb1e639fb9003..d22257848ebb2ba20cb3892f10f35de47dbfcbf5 100644 (file)
@@ -26,7 +26,7 @@
 #endif
 
 
-#include <math.h>
+#include <cmath>
 
 #include <simgear/magvar/magvar.hxx>
 #include <simgear/math/SGMath.hxx>
index 965c0c406434a8efd6548b6bbae5ca20db91145c..3e63b413961f06b020816024e62109cf7775b040 100644 (file)
@@ -1,8 +1,8 @@
 /* 2/14/00 fixed help message- dip angle (down positive), variation (E positive) */
 
-#include       <stdio.h>
-#include       <stdlib.h>
-#include       <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <cmath>
 
 #include <simgear/constants.h>
 
index c72d0058a9a1b430fd5458b335654f730a779b1e..86418b4c1daf665a78734e16644c1ca6fb419368 100644 (file)
@@ -23,6 +23,7 @@
 #include <ctype.h>
 #include <cstring>
 #include <sstream>
+#include <algorithm>
 
 #include "strutils.hxx"
 
index bafb9c3838bbd5d1adfe2c344b5136c695f40fbf..22055845531d060dd15e0ba9761ac35182e787a5 100644 (file)
@@ -386,10 +386,10 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const
           int row = ((int) (mt_rand(&seed) * 1000)) % 5;
           float base_y = (float) row * 16.0 * 3.0 / 1024.0;
           float top_y = base_y + 16.0 * (float) building.floors / 1024.0;
-          float left_x = 32.0 / 1024.0 * round((float) building.width / 6.0f);
+          float left_x = 32.0 / 1024.0 * SGMisc<double>::round((float)building.width / 6.0f);
           float right_x = 0.0f;
           float front_x = 384.0/1024.0;
-          float back_x = 384.0/1024.0 + 32.0 / 1024.0 * round((float) building.depth/ 6.0f);
+          float back_x = 384.0 / 1024.0 + 32.0 / 1024.0 * SGMisc<double>::round((float)building.depth / 6.0f);
 
           // BASEMENT - uses the baseline texture
           for (unsigned int i = 0; i < 16; i++) {
@@ -424,7 +424,7 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const
           if (building.pitched) {
             // Use the entire height of the roof texture
             top_y = base_y + 16.0 * 3.0 / 1024.0;
-            left_x = 512/1024.0 + 32.0 / 1024.0 * round(building.width / 6.0f);
+            left_x = 512 / 1024.0 + 32.0 / 1024.0 * SGMisc<double>::round(building.width / 6.0f);
             right_x = 512/1024.0;
             front_x = 480.0/1024.0;
             back_x = 512.0/1024.0;
@@ -475,7 +475,7 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const
           int column = ((int) (mt_rand(&seed) * 1000)) % 5;
           float base_y = 288 / 1024.0;
           float top_y = base_y + 16.0 * (float) building.floors / 1024.0;
-          float left_x = column * 192.0 /1024.0 + 32.0 / 1024.0 * round((float) building.width / 10.0f);
+          float left_x = column * 192.0 / 1024.0 + 32.0 / 1024.0 * SGMisc<double>::round((float)building.width / 10.0f);
           float right_x = column * 192.0 /1024.0;
 
           // BASEMENT - uses the baseline texture
@@ -560,7 +560,7 @@ BuildingBoundingBoxCallback::computeBound(const Drawable& drawable) const
           int column = ((int) (mt_rand(&seed) * 1000)) % 8;
           float base_y = 576 / 1024.0;
           float top_y = base_y + 16.0 * (float) building.floors / 1024.0;
-          float left_x = column * 128.0 /1024.0 + 32.0 / 1024.0 * round((float) building.width / 20.0f);
+          float left_x = column * 128.0 / 1024.0 + 32.0 / 1024.0 * SGMisc<double>::round((float)building.width / 20.0f);
           float right_x = column * 128.0 /1024.0;
 
           // BASEMENT - uses the baseline texture