--- xplanet-1.2.2/src/Options.cpp 2010-10-07 00:33:33.000000000 +0200
+++ xplanet-1.2.2-patch/src/Options.cpp 2011-12-04 11:31:45.916019745 +0100
@@ -6,6 +6,8 @@
#include <sstream>
using namespace std;
+#include <stdlib.h>
+
#include <sys/time.h>
#include "config.h"
--- xplanet-1.2.2/src/Ring.cpp 2009-03-30 15:44:35.000000000 +0200
+++ xplanet-1.2.2-patch/src/Ring.cpp 2011-12-04 11:37:00.821352008 +0100
@@ -171,6 +171,7 @@
Ring::getValue(const double *array, const int size, const int window,
const double dr, const double r, const double lon)
{
+ bool *shaded;
int i = static_cast<int> ((r_out - r)/dr);
if (i < 0 || i >= size) return(-1.0);
@@ -180,7 +181,10 @@
if (j1 < 0) j1 = 0;
if (j2 >= size) j2 = size - 1;
- bool shaded[j2-j1];
+ shaded = (bool *)malloc((j2-j1) * sizeof (bool));
+ if (shaded == NULL)
+ abort();
+
for (int j = 0; j < j2-j1; j++) shaded[j] = false;
const double cosLon = cos(lon);
--- xplanet-1.2.2/src/Satellite.cpp 2009-07-14 13:38:35.000000000 +0200
+++ xplanet-1.2.2-patch/src/Satellite.cpp 2011-12-04 11:37:38.725340490 +0100
@@ -4,6 +4,7 @@
#include <iostream>
using namespace std;
+#include <stdio.h>
#include <sys/time.h>
#include "xpUtil.h"
--- xplanet-1.2.2/src/drawMultipleBodies.cpp 2010-10-07 00:33:33.000000000 +0200
+++ xplanet-1.2.2-patch/src/drawMultipleBodies.cpp 2011-12-04 11:38:14.397953141 +0100
@@ -8,6 +8,8 @@
#include <vector>
using namespace std;
+#include <stdio.h>
+
#include "body.h"
#include "buildPlanetMap.h"
#include "config.h"
--- xplanet-1.2.2/src/libannotate/addMarkers.cpp 2009-08-30 04:28:23.000000000 +0200
+++ xplanet-1.2.2-patch/src/libannotate/addMarkers.cpp 2011-12-04 11:15:54.694776565 +0100
@@ -10,6 +10,8 @@
#include <vector>
using namespace std;
+#include <stdlib.h>
+
#include "buildPlanetMap.h"
#include "findFile.h"
#include "keywords.h"
--- xplanet-1.2.2/src/libannotate/addSatellites.cpp 2010-07-30 23:49:06.000000000 +0200
+++ xplanet-1.2.2-patch/src/libannotate/addSatellites.cpp 2011-12-04 11:20:29.029088477 +0100
@@ -10,6 +10,8 @@
#include <vector>
using namespace std;
+#include <stdio.h>
+
#include "findFile.h"
#include "keywords.h"
#include "Options.h"
--- xplanet-1.2.2/src/libdisplay/DisplayBase.cpp 2009-08-30 04:09:11.000000000 +0200
+++ xplanet-1.2.2-patch/src/libdisplay/DisplayBase.cpp 2011-12-04 11:24:30.776600052 +0100
@@ -7,6 +7,9 @@
#include <vector>
using namespace std;
+#include <stdio.h>
+#include <stdlib.h>
+
#include "body.h"
#include "findFile.h"
#include "keywords.h"
--- xplanet-1.2.2/src/libdisplay/DisplayOutput.cpp 2008-11-14 00:45:20.000000000 +0100
+++ xplanet-1.2.2-patch/src/libdisplay/DisplayOutput.cpp 2011-12-04 11:25:13.176822608 +0100
@@ -5,6 +5,8 @@
#include <sstream>
using namespace std;
+#include <stdio.h>
+
#include "keywords.h"
#include "Options.h"
#include "PlanetProperties.h"
--- xplanet-1.2.2/src/libmultiple/drawEllipsoid.cpp 2006-03-26 07:03:20.000000000 +0200
+++ xplanet-1.2.2-patch/src/libmultiple/drawEllipsoid.cpp 2011-12-04 11:27:25.440968769 +0100
@@ -84,7 +84,7 @@
if (determinant < 0) continue;
- double u = -(b + sqrt(determinant));
+ double u = -(b + std::sqrt(determinant));
u /= a;
// if the intersection point is behind the observer, don't
@@ -116,7 +116,7 @@
double opacity = 1;
if (pR * determinant/centerDet < 10)
{
- opacity = 1 - pow(1-determinant/centerDet, pR);
+ opacity = 1 - std::pow(1-determinant/centerDet, pR);
}
display->setPixel(i, j, color, opacity);
}
--- xplanet-1.2.2/src/libmultiple/drawSphere.cpp 2006-03-26 07:03:20.000000000 +0200
+++ xplanet-1.2.2-patch/src/libmultiple/drawSphere.cpp 2011-12-04 11:27:04.049112351 +0100
@@ -70,7 +70,7 @@
if (determinant < 0) continue;
- double u = -(b + sqrt(determinant));
+ double u = -(b + std::sqrt(determinant));
u /= a;
// if the intersection point is behind the observer, don't
@@ -105,7 +105,7 @@
double opacity = 1;
if (pR * determinant/centerDet < 10)
{
- opacity = 1 - pow(1-determinant/centerDet, pR);
+ opacity = 1 - std::pow(1-determinant/centerDet, pR);
}
display->setPixel(i, j, color, opacity);
}
--- xplanet-1.2.2/src/libprojection/ProjectionBonne.cpp 2006-03-26 07:03:20.000000000 +0200
+++ xplanet-1.2.2-patch/src/libprojection/ProjectionBonne.cpp 2011-12-04 11:28:17.497449483 +0100
@@ -13,6 +13,8 @@
#include <vector>
using namespace std;
+#include <stdio.h>
+
#include "Options.h"
#include "ProjectionBonne.h"
#include "xpUtil.h"
--- xplanet-1.2.2/src/libprojection/ProjectionGnomonic.cpp 2006-03-26 07:03:20.000000000 +0200
+++ xplanet-1.2.2-patch/src/libprojection/ProjectionGnomonic.cpp 2011-12-04 11:28:42.609666622 +0100
@@ -12,6 +12,8 @@
#include <sstream>
using namespace std;
+#include <stdio.h>
+
#include "Options.h"
#include "ProjectionGnomonic.h"
#include "xpUtil.h"
--- xplanet-1.2.2/src/libprojection/ProjectionMercator.cpp 2006-03-26 07:03:20.000000000 +0200
+++ xplanet-1.2.2-patch/src/libprojection/ProjectionMercator.cpp 2011-12-04 11:29:41.162354654 +0100
@@ -3,6 +3,8 @@
#include <sstream>
using namespace std;
+#include <stdio.h>
+
#include "Options.h"
#include "ProjectionMercator.h"
#include "xpUtil.h"
--- xplanet-1.2.2/src/libprojection/getProjection.cpp 2008-11-14 00:50:36.000000000 +0100
+++ xplanet-1.2.2-patch/src/libprojection/getProjection.cpp 2011-12-04 11:30:58.402591739 +0100
@@ -5,6 +5,8 @@
#include <vector>
using namespace std;
+#include <stdlib.h>
+
#include "keywords.h"
#include "xpUtil.h"
--- xplanet-1.2.2/src/parse.cpp 2010-07-30 23:49:14.000000000 +0200
+++ xplanet-1.2.2-patch/src/parse.cpp 2011-12-04 11:38:48.790296464 +0100
@@ -4,6 +4,8 @@
#include <string>
using namespace std;
+#include <stdio.h>
+
#include "keywords.h"
#include "parseColor.h"
#include "xpUtil.h"
--- xplanet-1.2.2/src/setPositions.cpp 2008-11-14 00:55:40.000000000 +0100
+++ xplanet-1.2.2-patch/src/setPositions.cpp 2011-12-04 11:39:28.806338685 +0100
@@ -4,6 +4,8 @@
#include <sstream>
using namespace std;
+#include <stdlib.h>
+
#include "buildPlanetMap.h"
#include "findBodyXYZ.h"
#include "keywords.h"
--- xplanet-1.2.2/src/xpUtil.cpp 2008-11-14 00:56:09.000000000 +0100
+++ xplanet-1.2.2-patch/src/xpUtil.cpp 2011-12-04 11:39:59.086909231 +0100
@@ -10,6 +10,9 @@
#include <string>
using namespace std;
+#include <stdlib.h>
+#include <stdio.h>
+
#include <unistd.h>
extern char **environ;