]> git.mxchange.org Git - simgear.git/commitdiff
Alas. Fix #pragma magic for GCC <= 4.5.
authorThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 21:18:17 +0000 (22:18 +0100)
committerThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 21:18:17 +0000 (22:18 +0100)
push/pop was introduced for GCC4.6 only - so avoid it.
Also, properly fix the fgets warning.

simgear/math/SGSphere.hxx
simgear/math/SGVec3.hxx
simgear/timing/timezone.cxx

index da0c641a310775366d3c0f6e25984b93c9f4f3fc..f46b7a0ffab4421d8b620104da2a9b101ab0834d 100644 (file)
@@ -25,7 +25,6 @@ public:
 
 #ifdef __GNUC__
 // Avoid "_center not initialized" warnings.
-#   pragma GCC diagnostic push
 #   pragma GCC diagnostic ignored "-Wuninitialized"
 #endif
 
@@ -49,7 +48,7 @@ public:
 
 #ifdef __GNUC__
   // Restore warning settings.
-#   pragma GCC diagnostic pop
+#   pragma GCC diagnostic warning "-Wuninitialized"
 #endif
 
   const SGVec3<T>& getCenter() const
index 8483f92a69ced9c2dc8164724a802f0c92c22660..c85b418e23cbab173b66f4164606b4ae13561ecf 100644 (file)
@@ -31,7 +31,6 @@ public:
 
 #ifdef __GNUC__
 // Avoid "_data not initialized" warnings (see comment below).
-#   pragma GCC diagnostic push
 #   pragma GCC diagnostic ignored "-Wuninitialized"
 #endif
 
@@ -50,7 +49,7 @@ public:
 
 #ifdef __GNUC__
   // Restore warning settings.
-#   pragma GCC diagnostic pop
+#   pragma GCC diagnostic warning "-Wuninitialized"
 #endif
 
   /// Constructor. Initialize by the given values
index 3a8fa7fc91801a9d55f6161491e7a10022a6b351..26174c7538f513d3c27333ee6bb1b0d7215bf3d6 100644 (file)
@@ -143,7 +143,8 @@ SGTimeZoneContainer::SGTimeZoneContainer(const char *filename)
     errno = 0;
 
     while (1) {
-        (void) fgets(buffer, 256, infile);
+        if (0 == fgets(buffer, 256, infile))
+            break;
         if (feof(infile)) {
             break;
         }