Portability: Fix compile errors on MSVC

From Scott (xDraconian)
This commit is contained in:
James Turner
2015-03-24 11:05:57 -05:00
parent 3c204e84f4
commit 0b6738b616
15 changed files with 21 additions and 18 deletions

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "jupiter.hxx"

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "mars.hxx"

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "mercury.hxx"

View File

@@ -25,7 +25,7 @@
#ifdef __BORLANDC__
# define exception c_exception
#endif
#include <math.h>
#include <cmath>
#include "neptune.hxx"

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "saturn.hxx"

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include <simgear/debug/logstream.hxx>

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "uranus.hxx"

View File

@@ -22,7 +22,7 @@
* $Id$
**************************************************************************/
#include <math.h>
#include <cmath>
#include "venus.hxx"

View File

@@ -27,6 +27,7 @@
#include <cstring>
#include <cstdlib>
#include <algorithm>
namespace simgear {

View File

@@ -32,6 +32,7 @@
#include <cstring>
#include <cstdlib> // for atoi
#include <algorithm>
using std::string;

View 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>

View File

@@ -26,7 +26,7 @@
#endif
#include <math.h>
#include <cmath>
#include <simgear/magvar/magvar.hxx>
#include <simgear/math/SGMath.hxx>

View 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>

View File

@@ -23,6 +23,7 @@
#include <ctype.h>
#include <cstring>
#include <sstream>
#include <algorithm>
#include "strutils.hxx"

View 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