null-comparison.patch 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. Index: src/libannotate/addArcs.cpp
  2. ===================================================================
  3. diff --git a/src/libannotate/addArcs.cpp b/src/libannotate/addArcs.cpp
  4. --- a/src/libannotate/addArcs.cpp (revision 206)
  5. +++ b/src/libannotate/addArcs.cpp (revision 207)
  6. @@ -258,7 +258,7 @@
  7. {
  8. ifstream inFile(arcFile.c_str());
  9. char *line = new char[MAX_LINE_LENGTH];
  10. - while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
  11. + while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
  12. readArcFile(line, planet, view, projection,
  13. planetProperties, annotationMap);
  14. @@ -292,7 +292,7 @@
  15. {
  16. ifstream inFile(arcFile.c_str());
  17. char *line = new char[256];
  18. - while (inFile.getline (line, 256, '\n') != NULL)
  19. + while (inFile.getline (line, 256, '\n'))
  20. readArcFile(line, NULL, view, NULL, NULL, annotationMap);
  21. inFile.close();
  22. Index: src/libannotate/addMarkers.cpp
  23. ===================================================================
  24. diff --git a/src/libannotate/addMarkers.cpp b/src/libannotate/addMarkers.cpp
  25. --- a/src/libannotate/addMarkers.cpp (revision 206)
  26. +++ b/src/libannotate/addMarkers.cpp (revision 207)
  27. @@ -429,7 +429,7 @@
  28. {
  29. ifstream inFile(markerFile.c_str());
  30. char *line = new char[MAX_LINE_LENGTH];
  31. - while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
  32. + while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
  33. {
  34. unsigned char color[3];
  35. memcpy(color, planetProperties->MarkerColor(), 3);
  36. @@ -475,7 +475,7 @@
  37. {
  38. ifstream inFile(markerFile.c_str());
  39. char *line = new char[MAX_LINE_LENGTH];
  40. - while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
  41. + while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
  42. {
  43. unsigned char color[3];
  44. memcpy(color, options->Color(), 3);
  45. Index: src/libannotate/addSatellites.cpp
  46. ===================================================================
  47. diff --git a/src/libannotate/addSatellites.cpp b/src/libannotate/addSatellites.cpp
  48. --- a/src/libannotate/addSatellites.cpp (revision 206)
  49. +++ b/src/libannotate/addSatellites.cpp (revision 207)
  50. @@ -488,10 +488,10 @@
  51. {
  52. ifstream inFile(tleFile.c_str());
  53. char lines[3][80];
  54. - while (inFile.getline(lines[0], 80) != NULL)
  55. + while (inFile.getline(lines[0], 80))
  56. {
  57. - if ((inFile.getline(lines[1], 80) == NULL)
  58. - || (inFile.getline(lines[2], 80) == NULL))
  59. + if ((!inFile.getline(lines[1], 80))
  60. + || (!inFile.getline(lines[2], 80)))
  61. {
  62. ostringstream errStr;
  63. errStr << "Malformed TLE file (" << tleFile << ")?\n";
  64. @@ -542,7 +542,7 @@
  65. {
  66. ifstream inFile(satFile.c_str());
  67. char *line = new char[MAX_LINE_LENGTH];
  68. - while (inFile.getline (line, MAX_LINE_LENGTH, '\n') != NULL)
  69. + while (inFile.getline (line, MAX_LINE_LENGTH, '\n'))
  70. readSatelliteFile(line, planet, view, projection,
  71. planetProperties, annotationMap);
  72. Index: src/libannotate/addSpiceObjects.cpp
  73. ===================================================================
  74. diff --git a/src/libannotate/addSpiceObjects.cpp b/src/libannotate/addSpiceObjects.cpp
  75. --- a/src/libannotate/addSpiceObjects.cpp (revision 206)
  76. +++ b/src/libannotate/addSpiceObjects.cpp (revision 207)
  77. @@ -524,7 +524,7 @@
  78. {
  79. ifstream inFile(kernelFile.c_str());
  80. char *line = new char[MAX_LINE_LENGTH];
  81. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  82. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  83. {
  84. int ii = 0;
  85. while (isDelimiter(line[ii]))
  86. @@ -576,7 +576,7 @@
  87. {
  88. ifstream inFile(spiceFile.c_str());
  89. char *line = new char[MAX_LINE_LENGTH];
  90. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  91. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  92. readSpiceFile(line, planetsFromSunMap, view, projection,
  93. annotationMap);
  94. inFile.close();
  95. Index: src/libmultiple/RayleighScattering.cpp
  96. ===================================================================
  97. diff --git a/src/libmultiple/RayleighScattering.cpp b/src/libmultiple/RayleighScattering.cpp
  98. --- a/src/libmultiple/RayleighScattering.cpp (revision 206)
  99. +++ b/src/libmultiple/RayleighScattering.cpp (revision 207)
  100. @@ -369,7 +369,7 @@
  101. diskTemplate_.clear();
  102. limbTemplate_.clear();
  103. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  104. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  105. {
  106. int i = 0;
  107. while (isDelimiter(line[i]))
  108. @@ -439,7 +439,7 @@
  109. values.clear();
  110. char line[MAX_LINE_LENGTH];
  111. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  112. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  113. {
  114. int i = 0;
  115. while (isDelimiter(line[i]))
  116. @@ -470,7 +470,7 @@
  117. double &value)
  118. {
  119. char line[MAX_LINE_LENGTH];
  120. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  121. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  122. {
  123. int i = 0;
  124. while (isDelimiter(line[i]))
  125. Index: src/libmultiple/drawStars.cpp
  126. ===================================================================
  127. diff --git a/src/libmultiple/drawStars.cpp b/src/libmultiple/drawStars.cpp
  128. --- a/src/libmultiple/drawStars.cpp (revision 206)
  129. +++ b/src/libmultiple/drawStars.cpp (revision 207)
  130. @@ -41,7 +41,7 @@
  131. ifstream inFile(starMap.c_str());
  132. char line[MAX_LINE_LENGTH];
  133. - while (inFile.getline(line, MAX_LINE_LENGTH, '\n') != NULL)
  134. + while (inFile.getline(line, MAX_LINE_LENGTH, '\n'))
  135. {
  136. if (line[0] == '#') continue;
  137. Index: src/readConfig.cpp
  138. ===================================================================
  139. diff --git a/src/readConfig.cpp b/src/readConfig.cpp
  140. --- a/src/readConfig.cpp (revision 206)
  141. +++ b/src/readConfig.cpp (revision 207)
  142. @@ -550,7 +550,7 @@
  143. ifstream inFile(configFile.c_str());
  144. char *line = new char[256];
  145. - while (inFile.getline(line, 256, '\n') != NULL)
  146. + while (inFile.getline(line, 256, '\n'))
  147. readConfig(line, planetProperties);
  148. // This condition will only be true if [default] is the only