void-packages/srcpkgs/xplanet/patches/fix-gcc6-nullptr.patch
2016-09-23 11:26:00 +02:00

119 lines
4.9 KiB
Diff

--- src/libannotate/addArcs.cpp 2013-02-16 20:37:45.000000000 +0100
+++ src/libannotate/addArcs.cpp 2016-09-23 11:12:28.243514027 +0200
@@ -258,7 +258,7 @@
{
ifstream inFile(arcFile.c_str());
char *line = new char[MAX_LINE_LENGTH];
- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
readArcFile(line, planet, view, projection,
planetProperties, annotationMap);
@@ -291,8 +291,8 @@
if (foundFile)
{
ifstream inFile(arcFile.c_str());
- char *line = new char[256];
- while (inFile.getline (line, 256, '\n') != NULL)
+ char *line = new char[MAX_LINE_LENGTH];
+ while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
readArcFile(line, NULL, view, NULL, NULL, annotationMap);
inFile.close();
--- src/libannotate/addMarkers.cpp 2013-02-16 20:37:45.000000000 +0100
+++ src/libannotate/addMarkers.cpp 2016-09-23 11:15:29.932640115 +0200
@@ -429,7 +429,7 @@
{
ifstream inFile(markerFile.c_str());
char *line = new char[MAX_LINE_LENGTH];
- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
{
unsigned char color[3];
memcpy(color, planetProperties->MarkerColor(), 3);
@@ -475,7 +475,7 @@
{
ifstream inFile(markerFile.c_str());
char *line = new char[MAX_LINE_LENGTH];
- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
{
unsigned char color[3];
memcpy(color, options->Color(), 3);
--- src/libannotate/addSatellites.cpp 2013-02-16 20:37:45.000000000 +0100
+++ src/libannotate/addSatellites.cpp 2016-09-23 11:18:06.052752831 +0200
@@ -488,10 +488,9 @@
{
ifstream inFile(tleFile.c_str());
char lines[3][80];
- while (inFile.getline(lines[0], 80) != NULL)
+ while (inFile.getline(lines[0], 80))
{
- if ((inFile.getline(lines[1], 80) == NULL)
- || (inFile.getline(lines[2], 80) == NULL))
+ if (!inFile.getline(lines[1], 80) || !inFile.getline(lines[2], 80))
{
ostringstream errStr;
errStr << "Malformed TLE file (" << tleFile << ")?\n";
@@ -542,7 +541,7 @@
{
ifstream inFile(satFile.c_str());
char *line = new char[MAX_LINE_LENGTH];
- while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
readSatelliteFile(line, planet, view, projection,
planetProperties, annotationMap);
--- src/libmultiple/drawStars.cpp 2013-02-16 20:37:45.000000000 +0100
+++ src/libmultiple/drawStars.cpp 2016-09-23 11:20:16.747849925 +0200
@@ -41,7 +41,7 @@
ifstream inFile(starMap.c_str());
char line[MAX_LINE_LENGTH];
- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
{
if (line[0] == '#') continue;
--- src/libmultiple/RayleighScattering.cpp 2013-02-16 20:37:45.000000000 +0100
+++ src/libmultiple/RayleighScattering.cpp 2016-09-23 11:22:16.158937255 +0200
@@ -369,7 +369,7 @@
diskTemplate_.clear();
limbTemplate_.clear();
- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
{
int i = 0;
while (isDelimiter(line[i]))
@@ -439,7 +439,7 @@
values.clear();
char line[MAX_LINE_LENGTH];
- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
{
int i = 0;
while (isDelimiter(line[i]))
@@ -470,7 +470,7 @@
double &value)
{
char line[MAX_LINE_LENGTH];
- while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
+ while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
{
int i = 0;
while (isDelimiter(line[i]))
--- src/readConfig.cpp 2013-02-16 20:37:47.000000000 +0100
+++ src/readConfig.cpp 2016-09-23 11:24:13.950022143 +0200
@@ -549,8 +549,8 @@
currentProperties = defaultProperties;
ifstream inFile(configFile.c_str());
- char *line = new char[256];
- while (inFile.getline(line, 256, '\n') != NULL)
+ char *line = new char[MAX_LINE_LENGTH];
+ while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
readConfig(line, planetProperties);
// This condition will only be true if [default] is the only